First stab at restoring runtime-class.

Supported: extending a Java class, implementing interfaces, defining methods
of up to 7 non-primitive arguments returning void or a non-primitive object.
Unsupported: everything else, including fields, constructors, annotations,
primitive arguments and return values, and the LispObject[] call convention
for functions with more than 8 arguments.
parent 9232f271
......@@ -42,8 +42,14 @@ public class MemoryClassLoader extends JavaClassLoader {
private final HashMap<String, JavaObject> hashtable = new HashMap<String, JavaObject>();
private final JavaObject boxedThis = new JavaObject(this);
private final String internalNamePrefix;
public MemoryClassLoader() {
this("org/armedbear/lisp/");
}
public MemoryClassLoader(String internalNamePrefix) {
this.internalNamePrefix = internalNamePrefix;
}
@Override
......@@ -59,7 +65,7 @@ public class MemoryClassLoader extends JavaClassLoader {
* which - in ABCL - is pretty deep, most of the time.
*/
if (hashtable.containsKey(name)) {
String internalName = "org/armedbear/lisp/" + name;
String internalName = internalNamePrefix + name;
Class<?> c = this.findLoadedClass(internalName);
if (c == null) {
......
......@@ -278,10 +278,6 @@
(autoload 'jmember-protected-p "java")
(export 'jnew-runtime-class "JAVA")
(autoload 'jnew-runtime-class "runtime-class")
(export 'jredefine-method "JAVA")
(autoload 'jredefine-method "runtime-class")
(export 'jruntime-class-exists-p "JAVA")
(autoload 'jruntime-class-exists-p "runtime-class")
(export 'ensure-java-class "JAVA")
(autoload 'ensure-java-class "java")
(export 'chain "JAVA")
......
......@@ -243,7 +243,7 @@
;;"run-benchmarks.lisp"
"run-program.lisp"
"run-shell-command.lisp"
;;"runtime-class.lisp"
"runtime-class.lisp"
"search.lisp"
"sequences.lisp"
"sets.lisp"
......
......@@ -288,7 +288,7 @@ calls on the java.util.Enumeration `jenumeration`."
(declare (ignore unused-value))
(if instance-supplied-p
(jfield class-ref-or-field field-or-instance instance newvalue)
(jfield class-ref-or-field field-or-instance newvalue)))
(jfield class-ref-or-field field-or-instance nil newvalue)))
(defun jclass-methods (class &key declared public)
"Return a vector of all (or just the declared/public, if DECLARED/PUBLIC is true) methods of CLASS"
......
......@@ -233,6 +233,7 @@
(define-opcode lreturn 173 1 nil nil)
(define-opcode freturn 174 1 nil nil)
(define-opcode dreturn 175 1 nil nil)
(define-opcode ireturn 172 1 -1 nil)
(define-opcode areturn 176 1 -1 nil)
(define-opcode return 177 1 0 nil)
(define-opcode getstatic 178 3 1 nil)
......@@ -568,6 +569,7 @@
165 ; if_acmpeq
166 ; if_acmpne
167 ; goto
172 ; ireturn
176 ; areturn
177 ; return
178 ; getstatic
......@@ -721,7 +723,9 @@
(internal-compiler-error "Stack inconsistency detected ~
in ~A at index ~D: ~
found ~S, expected ~S."
(compiland-name *current-compiland*)
(if *current-compiland*
(compiland-name *current-compiland*)
"<unknown>")
i instruction-depth
(+ depth instruction-stack)))
(return-from analyze-stack-path))
......@@ -732,7 +736,9 @@
(internal-compiler-error "Stack inconsistency detected ~
in ~A at index ~D: ~
negative depth ~S."
(compiland-name *current-compiland*)
(if *current-compiland*
(compiland-name *current-compiland*)
"<unknown>")
i depth))
(when (branch-p opcode)
(let ((label (car (instruction-args instruction))))
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment