1) disable the is leaf check for i386, where there is no problem
authorjowenn <none@none>
Fri, 17 Dec 2004 23:05:27 +0000 (23:05 +0000)
committerjowenn <none@none>
Fri, 17 Dec 2004 23:05:27 +0000 (23:05 +0000)
2) classes which are used as objects should really be linked
3) fix fill_callblock_objA to handle references and arrays correctly
(1 detected through mauve test suite. This will have to be fixed for the Alpha architecture, where  the ret address for leaf methods is not stored on the stack)
(2+3 prevented jython from starting. Right now a hello world works, but there are other problems I have to hunt down)

src/native/jni.c
src/native/native.c
src/vm/jit/stacktrace.c

index 82d854288cf710d06965a4f2703ef9e9216f53cc..8b1c644b41438e61c92c0f473936502296ff3d85 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Joseph Wenninger, Martin Platter
 
-   $Id: jni.c 1764 2004-12-15 16:21:20Z jowenn $
+   $Id: jni.c 1771 2004-12-17 23:05:27Z jowenn $
 
 */
 
@@ -462,18 +462,17 @@ char fill_callblock_objA(void *obj, utf *descr, jni_callblock blk[], java_object
                case 'L':
                        {
                                char *start = (*utf_ptr) - 1;
-                               char *end = NULL;
+                               /*char *end = NULL;
 
                                while (utf_nextu2(utf_ptr) != ';')
-                                       end = (*utf_ptr) + 1;
+                                       end = (*utf_ptr) + 1;*/
 
-                               if (!builtin_instanceof(params->data[cnts], class_from_descriptor(start, end, 0, CLASSLOAD_LOAD))) {
+                               if (!builtin_instanceof(params->data[cnts], class_from_descriptor(start, desc_end, utf_ptr, CLASSLOAD_LOAD))) {
                                        if (params->data[cnts] != 0) {
                                                *exceptionptr = new_exception("java/lang/IllegalArgumentException");
                                                return 0;
                                        }                       
                                }
-
                                blk[cnt].itemtype = TYPE_ADR;
                                blk[cnt].item = PTR_TO_ITEM(params->data[cnts]);
                                break;                  
@@ -482,8 +481,8 @@ char fill_callblock_objA(void *obj, utf *descr, jni_callblock blk[], java_object
                case '[':
                        {
                                char *start = (*utf_ptr) - 1;
-                               char *end;
-
+                               /*char *end;
+                               
                                char ch;
                                while ((ch = utf_nextu2(utf_ptr)) == '[')
                                        if (ch == 'L') {
@@ -491,13 +490,13 @@ char fill_callblock_objA(void *obj, utf *descr, jni_callblock blk[], java_object
                                        }
 
                                end = (*utf_ptr) - 1;
-                               ch = utf_nextu2(utf_ptr);
+                               ch = utf_nextu2(utf_ptr); */
 
-                               if (!builtin_arrayinstanceof(params->data[cnts], class_from_descriptor(start, end, 0, CLASSLOAD_LOAD)->vftbl)) {
+                               if (!builtin_arrayinstanceof(params->data[cnts], class_from_descriptor(start, desc_end, utf_ptr, CLASSLOAD_LOAD)->vftbl)) {
                                        *exceptionptr = new_exception("java/lang/IllegalArgumentException");
                                        return 0;
                                }
-       
+
                                blk[cnt].itemtype = TYPE_ADR;
                                blk[cnt].item = PTR_TO_ITEM(params->data[cnts]);
                                break;
index bef085e5c5b63665ac1c32d2fdb135dd225c26c9..a5509fef193fa7831cdce7e03e3b4afd822dd145 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 1764 2004-12-15 16:21:20Z jowenn $
+   $Id: native.c 1771 2004-12-17 23:05:27Z jowenn $
 
 */
 
@@ -121,6 +121,15 @@ java_objectheader* _exceptionptr = NULL;
 void use_class_as_object(classinfo *c) 
 {
        if (!c->classvftbl) {
+               /* is the class loaded */
+               if (!c->loaded)
+                       if (!class_load(c))
+                               panic("Class could not be loaded in use_class_as_object");
+               /* is the class linked */
+               if (!c->linked)
+                       if (!class_link(c))
+                               panic("Class could not be linked in use_class_as_object");
+
                /*if (class_java_lang_Class ==0) panic("java/lang/Class not loaded in use_class_as_object");
                if (class_java_lang_Class->vftbl ==0) panic ("vftbl == 0 in use_class_as_object");*/
                c->header.vftbl = class_java_lang_Class->vftbl;
index 30ec461767ba008c9534e0577286a15b7a5223ec..725045868256c7a44eafe1e48ee8cfaf6fdd2d1b 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Joseph Wenninger
 
-   $Id: stacktrace.c 1735 2004-12-07 14:33:27Z twisti $
+   $Id: stacktrace.c 1771 2004-12-17 23:05:27Z jowenn $
 
 */
 
@@ -239,12 +239,14 @@ void  cacao_stacktrace_fillInStackTrace(void **target,CacaoStackTraceCollector c
                                } else { /*method created by jit*/
                                        u4 frameSize;
                                        /*log_text("JIT");*/
+#if defined (__ALPHA__)
                                        if (currentMethod->isleafmethod) {
 #ifdef JWDEBUG
                                                printf("class.method:%s.%s\n",currentMethod->class->name->text,currentMethod->name->text);
 #endif
                                                panic("How could that happen ??? A leaf method in the middle of a stacktrace ??");
                                        }
+#endif
                                        /*utf_display(currentMethod->class->name);
                                        utf_display(currentMethod->name);*/
                                        fillInStackTrace_method(&buffer,currentMethod,dataseg,returnAdress);