* src/vm/jit/parse.c, src/vm/jit/parse.h (Changes): Merged with
[cacao.git] / src / vm / linker.c
index f354f9b45e2dda7768f69943645a66be072154b7..a57849d8f78443dc8eaa36356798397fa6d8d013 100644 (file)
@@ -32,7 +32,7 @@
             Edwin Steiner
             Christian Thalinger
 
-   $Id: linker.c 5785 2006-10-15 22:25:54Z edwin $
+   $Id: linker.c 5868 2006-10-30 11:21:36Z edwin $
 
 */
 
@@ -445,7 +445,7 @@ static classinfo *link_class_intern(classinfo *c)
        s4 vftbllength;               /* vftbllength of current class             */
        s4 interfacetablelength;      /* interface table length                   */
        vftbl_t *v;                   /* vftbl of current class                   */
-       s4 i,j;                       /* interface/method/field counter           */
+       s4 i;                         /* interface/method/field counter           */
        arraydescriptor *arraydesc;   /* descriptor for array classes             */
 #if defined(ENABLE_RT_TIMING)
        struct timespec time_start, time_resolving, time_compute_vftbl,
@@ -798,8 +798,18 @@ static classinfo *link_class_intern(classinfo *c)
           stub (all after the super class slots, because they are already
           initialized). */
 
-       for (; i < vftbllength; i++)
-               v->table[i] = (methodptr) (ptrint) &asm_abstractmethoderror;
+       for (; i < vftbllength; i++) {
+#if defined(ENABLE_JIT)
+# if defined(ENABLE_INTRP)
+               if (opt_intrp)
+                       v->table[i] = (methodptr) (ptrint) &intrp_asm_abstractmethoderror;
+               else
+# endif
+                       v->table[i] = (methodptr) (ptrint) &asm_abstractmethoderror;
+#else
+               v->table[i] = (methodptr) (ptrint) &intrp_asm_abstractmethoderror;
+#endif
+       }
 
        /* add method stubs into virtual function table */
 
@@ -852,9 +862,9 @@ static classinfo *link_class_intern(classinfo *c)
                        /* header structs like java_lang_Double must match the offsets */
                        /* of the Java fields (eg. java.lang.Double.value).            */
 #if defined(__I386__)
-                       c->instancesize = ALIGN(c->instancesize, 4);
+                       c->instancesize = MEMORY_ALIGN(c->instancesize, 4);
 #else
-                       c->instancesize = ALIGN(c->instancesize, dsize);
+                       c->instancesize = MEMORY_ALIGN(c->instancesize, dsize);
 #endif
 
                        f->offset = c->instancesize;
@@ -1218,8 +1228,19 @@ static bool linker_addinterface(classinfo *c, classinfo *ic)
                        /* If no method was found, insert the AbstractMethodError
                           stub. */
 
+#if defined(ENABLE_JIT)
+# if defined(ENABLE_INTRP)
+                       if (opt_intrp)
+                               v->interfacetable[-i][j] =
+                                       (methodptr) (ptrint) &intrp_asm_abstractmethoderror;
+                       else
+# endif
+                               v->interfacetable[-i][j] =
+                                       (methodptr) (ptrint) &asm_abstractmethoderror;
+#else
                        v->interfacetable[-i][j] =
-                               (methodptr) (ptrint) &asm_abstractmethoderror;
+                               (methodptr) (ptrint) &intrp_asm_abstractmethoderror;
+#endif
 
                foundmethod:
                        ;