Get rid of asm_javacallmethod
authorstefan <none@none>
Sat, 13 Dec 2003 23:11:08 +0000 (23:11 +0000)
committerstefan <none@none>
Sat, 13 Dec 2003 23:11:08 +0000 (23:11 +0000)
23 files changed:
asmpart.h
headers.c
jit/i386/asmpart.S
jit/i386/codegen.c
jit/i386/methodtable.c
jni.c
loader.c
main.c
mm/boehm.c
nat/Runtime.c
native.c
src/cacao/cacao.c
src/cacaoh/headers.c
src/mm/boehm.c
src/native/jni.c
src/native/native.c
src/native/vm/VMRuntime.c
src/threads/green/threads.c
src/vm/jit/asmpart.h
src/vm/jit/i386/asmpart.S
src/vm/jit/i386/codegen.c
src/vm/loader.c
threads/thread.c

index 3a98ba64761c0561b6a10a59e3536860256c6cfe..d0cd0f1d417241883fa59f95ed159b4ac9876cfa 100644 (file)
--- a/asmpart.h
+++ b/asmpart.h
@@ -29,7 +29,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: asmpart.h 664 2003-11-21 18:24:01Z jowenn $
+   $Id: asmpart.h 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -62,8 +62,6 @@ void asm_call_jit_compiler();
    with up to 4 parameters. This function calls a Java-method (which
    possibly needs compilation) with up to 4 parameters.
 */
-java_objectheader *asm_calljavamethod(methodinfo *m, void *arg1, void *arg2,
-                                      void *arg3, void *arg4);
 
 /* 
    This function calls a Java-method (which possibly needs compilation)
index 2c31d341d20fe7ab5c32e5d284d79d3986435c94..947a4bc875e51bccc94f320ed468f80d6c3326cd 100644 (file)
--- a/headers.c
+++ b/headers.c
@@ -29,7 +29,7 @@
    Changes: Mark Probst
             Philipp Tomsich
 
-   $Id: headers.c 745 2003-12-13 22:05:02Z twisti $
+   $Id: headers.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -104,7 +104,7 @@ void literalstring_free(java_objectheader *o) { }
 void stringtable_update() { }
 void synchronize_caches() { }
 void asm_call_jit_compiler() { }
-void asm_calljavamethod() { }
+void asm_calljavafunction() { }
 void asm_dumpregistersandcall() { }
 s4 asm_builtin_checkcast(java_objectheader *obj, classinfo *class) { return 0; }
 
index 610d5835a8f99a250ffac1b2746632d3ad9ee216..8c0cacd8872e3791f9a17ea12785ae2705176d33 100644 (file)
@@ -29,7 +29,7 @@
             Reinhard Grafl
             Christian Thalinger
 
-   $Id: asmpart.S 763 2003-12-13 22:47:44Z twisti $
+   $Id: asmpart.S 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -60,7 +60,6 @@
 /********************* exported functions and variables ***********************/
 
        .globl has_no_x_instr_set
-       .globl asm_calljavamethod
        .globl asm_calljavafunction
        .globl asm_calljavafunction2
        .globl asm_calljavafunction2long
@@ -127,98 +126,6 @@ has_no_x_instr_set:
                ret
 
 
-/********************* function asm_calljavamethod *****************************
-*                                                                              *
-*   This function calls a Java-method (which possibly needs compilation)       *
-*   with up to 4 parameters.                                                   *
-*                                                                              *
-*   This functions calls the JIT-compiler which eventually translates the      *
-*   method into machine code.                                                  *
-*                                                                              *
-*   An possibly throwed exception will be returned to the caller as function   *
-*   return value, so the java method cannot return a fucntion value (this      *
-*   function usually calls 'main' and '<clinit>' which do not return a         *
-*   function value).                                                           *
-*                                                                              *
-*   C-prototype:                                                               *
-*    javaobject_header *asm_calljavamethod (methodinfo *m,                     *
-*         void *arg1, void *arg2, void *arg3, void *arg4);                     *
-*                                                                              *
-*******************************************************************************/
-
-call_name:
-       .ascii  "calljavamethod\0\0"
-
-       .align  8
-       .long   0                         /* catch type all                       */
-       .long   calljava_xhandler         /* handler pc                           */
-       .long   calljava_xhandler         /* end pc                               */
-       .long   asm_calljavamethod        /* start pc                             */
-       .long   1                         /* extable size                         */
-       .long   0                         /* fltsave                              */
-       .long   0                         /* intsave                              */
-       .long   0                         /* isleaf                               */
-       .long   0                         /* IsSync                               */
-       .long   32                        /* frame size                           */
-       .long   0                         /* method pointer (pointer to name)     */
-
-asm_calljavamethod:
-               push    %ebp                  /* allocate stack space                 */
-               mov             %esp, %ebp
-
-        push    %ebx                  /* save registers                       */
-        push    %esi
-        push    %edi
-        
-               sub             $32,%esp              /* pass the remaining parameters        */
-               xor             %edx,%edx
-
-               mov             %edx,28(%esp)         /* convert parms to 8 byte              */
-               mov             24(%ebp),%eax
-               mov             %eax,24(%esp)
-               
-               mov             %edx,20(%esp)
-               mov             20(%ebp),%eax
-               mov             %eax,16(%esp)
-
-               mov             %edx,12(%esp)
-               mov             16(%ebp),%eax
-               mov             %eax,8(%esp)
-
-               mov             %edx,4(%esp)
-               mov             12(%ebp),%eax
-               mov             %eax,(%esp)
-
-               mov             8(%ebp),%eax          /* move function pointer to %eax        */
-
-               lea             asm_call_jit_compiler,%edx
-               call    *%edx                 /* call JIT compiler                    */
-               
-calljava_jit:
-calljava_return:
-calljava_ret:
-        add     $32,%esp
-        pop     %edi                  /* restore registers                    */
-        pop     %esi
-        pop     %ebx
-        
-               xor     %eax,%eax
-               leave                                             /* free stack space                     */
-               ret
-
-calljava_xhandler:
-               push    %eax                              /* pass exception pointer               */
-               call    builtin_throw_exception
-               add     $4,%esp
-        
-               add     $32,%esp
-        pop     %edi
-        pop     %esi
-        pop     %ebx
-        leave
-               ret
-
-
 /********************* function asm_calljavafunction ***************************
 *                                                                              *
 *   This function calls a Java-method (which possibly needs compilation)       *
index bda81db89f85eede8bf4df8db344f049967626fe..1aa6e8bf4df21e55f579cd557f51a2a0644d2762 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 766 2003-12-13 22:52:32Z twisti $
+   $Id: codegen.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -376,7 +376,7 @@ void catch_ArithmeticException(int sig)
                                                 utf_new_char("<init>"), 
                                                 utf_new_char("(Ljava/lang/String;)V"));
 
-       asm_calljavamethod(m, p, javastring_new_char("/ by zero"), NULL, NULL);
+       asm_calljavafunction(m, p, javastring_new_char("/ by zero"), NULL, NULL);
 
        sigctx->eax = (long) p;                              /* REG_ITMP1_XPTR    */
        sigctx->ecx = sigctx->eip;                           /* REG_ITMP2_XPC     */
index 562bc64bef96ab65cc8667564061f99a12fa9344..a1492721b8858adaf4a30132ae46462a0701119d 100644 (file)
@@ -27,7 +27,7 @@
 
    Authores: Christian Thalinger
 
-   $Id: methodtable.c 764 2003-12-13 22:48:23Z twisti $
+   $Id: methodtable.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -57,16 +57,6 @@ void addmethod(u1 *start, u1 *end)
         mtentry *tmp = GCNEW(mtentry, 1);
 #else
         mtentry *tmp = NEW(mtentry);
-#endif
-               tmp->start = (u1 *) asm_calljavamethod;
-               tmp->end = (u1 *) asm_calljavafunction;    /* little hack, but should work */
-               tmp->next = mtroot;
-               mtroot = tmp;
-
-#if 0
-        tmp = GCNEW(mtentry, 1);
-#else
-        tmp = NEW(mtentry);
 #endif
                tmp->start = (u1 *) asm_calljavafunction;
                tmp->end = (u1 *) asm_calljavafunction2;    /* little hack, but should work */
