Changeset 11528


Ignore:
Timestamp:
01/03/09 13:08:56 (12 years ago)
Author:
Mark Evenson
Message:

Enable optional use of JFluid profiler.

Location:
trunk/abcl
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/build.properties.in

    r11489 r11528  
    11# build.properties
    22# $Id: build.properties,v 1.23 2007-03-03 19:19:11 piso Exp $
     3
     4#additional.jars=${user.home}/work/lsw/lib/bsh-2.0b4.jar:${user.home}/work/lsw/lib/jscheme.jar
     5#java.options=-Xmx2g
     6
     7#abcl.src.version=r14888+possibly-scripting
     8
     9
     10#abcl.build.module=scripting
  • trunk/abcl/nbproject/build-impl.xml

    r11484 r11528  
    6565        </condition>
    6666        <condition property="have.tests">
    67             <or/>
     67            <or>
     68                <available file="${test.src.dir}"/>
     69            </or>
    6870        </condition>
    6971        <condition property="have.sources">
     
    124126    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
    125127        <fail unless="src.dir">Must set src.dir</fail>
     128        <fail unless="test.src.dir">Must set test.src.dir</fail>
    126129        <fail unless="build.dir">Must set build.dir</fail>
    127130        <fail unless="dist.dir">Must set dist.dir</fail>
     
    197200            <sequential>
    198201                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
    199                     <batchtest todir="${build.test.results.dir}"/>
     202                    <batchtest todir="${build.test.results.dir}">
     203                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
     204                            <filename name="@{testincludes}"/>
     205                        </fileset>
     206                    </batchtest>
    200207                    <classpath>
    201208                        <path path="${run.test.classpath}"/>
     
    502509    </target>
    503510    <target if="do.depend.true" name="-compile-test-depend">
    504         <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir=""/>
     511        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
    505512    </target>
    506513    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
    507         <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir=""/>
    508         <copy todir="${build.test.classes.dir}"/>
     514        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
     515        <copy todir="${build.test.classes.dir}">
     516            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
     517        </copy>
    509518    </target>
    510519    <target name="-post-compile-test">
     
    520529        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
    521530        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
    522         <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="" srcdir=""/>
    523         <copy todir="${build.test.classes.dir}"/>
     531        <j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}"/>
     532        <copy todir="${build.test.classes.dir}">
     533            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
     534        </copy>
    524535    </target>
    525536    <target name="-post-compile-test-single">
  • trunk/abcl/nbproject/genfiles.properties

    r11484 r11528  
    44# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    55# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    6 nbproject/build-impl.xml.data.CRC32=71623fcd
    7 nbproject/build-impl.xml.script.CRC32=7d8238bd
     6nbproject/build-impl.xml.data.CRC32=742204ce
     7nbproject/build-impl.xml.script.CRC32=b94c76f8
    88nbproject/build-impl.xml.stylesheet.CRC32=e55b27f5
    99nbproject/profiler-build-impl.xml.data.CRC32=71623fcd
  • trunk/abcl/nbproject/project.properties

    r11499 r11528  
    1818dist.jar=${dist.dir}/abcl.jar
    1919dist.javadoc.dir=${dist.dir}/javadoc
    20 excludes=
     20excludes=org/armedbear/lisp/scripting/*.java
    2121file.reference.abcl-src=src
    2222includes=org/armedbear/lisp/**/*.java,org/armedbear/lisp/**/*.lisp
    2323jar.compress=true
     24javac.classpath=
    2425# Space-separated list of extra javac options
    2526javac.compilerargs=
     
    6667src.doc.dir=doc
    6768src.themes.dir=themes
     69test.src.dir=test/src
  • trunk/abcl/nbproject/project.xml

    r11484 r11528  
    99                <root id="src.dir"/>
    1010            </source-roots>
    11             <test-roots/>
     11            <test-roots>
     12                <root id="test.src.dir" name="test/src"/>
     13            </test-roots>
    1214        </data>
    1315    </configuration>
  • trunk/abcl/netbeans-build.xml

    r11483 r11528  
    66     probably fail otherwise.  -->
    77  <import file="nbproject/build-impl.xml"/>
     8  <import file="nbproject/profiler-build-impl.xml" optional="true"/>
    89
    910  <target name="-post-compile">
  • trunk/abcl/src/org/armedbear/lisp/Autoload.java

    r11488 r11528  
    453453        autoload("probe-file", "probe_file");
    454454        autoload("rational", "FloatFunctions");
     455  autoload("read-char-no-hang", "read_char_no_hang");
     456  autoload("read-delimited-list", "read_delimited_list");
    455457        autoload("rem", "rem");
    456458        autoload("remhash", "HashTableFunctions");
     
    514516        autoload(PACKAGE_EXT, "thread-unlock", "ThreadLock", true);
    515517        autoload(PACKAGE_JAVA, "%jnew-proxy", "JProxy");
     518  autoload(PACKAGE_JAVA, "%find-java-class", "JavaClass");
     519  autoload(PACKAGE_JAVA, "%jmake-invocation-handler", "JProxy");
     520  autoload(PACKAGE_JAVA, "%jmake-proxy", "JProxy");
    516521        autoload(PACKAGE_JAVA, "%jnew-runtime-class", "RuntimeClass");
    517522        autoload(PACKAGE_JAVA, "%jredefine-method", "RuntimeClass");
  • trunk/abcl/src/org/armedbear/lisp/Closure.java

    r11488 r11528  
    596596        SpecialBinding lastSpecialBinding = thread.lastSpecialBinding;
    597597        Environment ext = new Environment(environment);
     598  for (Symbol special: specials)
     599    ext.declareSpecial(special);
    598600        bindRequiredParameters(ext, thread, first, second, third, fourth,
    599601                               fifth, sixth, seventh);
  • trunk/abcl/src/org/armedbear/lisp/StandardClass.java

    r11488 r11528  
    124124    addStandardClass(Symbol.BUILT_IN_CLASS, list1(CLASS));
    125125
     126  public static final StandardClass JAVA_CLASS =
     127    addStandardClass(Symbol.JAVA_CLASS, list1(CLASS));
     128
    126129  public static final StandardClass FORWARD_REFERENCED_CLASS =
    127130    addStandardClass(Symbol.FORWARD_REFERENCED_CLASS, list1(CLASS));
     
    280283                               list1(PACKAGE_CL.intern("ARITHMETIC-ERROR-OPERANDS")))));
    281284    BUILT_IN_CLASS.setCPL(BUILT_IN_CLASS, CLASS, STANDARD_OBJECT,
     285                          BuiltInClass.CLASS_T);
     286    JAVA_CLASS.setCPL(JAVA_CLASS, CLASS, STANDARD_OBJECT,
    282287                          BuiltInClass.CLASS_T);
    283288    CELL_ERROR.setCPL(CELL_ERROR, ERROR, SERIOUS_CONDITION, CONDITION,
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r11492 r11528  
    29012901  public static final Symbol JAVA_OBJECT =
    29022902    PACKAGE_JAVA.addExternalSymbol("JAVA-OBJECT");
     2903  public static final Symbol JAVA_CLASS =
     2904    PACKAGE_JAVA.addExternalSymbol("JAVA-CLASS");
    29032905  public static final Symbol JCALL =
    29042906    PACKAGE_JAVA.addExternalSymbol("JCALL");
  • trunk/abcl/src/org/armedbear/lisp/Version.java

    r11448 r11528  
    4242  public static String getVersion()
    4343  {
    44     return "0.13.0-dev";
     44    return "0.12.25";
    4545  }
    4646}
  • trunk/abcl/src/org/armedbear/lisp/autoloads.lisp

    r11391 r11528  
    202202(export 'jobject-class "JAVA")
    203203(autoload 'jobject-class "java")
     204(export 'jproperty-value "JAVA")
     205(autoload 'jproperty-value "java")
    204206(export 'jclass-superclass "JAVA")
    205207(autoload 'jclass-superclass "java")
  • trunk/abcl/src/org/armedbear/lisp/java.lisp

    r11391 r11528  
    7676    (apply #'%jnew-proxy interface method-names-and-defs)))
    7777
     78(defun jmake-invocation-handler (function)
     79  (%jmake-invocation-handler function))
     80 
     81(when (autoloadp 'jmake-proxy)
     82  (fmakunbound 'jmake-proxy))
     83 
     84(defgeneric jmake-proxy (interface implementation &optional lisp-this)
     85   (:documentation "Returns a proxy Java object implementing the
     86   provided interface using methods implemented in Lisp - typically
     87   closures, but implementations are free to provide other
     88   mechanisms. You can pass an optional 'lisp-this' object that will
     89   be passed to the implementing methods as their first argument. If
     90   you don't provide this object, NIL will be used. The second
     91   argument of the Lisp methods is the name of the Java method being
     92   implemented. This has the implication that overloaded methods are
     93   merged, so you have to manually discriminate them if you want
     94   to. The remaining arguments are java-objects wrapping the method's
     95   parameters."))
     96
     97(defmethod jmake-proxy (interface invocation-handler &optional lisp-this)
     98  "Basic implementation that directly uses an invocation handler."
     99  (%jmake-proxy (jclass interface) invocation-handler lisp-this))
     100
     101(defmethod jmake-proxy (interface (implementation function) &optional lisp-this)
     102   "Implements a Java interface forwarding method calls to a Lisp function."
     103   (%jmake-proxy (jclass interface) (jmake-invocation-handler implementation) lisp-this))
     104
     105 (defmethod jmake-proxy (interface (implementation package) &optional lisp-this)
     106   "Implements a Java interface mapping Java method names to symbols
     107in a given package. javaMethodName is mapped to a JAVA-METHOD-NAME
     108symbol. An error is signaled if no such symbol exists in the package,
     109or if the symbol exists but does not name a function."
     110
     111   (flet ((java->lisp (name)
     112      (with-output-to-string (str)
     113        (let ((last-lower-p nil))
     114    (map nil (lambda (char)
     115         (let ((upper-p (char= (char-upcase char) char)))
     116           (when (and last-lower-p upper-p)
     117             (princ "-" str))
     118           (setf last-lower-p (not upper-p))
     119           (princ (char-upcase char) str)))
     120         name)))))
     121     (%jmake-proxy (jclass interface)
     122       (jmake-invocation-handler
     123        (lambda (obj method &rest args)
     124          (let ((sym (find-symbol
     125          (java->lisp method)
     126          implementation)))
     127      (unless sym
     128        (error "Symbol ~A, implementation of method ~A, not found in ~A"
     129         (java->lisp method)
     130         method
     131         implementation))
     132      (if (fboundp sym)
     133          (apply (symbol-function sym) obj method args)
     134          (error "Function ~A, implementation of method ~A, not found in ~A"
     135           sym method implementation)))))
     136       lisp-this)))
     137
     138(defmethod jmake-proxy (interface (implementation hash-table) &optional lisp-this)
     139   "Implements a Java interface using closures in an hash-table keyed
     140by Java method name."
     141   (%jmake-proxy (jclass interface)
     142    (jmake-invocation-handler
     143     (lambda (obj method &rest args)
     144       (let ((fn (gethash method implementation)))
     145         (if fn
     146       (apply fn obj args)
     147       (error "Implementation for method ~A not found in ~A"
     148        method implementation)))))
     149    lisp-this))
     150 
    78151(defun jobject-class (obj)
    79152  "Returns the Java class that OBJ belongs to"
     
    234307
    235308(provide "JAVA-EXTENSIONS")
     309 (defun jproperty-value (obj prop)
     310   (%jget-property-value obj prop))
     311 
     312 (defun (setf jproperty-value) (value obj prop)
     313   (%jset-property-value obj prop value))
     314
  • trunk/abcl/src/org/armedbear/lisp/print-object.lisp

    r11391 r11528  
    5050    (format stream "~S" (class-name (class-of object))))
    5151  object)
     52
     53(defmethod print-object ((class java:java-class) stream)
     54   (write-string (%write-to-string class) stream))
    5255
    5356(defmethod print-object ((class class) stream)
     
    121124  (if *print-escape*
    122125      (print-unreadable-object (e stream :type t :identity t)
     126  (format stream "~A"
     127    (java:jcall (java:jmethod "java.lang.Object" "toString")
     128          (java:java-exception-cause e))))
     129      (format stream "Java exception '~A'."
     130        (java:jcall (java:jmethod "java.lang.Object" "toString")
     131        (java:java-exception-cause e)))))
     132
     133(defmethod print-object ((e java:java-exception) stream)
     134  (if *print-escape*
     135      (print-unreadable-object (e stream :type t :identity t)
    123136        (format stream "~A"
    124137                (java:jcall (java:jmethod "java.lang.Object" "toString")
Note: See TracChangeset for help on using the changeset viewer.