diff --git a/jni.c b/jni.c
index c7b2194057c16faeb0a6e6d90556c24ee87c21c4..daffb0366ccef1b211540ebcc162ae4f09f2e33e 100644 (file)
--- a/jni.c
+++ b/jni.c
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger
 
-   $Id: jni.c 746 2003-12-13 22:09:31Z twisti $
+   $Id: jni.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -989,7 +989,7 @@ jobject NewObject (JNIEnv* env, jclass clazz, jmethodID methodID, ...)
                args[i]=va_arg(vaargs,void*);
        }
        va_end(vaargs);
-       exceptionptr=asm_calljavamethod(methodID,o,args[0],args[1],args[2]);
+       asm_calljavafunction(methodID,o,args[0],args[1],args[2]);
 
        return o;
 }
@@ -3380,8 +3380,9 @@ jobject *jni_method_invokeNativeHelper(JNIEnv *env,struct methodinfo *methodID,j
                java_objectheader *exceptionToWrap=exceptionptr;
                classinfo *ivtec=loader_load_sysclass(NULL,utf_new_char("java/lang/reflect/InvocationTargetException"));
                java_objectheader* ivte=builtin_new(ivtec);
-               if (asm_calljavamethod(class_resolvemethod(ivtec,utf_new_char("<init>"),utf_new_char("(Ljava/lang/Throwable;)V")),
-                       ivte,exceptionToWrap,0,0)!=NULL) panic("jni.c: error while creating InvocationTargetException wrapper");
+               asm_calljavafunction(class_resolvemethod(ivtec,utf_new_char("<init>"),utf_new_char("(Ljava/lang/Throwable;)V")),
+                       ivte,exceptionToWrap,0,0);
+               if (exceptionptr!=NULL) panic("jni.c: error while creating InvocationTargetException wrapper");
                exceptionptr=ivte;
        }
        return retVal;  
index 0795178b374f0fe92e171ba1c63fef6c230b5d48..0d83a6aa57ceae99b3585031d3553972de88519e 100644 (file)
--- a/loader.c
+++ b/loader.c
@@ -30,7 +30,7 @@
             Mark Probst
                        Edwin Steiner
 
-   $Id: loader.c 758 2003-12-13 22:30:00Z twisti $
+   $Id: loader.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -2436,7 +2436,6 @@ bool class_issubclass(classinfo *sub, classinfo *super)
 void class_init(classinfo *c)
 {
        methodinfo *m;
-       java_objectheader *exceptionptr;
        s4 i;
 #ifdef USE_THREADS
        int b;
@@ -2486,7 +2485,7 @@ void class_init(classinfo *c)
        blockInts = 0;
 #endif
 
-       exceptionptr = asm_calljavamethod(m, NULL, NULL, NULL, NULL);
+       asm_calljavafunction(m, NULL, NULL, NULL, NULL);
 
 #ifdef USE_THREADS
        assert(blockInts == 0);
@@ -2530,7 +2529,7 @@ void class_init(classinfo *c)
                blockInts = 0;
 #endif
 
-               exceptionptr = asm_calljavamethod(m, NULL, NULL, NULL, NULL);
+               asm_calljavafunction(m, NULL, NULL, NULL, NULL);
 
 #ifdef USE_THREADS
                assert(blockInts == 0);
diff --git a/main.c b/main.c
index 29068c888c421edb27d8962d02f2178f8cd31a6f..7354e8f2e542486732e45eb6939aed457bfc0505 100644 (file)
--- a/main.c
+++ b/main.c
@@ -37,7 +37,7 @@
      - Calling the class loader
      - Running the main method
 
-   $Id: main.c 748 2003-12-13 22:13:59Z twisti $
+   $Id: main.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -863,7 +863,6 @@ int main(int argc, char **argv)
        if (startit) {
                methodinfo *mainmethod;
                java_objectarray *a; 
-               java_objectheader *local_exceptionptr = 0;
 
 /*             heap_addreference((void**) &a); */
 
@@ -890,11 +889,11 @@ int main(int argc, char **argv)
                /*class_showmethods(currentThread->group->header.vftbl->class); */
 
                /* here we go... */
-               local_exceptionptr = asm_calljavamethod(mainmethod, a, NULL, NULL, NULL);
+               asm_calljavafunction(mainmethod, a, NULL, NULL, NULL);
        
-               if (local_exceptionptr) {
+               if (exceptionptr) {
                        printf("Exception in thread \"main\" ");
-                       utf_display(local_exceptionptr->vftbl->class->name);
+                       utf_display(exceptionptr->vftbl->class->name);
 
                        /* do we have a detail message? */
                        if (((java_lang_Throwable *) exceptionptr)->detailMessage) {
index b6f1aae665c1997670c304707ab359da32248746..249f6b285ddf5e3a2ee528c5bb73e69087692d04 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Stefan Ring
 
-   $Id: boehm.c 738 2003-12-13 18:41:27Z stefan $
+   $Id: boehm.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -112,7 +112,7 @@ void *heap_alloc_uncollectable(u4 bytelength)
 void runboehmfinalizer(void *o, void *p)
 {
        java_objectheader *ob = (java_objectheader *) o;
-       asm_calljavamethod(ob->vftbl->class->finalizer, ob, NULL, NULL, NULL);
+       asm_calljavafunction(ob->vftbl->class->finalizer, ob, NULL, NULL, NULL);
 }
 
 
index 64deeca00f0661ef38297d6fe62dd1dcda81e036..78587c8deddcae3fa6d5136e26bcbdcab4a4d9e9 100644 (file)
@@ -281,7 +281,7 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_insertSystemProperties (JNIEnv *en
 
             if (proplist[i][1] == NULL) proplist[i][1] = "";
 
-            asm_calljavamethod(m,
+            asm_calljavafunction(m,
                                p,
                                javastring_new_char(proplist[i][0]),
                                javastring_new_char(proplist[i][1]),
index 6381d553ee71af40feb29aba1dcf2d1d7006c99d..41bb717152efe83e3b60b499731590498ef38da3 100644 (file)
--- a/native.c
+++ b/native.c
@@ -31,7 +31,7 @@
    The .hh files created with the header file generator are all
    included here as are the C functions implementing these methods.
 
-   $Id: native.c 755 2003-12-13 22:25:24Z twisti $
+   $Id: native.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -163,7 +163,7 @@ void use_class_as_object(classinfo *c)
                        java_objectheader *vmo = builtin_new(class_java_lang_VMClass);
 
                        if (!vmo) panic("Error while creating instance of java/lang/VMClass");
-                       asm_calljavamethod(method_vmclass_init, vmo, c, NULL, NULL);
+                       asm_calljavafunction(method_vmclass_init, vmo, c, NULL, NULL);
                        c->vmClass = (java_lang_VMClass *) vmo;
                        /*log_text("VMCLASS has been attached");*/
                }
@@ -372,7 +372,7 @@ void systemclassloader_addclass(classinfo *c)
        use_class_as_object (c);
 
        /* call 'addClass' */
-       asm_calljavamethod(m,
+       asm_calljavafunction(m,
                                           (java_objectheader*) SystemClassLoader, 
                                           (java_objectheader*) c,
                                           NULL,  
@@ -427,7 +427,7 @@ void systemclassloader_addlibname(java_objectheader *o)
        id = envTable.GetStaticFieldID(&env,class_java_lang_ClassLoader,"loadedLibraryNames","Ljava/util/Vector;");
        if (!id) panic("can not access ClassLoader");
 
-       asm_calljavamethod(m,
+       asm_calljavafunction(m,
                                           GetStaticObjectField(&env,class_java_lang_ClassLoader,id),
                                           o,
                                           NULL,  
@@ -752,7 +752,7 @@ java_objectheader *native_new_and_init(classinfo *c)
 
        /* call initializer */
 
-       asm_calljavamethod(m, o, NULL, NULL, NULL);
+       asm_calljavafunction(m, o, NULL, NULL, NULL);
 
        return o;
 }
@@ -788,7 +788,7 @@ java_objectheader *native_new_and_init_string(classinfo *c, java_lang_String *s)
 
        /* call initializer */
 
-       asm_calljavamethod(m, o, s, NULL, NULL);
+       asm_calljavafunction(m, o, s, NULL, NULL);
 
        return o;
 }
index 97b40807b9354c3a0ccfcbff2b72beda909f5877..c36fb1bb190cafbbb0ede94a3363fce55e7a3429 100644 (file)
@@ -37,7 +37,7 @@
      - Calling the class loader
      - Running the main method
 
-   $Id: cacao.c 748 2003-12-13 22:13:59Z twisti $
+   $Id: cacao.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -863,7 +863,6 @@ int main(int argc, char **argv)
        if (startit) {
                methodinfo *mainmethod;
                java_objectarray *a; 
-               java_objectheader *local_exceptionptr = 0;
 
 /*             heap_addreference((void**) &a); */
 
@@ -890,11 +889,11 @@ int main(int argc, char **argv)
                /*class_showmethods(currentThread->group->header.vftbl->class); */
 
                /* here we go... */
-               local_exceptionptr = asm_calljavamethod(mainmethod, a, NULL, NULL, NULL);
+               asm_calljavafunction(mainmethod, a, NULL, NULL, NULL);
        
-               if (local_exceptionptr) {
+               if (exceptionptr) {
                        printf("Exception in thread \"main\" ");
-                       utf_display(local_exceptionptr->vftbl->class->name);
+                       utf_display(exceptionptr->vftbl->class->name);
 
                        /* do we have a detail message? */
                        if (((java_lang_Throwable *) exceptionptr)->detailMessage) {
index 2c31d341d20fe7ab5c32e5d284d79d3986435c94..947a4bc875e51bccc94f320ed468f80d6c3326cd 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Mark Probst
             Philipp Tomsich
 
-   $Id: headers.c 745 2003-12-13 22:05:02Z twisti $
+   $Id: headers.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -104,7 +104,7 @@ void literalstring_free(java_objectheader *o) { }
 void stringtable_update() { }
 void synchronize_caches() { }
 void asm_call_jit_compiler() { }
-void asm_calljavamethod() { }
+void asm_calljavafunction() { }
 void asm_dumpregistersandcall() { }
 s4 asm_builtin_checkcast(java_objectheader *obj, classinfo *class) { return 0; }
 
index b6f1aae665c1997670c304707ab359da32248746..249f6b285ddf5e3a2ee528c5bb73e69087692d04 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Stefan Ring
 
-   $Id: boehm.c 738 2003-12-13 18:41:27Z stefan $
+   $Id: boehm.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -112,7 +112,7 @@ void *heap_alloc_uncollectable(u4 bytelength)
 void runboehmfinalizer(void *o, void *p)
 {
        java_objectheader *ob = (java_objectheader *) o;
-       asm_calljavamethod(ob->vftbl->class->finalizer, ob, NULL, NULL, NULL);
+       asm_calljavafunction(ob->vftbl->class->finalizer, ob, NULL, NULL, NULL);
 }
 
 
index c7b2194057c16faeb0a6e6d90556c24ee87c21c4..daffb0366ccef1b211540ebcc162ae4f09f2e33e 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger
 
-   $Id: jni.c 746 2003-12-13 22:09:31Z twisti $
+   $Id: jni.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -989,7 +989,7 @@ jobject NewObject (JNIEnv* env, jclass clazz, jmethodID methodID, ...)
                args[i]=va_arg(vaargs,void*);
        }
        va_end(vaargs);
-       exceptionptr=asm_calljavamethod(methodID,o,args[0],args[1],args[2]);
+       asm_calljavafunction(methodID,o,args[0],args[1],args[2]);
 
        return o;
 }
@@ -3380,8 +3380,9 @@ jobject *jni_method_invokeNativeHelper(JNIEnv *env,struct methodinfo *methodID,j
                java_objectheader *exceptionToWrap=exceptionptr;
                classinfo *ivtec=loader_load_sysclass(NULL,utf_new_char("java/lang/reflect/InvocationTargetException"));
                java_objectheader* ivte=builtin_new(ivtec);
-               if (asm_calljavamethod(class_resolvemethod(ivtec,utf_new_char("<init>"),utf_new_char("(Ljava/lang/Throwable;)V")),
-                       ivte,exceptionToWrap,0,0)!=NULL) panic("jni.c: error while creating InvocationTargetException wrapper");
+               asm_calljavafunction(class_resolvemethod(ivtec,utf_new_char("<init>"),utf_new_char("(Ljava/lang/Throwable;)V")),
+                       ivte,exceptionToWrap,0,0);
+               if (exceptionptr!=NULL) panic("jni.c: error while creating InvocationTargetException wrapper");
                exceptionptr=ivte;
        }
        return retVal;  
index 6381d553ee71af40feb29aba1dcf2d1d7006c99d..41bb717152efe83e3b60b499731590498ef38da3 100644 (file)
@@ -31,7 +31,7 @@
    The .hh files created with the header file generator are all
    included here as are the C functions implementing these methods.
 
-   $Id: native.c 755 2003-12-13 22:25:24Z twisti $
+   $Id: native.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -163,7 +163,7 @@ void use_class_as_object(classinfo *c)
                        java_objectheader *vmo = builtin_new(class_java_lang_VMClass);
 
                        if (!vmo) panic("Error while creating instance of java/lang/VMClass");
-                       asm_calljavamethod(method_vmclass_init, vmo, c, NULL, NULL);
+                       asm_calljavafunction(method_vmclass_init, vmo, c, NULL, NULL);
                        c->vmClass = (java_lang_VMClass *) vmo;
                        /*log_text("VMCLASS has been attached");*/
                }
@@ -372,7 +372,7 @@ void systemclassloader_addclass(classinfo *c)
        use_class_as_object (c);
 
        /* call 'addClass' */
-       asm_calljavamethod(m,
+       asm_calljavafunction(m,
                                           (java_objectheader*) SystemClassLoader, 
                                           (java_objectheader*) c,
                                           NULL,  
@@ -427,7 +427,7 @@ void systemclassloader_addlibname(java_objectheader *o)
        id = envTable.GetStaticFieldID(&env,class_java_lang_ClassLoader,"loadedLibraryNames","Ljava/util/Vector;");
        if (!id) panic("can not access ClassLoader");
 
-       asm_calljavamethod(m,
+       asm_calljavafunction(m,
                                           GetStaticObjectField(&env,class_java_lang_ClassLoader,id),
                                           o,
                                           NULL,  
@@ -752,7 +752,7 @@ java_objectheader *native_new_and_init(classinfo *c)
 
        /* call initializer */
 
-       asm_calljavamethod(m, o, NULL, NULL, NULL);
+       asm_calljavafunction(m, o, NULL, NULL, NULL);
 
        return o;
 }
@@ -788,7 +788,7 @@ java_objectheader *native_new_and_init_string(classinfo *c, java_lang_String *s)
 
        /* call initializer */
 
-       asm_calljavamethod(m, o, s, NULL, NULL);
+       asm_calljavafunction(m, o, s, NULL, NULL);
 
        return o;
 }
index 64deeca00f0661ef38297d6fe62dd1dcda81e036..78587c8deddcae3fa6d5136e26bcbdcab4a4d9e9 100644 (file)
@@ -281,7 +281,7 @@ JNIEXPORT void JNICALL Java_java_lang_Runtime_insertSystemProperties (JNIEnv *en
 
             if (proplist[i][1] == NULL) proplist[i][1] = "";
 
-            asm_calljavamethod(m,
+            asm_calljavafunction(m,
                                p,
                                javastring_new_char(proplist[i][0]),
                                javastring_new_char(proplist[i][1]),
index a0e301fb7e86e17a4d0eadbf1b634de608494cb1..5ea8d5d794ab66a031d99476a7797401b55d0c13 100644 (file)
@@ -302,7 +302,6 @@ static void
 firstStartThread(void)
 {
     methodinfo *method;
-       java_objectheader *local_exceptionptr = NULL;
 
     DBG( printf("firstStartThread %p\n", currentThread); );
 
@@ -320,10 +319,10 @@ firstStartThread(void)
        if (method == 0)
                panic("Cannot find method \'void run ()\'");
 
-       local_exceptionptr = asm_calljavamethod(method, currentThread, NULL, NULL, NULL);
+       asm_calljavafunction(method, currentThread, NULL, NULL, NULL);
 
-    if (local_exceptionptr) {
-        utf_display(local_exceptionptr->vftbl->class->name);
+    if (exceptionptr) {
+        utf_display(exceptionptr->vftbl->class->name);
         printf("\n");
     }
 
index 3a98ba64761c0561b6a10a59e3536860256c6cfe..d0cd0f1d417241883fa59f95ed159b4ac9876cfa 100644 (file)
@@ -29,7 +29,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: asmpart.h 664 2003-11-21 18:24:01Z jowenn $
+   $Id: asmpart.h 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -62,8 +62,6 @@ void asm_call_jit_compiler();
    with up to 4 parameters. This function calls a Java-method (which
    possibly needs compilation) with up to 4 parameters.
 */
-java_objectheader *asm_calljavamethod(methodinfo *m, void *arg1, void *arg2,
-                                      void *arg3, void *arg4);
 
 /* 
    This function calls a Java-method (which possibly needs compilation)
index 610d5835a8f99a250ffac1b2746632d3ad9ee216..8c0cacd8872e3791f9a17ea12785ae2705176d33 100644 (file)
@@ -29,7 +29,7 @@
             Reinhard Grafl
             Christian Thalinger
 
-   $Id: asmpart.S 763 2003-12-13 22:47:44Z twisti $
+   $Id: asmpart.S 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -60,7 +60,6 @@
 /********************* exported functions and variables ***********************/
 
        .globl has_no_x_instr_set
-       .globl asm_calljavamethod
        .globl asm_calljavafunction
        .globl asm_calljavafunction2
        .globl asm_calljavafunction2long
@@ -127,98 +126,6 @@ has_no_x_instr_set:
                ret
 
 
-/********************* function asm_calljavamethod *****************************
-*                                                                              *
-*   This function calls a Java-method (which possibly needs compilation)       *
-*   with up to 4 parameters.                                                   *
-*                                                                              *
-*   This functions calls the JIT-compiler which eventually translates the      *
-*   method into machine code.                                                  *
-*                                                                              *
-*   An possibly throwed exception will be returned to the caller as function   *
-*   return value, so the java method cannot return a fucntion value (this      *
-*   function usually calls 'main' and '<clinit>' which do not return a         *
-*   function value).                                                           *
-*                                                                              *
-*   C-prototype:                                                               *
-*    javaobject_header *asm_calljavamethod (methodinfo *m,                     *
-*         void *arg1, void *arg2, void *arg3, void *arg4);                     *
-*                                                                              *
-*******************************************************************************/
-
-call_name:
-       .ascii  "calljavamethod\0\0"
-
-       .align  8
-       .long   0                         /* catch type all                       */
-       .long   calljava_xhandler         /* handler pc                           */
-       .long   calljava_xhandler         /* end pc                               */
-       .long   asm_calljavamethod        /* start pc                             */
-       .long   1                         /* extable size                         */
-       .long   0                         /* fltsave                              */
-       .long   0                         /* intsave                              */
-       .long   0                         /* isleaf                               */
-       .long   0                         /* IsSync                               */
-       .long   32                        /* frame size                           */
-       .long   0                         /* method pointer (pointer to name)     */
-
-asm_calljavamethod:
-               push    %ebp                  /* allocate stack space                 */
-               mov             %esp, %ebp
-
-        push    %ebx                  /* save registers                       */
-        push    %esi
-        push    %edi
-        
-               sub             $32,%esp              /* pass the remaining parameters        */
-               xor             %edx,%edx
-
-               mov             %edx,28(%esp)         /* convert parms to 8 byte              */
-               mov             24(%ebp),%eax
-               mov             %eax,24(%esp)
-               
-               mov             %edx,20(%esp)
-               mov             20(%ebp),%eax
-               mov             %eax,16(%esp)
-
-               mov             %edx,12(%esp)
-               mov             16(%ebp),%eax
-               mov             %eax,8(%esp)
-
-               mov             %edx,4(%esp)
-               mov             12(%ebp),%eax
-               mov             %eax,(%esp)
-
-               mov             8(%ebp),%eax          /* move function pointer to %eax        */
-
-               lea             asm_call_jit_compiler,%edx
-               call    *%edx                 /* call JIT compiler                    */
-               
-calljava_jit:
-calljava_return:
-calljava_ret:
-        add     $32,%esp
-        pop     %edi                  /* restore registers                    */
-        pop     %esi
-        pop     %ebx
-        
-               xor     %eax,%eax
-               leave                                             /* free stack space                     */
-               ret
-
-calljava_xhandler:
-               push    %eax                              /* pass exception pointer               */
-               call    builtin_throw_exception
-               add     $4,%esp
-        
-               add     $32,%esp
-        pop     %edi
-        pop     %esi
-        pop     %ebx
-        leave
-               ret
-
-
 /********************* function asm_calljavafunction ***************************
 *                                                                              *
 *   This function calls a Java-method (which possibly needs compilation)       *
index bda81db89f85eede8bf4df8db344f049967626fe..1aa6e8bf4df21e55f579cd557f51a2a0644d2762 100644 (file)
@@ -28,7 +28,7 @@
    Authors: Andreas Krall
             Christian Thalinger
 
-   $Id: codegen.c 766 2003-12-13 22:52:32Z twisti $
+   $Id: codegen.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -376,7 +376,7 @@ void catch_ArithmeticException(int sig)
                                                 utf_new_char("<init>"), 
                                                 utf_new_char("(Ljava/lang/String;)V"));
 
-       asm_calljavamethod(m, p, javastring_new_char("/ by zero"), NULL, NULL);
+       asm_calljavafunction(m, p, javastring_new_char("/ by zero"), NULL, NULL);
 
        sigctx->eax = (long) p;                              /* REG_ITMP1_XPTR    */
        sigctx->ecx = sigctx->eip;                           /* REG_ITMP2_XPC     */
index 0795178b374f0fe92e171ba1c63fef6c230b5d48..0d83a6aa57ceae99b3585031d3553972de88519e 100644 (file)
@@ -30,7 +30,7 @@
             Mark Probst
                        Edwin Steiner
 
-   $Id: loader.c 758 2003-12-13 22:30:00Z twisti $
+   $Id: loader.c 771 2003-12-13 23:11:08Z stefan $
 
 */
 
@@ -2436,7 +2436,6 @@ bool class_issubclass(classinfo *sub, classinfo *super)
 void class_init(classinfo *c)
 {
        methodinfo *m;
-       java_objectheader *exceptionptr;
        s4 i;
 #ifdef USE_THREADS
        int b;
@@ -2486,7 +2485,7 @@ void class_init(classinfo *c)
        blockInts = 0;
 #endif
 
-       exceptionptr = asm_calljavamethod(m, NULL, NULL, NULL, NULL);
+       asm_calljavafunction(m, NULL, NULL, NULL, NULL);
 
 #ifdef USE_THREADS
        assert(blockInts == 0);
@@ -2530,7 +2529,7 @@ void class_init(classinfo *c)
                blockInts = 0;
 #endif
 
-               exceptionptr = asm_calljavamethod(m, NULL, NULL, NULL, NULL);
+               asm_calljavafunction(m, NULL, NULL, NULL, NULL);
 
 #ifdef USE_THREADS
                assert(blockInts == 0);
index a0e301fb7e86e17a4d0eadbf1b634de608494cb1..5ea8d5d794ab66a031d99476a7797401b55d0c13 100644 (file)
@@ -302,7 +302,6 @@ static void
 firstStartThread(void)
 {
     methodinfo *method;
-       java_objectheader *local_exceptionptr = NULL;
 
     DBG( printf("firstStartThread %p\n", currentThread); );
 
@@ -320,10 +319,10 @@ firstStartThread(void)
        if (method == 0)
                panic("Cannot find method \'void run ()\'");
 
-       local_exceptionptr = asm_calljavamethod(method, currentThread, NULL, NULL, NULL);
+       asm_calljavafunction(method, currentThread, NULL, NULL, NULL);
 
-    if (local_exceptionptr) {
-        utf_display(local_exceptionptr->vftbl->class->name);
+    if (exceptionptr) {
+        utf_display(exceptionptr->vftbl->class->name);
         printf("\n");
     }