cleanup
authoredwin <none@none>
Mon, 19 Jan 2004 12:24:13 +0000 (12:24 +0000)
committeredwin <none@none>
Mon, 19 Jan 2004 12:24:13 +0000 (12:24 +0000)
builtin.c
builtin.h
loader.c
src/vm/builtin.c
src/vm/builtin.h
src/vm/loader.c

index 6d3ee98bbf2cb2dfc99a8205b485e13fd2ca1000..bf2511e041d9ae1cbd824c048e974f80a5774dc0 100644 (file)
--- a/builtin.c
+++ b/builtin.c
@@ -34,7 +34,7 @@
    calls instead of machine instructions, using the C calling
    convention.
 
-   $Id: builtin.c 868 2004-01-10 20:12:10Z edwin $
+   $Id: builtin.c 890 2004-01-19 12:24:13Z edwin $
 
 */
 
 
 #undef DEBUG /*define DEBUG 1*/
 
-/* XXX delete? */
-#if 0
-builtin_descriptor builtin_desc[] = {
-       {(functionptr) builtin_instanceof,                 "instanceof"},
-       {(functionptr) builtin_checkcast,                  "checkcast"},
-       {(functionptr) asm_builtin_checkcast,      "checkcast"},
-       {(functionptr) builtin_arrayinstanceof,    "arrayinstanceof"},
-#if defined(__I386__)
-       {(functionptr) asm_builtin_arrayinstanceof,"arrayinstanceof"},
-#endif
-       {(functionptr) builtin_checkarraycast,     "checkarraycast"},
-       {(functionptr) asm_builtin_checkarraycast, "checkarraycast"},
-       {(functionptr) asm_builtin_aastore,                "aastore"},
-       {(functionptr) builtin_new,                                "new"},
-       {(functionptr) builtin_newarray,       "newarray"},
-       {(functionptr) builtin_anewarray,          "anewarray"},
-#if defined(__I386__)
-       /*
-        * have 2 parameters (needs stack manipulation)
-        */
-       {(functionptr) asm_builtin_newarray,       "newarray"},
-#endif
-       {(functionptr) builtin_newarray_boolean,   "newarray_boolean"},
-       {(functionptr) builtin_newarray_char,      "newarray_char"},
-       {(functionptr) builtin_newarray_float,     "newarray_float"},
-       {(functionptr) builtin_newarray_double,    "newarray_double"},
-       {(functionptr) builtin_newarray_byte,      "newarray_byte"},
-       {(functionptr) builtin_newarray_short,     "newarray_short"},
-       {(functionptr) builtin_newarray_int,       "newarray_int"},
-       {(functionptr) builtin_newarray_long,      "newarray_long"},
-       {(functionptr) builtin_displaymethodstart, "displaymethodstart"},
-       {(functionptr) builtin_displaymethodstop,  "displaymethodstop"},
-       {(functionptr) builtin_monitorenter,       "monitorenter"},
-       {(functionptr) asm_builtin_monitorenter,   "monitorenter"},
-       {(functionptr) builtin_monitorexit,                "monitorexit"},
-       {(functionptr) asm_builtin_monitorexit,    "monitorexit"},
-#if !SUPPORT_DIVISION
-       {(functionptr) builtin_idiv,                       "idiv"},
-       {(functionptr) asm_builtin_idiv,                   "idiv"},
-       {(functionptr) builtin_irem,                       "irem"},
-       {(functionptr) asm_builtin_irem,                   "irem"},
-#endif
-       {(functionptr) builtin_ladd,                       "ladd"},
-       {(functionptr) builtin_lsub,                       "lsub"},
-       {(functionptr) builtin_lmul,                       "lmul"},
-#if !(SUPPORT_DIVISION && SUPPORT_LONG && SUPPORT_LONG_DIV)
-       {(functionptr) builtin_ldiv,                       "ldiv"},
-       {(functionptr) asm_builtin_ldiv,                   "ldiv"},
-       {(functionptr) builtin_lrem,                       "lrem"},
-       {(functionptr) asm_builtin_lrem,                   "lrem"},
-#endif
-       {(functionptr) builtin_lshl,                       "lshl"},
-       {(functionptr) builtin_lshr,                       "lshr"},
-       {(functionptr) builtin_lushr,                      "lushr"},
-       {(functionptr) builtin_land,                       "land"},
-       {(functionptr) builtin_lor,                                "lor"},
-       {(functionptr) builtin_lxor,                       "lxor"},
-       {(functionptr) builtin_lneg,                       "lneg"},
-       {(functionptr) builtin_lcmp,                       "lcmp"},
-       {(functionptr) builtin_fadd,                       "fadd"},
-       {(functionptr) builtin_fsub,                       "fsub"},
-       {(functionptr) builtin_fmul,                       "fmul"},
-       {(functionptr) builtin_fdiv,                       "fdiv"},
-       {(functionptr) builtin_frem,                       "frem"},
-       {(functionptr) builtin_fneg,                       "fneg"},
-       {(functionptr) builtin_fcmpl,                      "fcmpl"},
-       {(functionptr) builtin_fcmpg,                      "fcmpg"},
-       {(functionptr) builtin_dadd,                       "dadd"},
-       {(functionptr) builtin_dsub,                       "dsub"},
-       {(functionptr) builtin_dmul,                       "dmul"},
-       {(functionptr) builtin_ddiv,                       "ddiv"},
-       {(functionptr) builtin_drem,                       "drem"},
-       {(functionptr) builtin_dneg,                       "dneg"},
-       {(functionptr) builtin_dcmpl,                      "dcmpl"},
-       {(functionptr) builtin_dcmpg,                      "dcmpg"},
-       {(functionptr) builtin_i2l,                                "i2l"},
-       {(functionptr) builtin_i2f,                                "i2f"},
-       {(functionptr) builtin_i2d,                                "i2d"},
-       {(functionptr) builtin_l2i,                                "l2i"},
-       {(functionptr) builtin_l2f,                                "l2f"},
-       {(functionptr) builtin_l2d,                                "l2d"},
-       {(functionptr) builtin_f2i,                                "f2i"},
-       {(functionptr) builtin_f2l,                                "f2l"},
-       {(functionptr) builtin_f2d,                                "f2d"},
-       {(functionptr) builtin_d2i,                                "d2i"},
-       {(functionptr) builtin_d2l,                                "d2l"},
-#if defined(__I386__)
-       {(functionptr) asm_builtin_f2i,                    "f2i"},
-       {(functionptr) asm_builtin_f2l,                    "f2l"},
-       {(functionptr) asm_builtin_d2i,                    "d2i"},
-       {(functionptr) asm_builtin_d2l,                    "d2l"},
-#endif
-       {(functionptr) builtin_d2f,                                "d2f"},
-       {(functionptr) NULL,                                       "unknown"}
-};
-#endif
-
 
 /*****************************************************************************
                                                                TYPE CHECKS
@@ -223,7 +126,6 @@ s4 builtin_isanysubclass(classinfo *sub, classinfo *super)
        return res;
 }
 
-/* XXX inline this? */
 s4 builtin_isanysubclass_vftbl(vftbl *sub,vftbl *super)
 {
        int base;
@@ -310,7 +212,6 @@ s4 builtin_checkcast(java_objectheader *obj, classinfo *class)
                        
 ******************************************************************************/
 
-/* XXX inline this? */
 static s4 builtin_descriptorscompatible(arraydescriptor *desc,arraydescriptor *target)
 {
        if (desc==target) return 1;
@@ -525,7 +426,6 @@ s4 builtin_canstore_onedim (java_objectarray *a, java_objectheader *o)
 
 /* This is an optimized version where a is guaranteed to be a
  * one-dimensional array of a class type */
-/* XXX this could be inlined by the code generator */
 s4 builtin_canstore_onedim_class(java_objectarray *a, java_objectheader *o)
 {
        vftbl *elementvftbl;
@@ -821,8 +721,10 @@ java_arrayheader *builtin_nmultianewarray (int n, vftbl *arrayvftbl, long *dims)
 
        /* get the vftbl of the components to create */
        componentvftbl = arrayvftbl->arraydesc->componentvftbl;
-       if (!componentvftbl) /* XXX the verifier could check this */
-               panic ("multianewarray with too many dimensions");
+
+       /* The verifier guarantees this. */
+       /* if (!componentvftbl) */
+       /*      panic ("multianewarray with too many dimensions"); */
 
        /* create the component arrays */
        for (i = 0; i < size; i++) {
index d3db09a53befeb35fc9bfb9ec3a8b296b702e27b..78e9b3a7883a4cde420d567980a992b46c16fd71 100644 (file)
--- a/builtin.h
+++ b/builtin.h
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: builtin.h 879 2004-01-12 13:31:56Z twisti $
+   $Id: builtin.h 890 2004-01-19 12:24:13Z edwin $
 
 */
 
  * must be an entry in the builtin_desc table in jit/jit.c.
  */
  
-/* XXX delete */
-#if 0
-typedef struct builtin_descriptor {
-       functionptr bptr;
-       char        *name;
-       } builtin_descriptor;
-#endif
-
 typedef struct builtin_descriptor builtin_descriptor;
 
 /* There is a builtin_descriptor in builtin_desc for every builtin
@@ -232,12 +224,12 @@ void builtin_trace_args(s8 a0, s8 a1, s8 a2, s8 a3, s8 a4, s8 a5, s8 a6, s8 a7,
 /* NOT AN OP */
 #endif
 #endif
-void builtin_displaymethodstart(methodinfo *method); /* XXX? */
+void builtin_displaymethodstart(methodinfo *method);
 /* NOT AN OP */
 void builtin_displaymethodstop(methodinfo *method, s8 l, double d, float f);
 /* NOT AN OP */
-/* void builtin_displaymethodstop(methodinfo *method); */ /* XXX? */
-void builtin_displaymethodexception(methodinfo *method); /* XXX? */
+/* void builtin_displaymethodstop(methodinfo *method); */
+void builtin_displaymethodexception(methodinfo *method);
 /* NOT AN OP */
 
 void builtin_monitorenter(java_objectheader *o);
@@ -289,36 +281,36 @@ s8 builtin_lneg(s8 a);
 s4 builtin_lcmp(s8 a, s8 b);
 #define BUILTIN_lcmp (functionptr) builtin_lcmp
 
-float builtin_fadd(float a, float b); /* XXX? */
+float builtin_fadd(float a, float b);
 /* NOT AN OP */
-float builtin_fsub(float a, float b); /* XXX? */
+float builtin_fsub(float a, float b);
 /* NOT AN OP */
-float builtin_fmul(float a, float b); /* XXX? */
+float builtin_fmul(float a, float b);
 /* NOT AN OP */
-float builtin_fdiv(float a, float b); /* XXX? */
+float builtin_fdiv(float a, float b);
 /* NOT AN OP */
-float builtin_fneg(float a);          /* XXX? */
+float builtin_fneg(float a);         
 /* NOT AN OP */
-s4 builtin_fcmpl(float a, float b);   /* XXX? */
+s4 builtin_fcmpl(float a, float b);  
 /* NOT AN OP */
-s4 builtin_fcmpg(float a, float b);   /* XXX? */
+s4 builtin_fcmpg(float a, float b);  
 /* NOT AN OP */
 float builtin_frem(float a, float b);
 #define BUILTIN_frem (functionptr) builtin_frem
 
-double builtin_dadd(double a, double b); /* XXX? */
+double builtin_dadd(double a, double b);
 /* NOT AN OP */
-double builtin_dsub(double a, double b); /* XXX? */
+double builtin_dsub(double a, double b);
 /* NOT AN OP */
-double builtin_dmul(double a, double b); /* XXX? */
+double builtin_dmul(double a, double b);
 /* NOT AN OP */
-double builtin_ddiv(double a, double b); /* XXX? */
+double builtin_ddiv(double a, double b);
 /* NOT AN OP */
-double builtin_dneg(double a);           /* XXX? */ 
+double builtin_dneg(double a);          
 /* NOT AN OP */
-s4 builtin_dcmpl(double a, double b);    /* XXX? */
+s4 builtin_dcmpl(double a, double b);   
 /* NOT AN OP */
-s4 builtin_dcmpg(double a, double b);    /* XXX? */
+s4 builtin_dcmpg(double a, double b);   
 /* NOT AN OP */
 double builtin_drem(double a, double b);
 #define BUILTIN_drem (functionptr) builtin_drem
@@ -345,7 +337,7 @@ s8       builtin_f2l(float a);
 s8       asm_builtin_f2l(float a);
 /* NOT AN OP */
 
-double   builtin_f2d(float a);     /* XXX? */
+double   builtin_f2d(float a);
 /* NOT AN OP */
 
 s4       builtin_d2i(double a);
@@ -357,7 +349,7 @@ s8       builtin_d2l(double a);
 s8       asm_builtin_d2l(double a);
 /* NOT AN OP */
 
-float    builtin_d2f(double a);    /* XXX? */
+float    builtin_d2f(double a);
 /* NOT AN OP */
 
 java_arrayheader *builtin_clone_array(void *env, java_arrayheader *o);
index a73597d58afc442f97a396b020caf735be57d53d..e8d8bd58d3e424205c3ca445e425be4484203552 100644 (file)
--- a/loader.c
+++ b/loader.c
@@ -30,7 +30,7 @@
             Mark Probst
                        Edwin Steiner
 
-   $Id: loader.c 881 2004-01-13 19:57:08Z edwin $
+   $Id: loader.c 890 2004-01-19 12:24:13Z edwin $
 
 */
 
@@ -763,7 +763,7 @@ static int checkmethoddescriptor (utf *d)
 
     /* check arguments */
     while (utf_ptr != end_pos && *utf_ptr != ')') {
-               /* XXX we cannot count the this argument here because
+               /* We cannot count the this argument here because
                 * we don't know if the method is static. */
                if (*utf_ptr == 'J' || *utf_ptr == 'D')
                        argcount+=2;
@@ -790,7 +790,6 @@ static int checkmethoddescriptor (utf *d)
 
        /* XXX use the following if -noverify */
 #if 0
-       /* XXX check length */
        /* check arguments */
        while ((c = *utf_ptr++) != ')') {
                start = utf_ptr-1;
@@ -1070,7 +1069,6 @@ static void method_load(methodinfo *m, classinfo *c)
                        panic("Method has more than 255 arguments");
 
                /* check flag consistency */
-               /* XXX could check if <clinit> is STATIC */
                if (m->name != utf_clinit) {
                        i = (m->flags & (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED));
                        if (i != 0 && i != ACC_PUBLIC && i != ACC_PRIVATE && i != ACC_PROTECTED)
@@ -1706,7 +1704,7 @@ static int class_load(classinfo *c)
        /* check ACC flags consistency */
        if ((c->flags & ACC_INTERFACE) != 0) {
                if ((c->flags & ACC_ABSTRACT) == 0) {
-                       /* XXX We work around this because interfaces in JDK 1.1 are
+                       /* We work around this because interfaces in JDK 1.1 are
                         * not declared abstract. */
 
                        c->flags |= ACC_ABSTRACT;
@@ -1974,7 +1972,7 @@ void class_new_array(classinfo *c)
        methodinfo *clone;
        int namelen;
 
-       /* XXX remove */ /* dolog("class_new_array: %s",c->name->text); */
+       /* DEBUG */ /* dolog("class_new_array: %s",c->name->text); */
 
        /* Array classes are not loaded from classfiles. */
        list_remove(&unloadedclasses, c);
@@ -2004,21 +2002,21 @@ void class_new_array(classinfo *c)
        c->flags = ACC_PUBLIC | ACC_FINAL | ACC_ABSTRACT;
 
     c->interfacescount = 2;
-    c->interfaces = MNEW(classinfo*,2); /* XXX use GC? */
+    c->interfaces = MNEW(classinfo*,2);
     c->interfaces[0] = class_java_lang_Cloneable;
     c->interfaces[1] = class_java_io_Serializable;
 
        c->methodscount = 1;
-       c->methods = MNEW (methodinfo, c->methodscount); /* XXX use GC? */
+       c->methods = MNEW (methodinfo, c->methodscount);
 
        clone = c->methods;
        memset(clone, 0, sizeof(methodinfo));
-       clone->flags = ACC_PUBLIC; /* XXX protected? */
+       clone->flags = ACC_PUBLIC;
        clone->name = utf_new_char("clone");
        clone->descriptor = utf_new_char("()Ljava/lang/Object;");
        clone->class = c;
        clone->stubroutine = createnativestub((functionptr) &builtin_clone_array, clone);
-       clone->monoPoly = MONO; /* XXX should be poly? */
+       clone->monoPoly = MONO;
 
        /* XXX: field: length? */
 
@@ -3223,7 +3221,7 @@ classinfo *loader_load(utf *topname)
        if (linkverbose)
                dolog("Linking...");
 
-       /* XXX added a hack to break infinite linking loops. A better
+       /* Added a hack to break infinite linking loops. A better
         * linking algorithm would be nice. -Edwin */
        notlinkable = NULL;
        while ((c = list_first(&unlinkedclasses))) {
@@ -3285,7 +3283,7 @@ classinfo *loader_load(utf *topname)
        pthread_mutex_unlock(&compiler_mutex);
 #endif
 
-       /* XXX DEBUG */ if (linkverbose && !top) dolog("returning NULL from loader_load");
+       /* DEBUG */ /*if (linkverbose && !top) dolog("returning NULL from loader_load");*/
        
        return top; 
 }
@@ -3471,7 +3469,7 @@ classinfo *class_from_descriptor(char *utf_ptr, char *end_ptr,
                          if (mode & CLASSLOAD_SKIP) return class_java_lang_Object;
                          name = utf_new(start,utf_ptr-start);
                          return (mode & CLASSLOAD_LOAD)
-                                 ? loader_load(name) : class_new(name); /* XXX */
+                                 ? loader_load(name) : class_new(name); /* XXX handle errors */
                }
        }
 
index 6d3ee98bbf2cb2dfc99a8205b485e13fd2ca1000..bf2511e041d9ae1cbd824c048e974f80a5774dc0 100644 (file)
@@ -34,7 +34,7 @@
    calls instead of machine instructions, using the C calling
    convention.
 
-   $Id: builtin.c 868 2004-01-10 20:12:10Z edwin $
+   $Id: builtin.c 890 2004-01-19 12:24:13Z edwin $
 
 */
 
 
 #undef DEBUG /*define DEBUG 1*/
 
-/* XXX delete? */
-#if 0
-builtin_descriptor builtin_desc[] = {
-       {(functionptr) builtin_instanceof,                 "instanceof"},
-       {(functionptr) builtin_checkcast,                  "checkcast"},
-       {(functionptr) asm_builtin_checkcast,      "checkcast"},
-       {(functionptr) builtin_arrayinstanceof,    "arrayinstanceof"},
-#if defined(__I386__)
-       {(functionptr) asm_builtin_arrayinstanceof,"arrayinstanceof"},
-#endif
-       {(functionptr) builtin_checkarraycast,     "checkarraycast"},
-       {(functionptr) asm_builtin_checkarraycast, "checkarraycast"},
-       {(functionptr) asm_builtin_aastore,                "aastore"},
-       {(functionptr) builtin_new,                                "new"},
-       {(functionptr) builtin_newarray,       "newarray"},
-       {(functionptr) builtin_anewarray,          "anewarray"},
-#if defined(__I386__)
-       /*
-        * have 2 parameters (needs stack manipulation)
-        */
-       {(functionptr) asm_builtin_newarray,       "newarray"},
-#endif
-       {(functionptr) builtin_newarray_boolean,   "newarray_boolean"},
-       {(functionptr) builtin_newarray_char,      "newarray_char"},
-       {(functionptr) builtin_newarray_float,     "newarray_float"},
-       {(functionptr) builtin_newarray_double,    "newarray_double"},
-       {(functionptr) builtin_newarray_byte,      "newarray_byte"},
-       {(functionptr) builtin_newarray_short,     "newarray_short"},
-       {(functionptr) builtin_newarray_int,       "newarray_int"},
-       {(functionptr) builtin_newarray_long,      "newarray_long"},
-       {(functionptr) builtin_displaymethodstart, "displaymethodstart"},
-       {(functionptr) builtin_displaymethodstop,  "displaymethodstop"},
-       {(functionptr) builtin_monitorenter,       "monitorenter"},
-       {(functionptr) asm_builtin_monitorenter,   "monitorenter"},
-       {(functionptr) builtin_monitorexit,                "monitorexit"},
-       {(functionptr) asm_builtin_monitorexit,    "monitorexit"},
-#if !SUPPORT_DIVISION
-       {(functionptr) builtin_idiv,                       "idiv"},
-       {(functionptr) asm_builtin_idiv,                   "idiv"},
-       {(functionptr) builtin_irem,                       "irem"},
-       {(functionptr) asm_builtin_irem,                   "irem"},
-#endif
-       {(functionptr) builtin_ladd,                       "ladd"},
-       {(functionptr) builtin_lsub,                       "lsub"},
-       {(functionptr) builtin_lmul,                       "lmul"},
-#if !(SUPPORT_DIVISION && SUPPORT_LONG && SUPPORT_LONG_DIV)
-       {(functionptr) builtin_ldiv,                       "ldiv"},
-       {(functionptr) asm_builtin_ldiv,                   "ldiv"},
-       {(functionptr) builtin_lrem,                       "lrem"},
-       {(functionptr) asm_builtin_lrem,                   "lrem"},
-#endif
-       {(functionptr) builtin_lshl,                       "lshl"},
-       {(functionptr) builtin_lshr,                       "lshr"},
-       {(functionptr) builtin_lushr,                      "lushr"},
-       {(functionptr) builtin_land,                       "land"},
-       {(functionptr) builtin_lor,                                "lor"},
-       {(functionptr) builtin_lxor,                       "lxor"},
-       {(functionptr) builtin_lneg,                       "lneg"},
-       {(functionptr) builtin_lcmp,                       "lcmp"},
-       {(functionptr) builtin_fadd,                       "fadd"},
-       {(functionptr) builtin_fsub,                       "fsub"},
-       {(functionptr) builtin_fmul,                       "fmul"},
-       {(functionptr) builtin_fdiv,                       "fdiv"},
-       {(functionptr) builtin_frem,                       "frem"},
-       {(functionptr) builtin_fneg,                       "fneg"},
-       {(functionptr) builtin_fcmpl,                      "fcmpl"},
-       {(functionptr) builtin_fcmpg,                      "fcmpg"},
-       {(functionptr) builtin_dadd,                       "dadd"},
-       {(functionptr) builtin_dsub,                       "dsub"},
-       {(functionptr) builtin_dmul,                       "dmul"},
-       {(functionptr) builtin_ddiv,                       "ddiv"},
-       {(functionptr) builtin_drem,                       "drem"},
-       {(functionptr) builtin_dneg,                       "dneg"},
-       {(functionptr) builtin_dcmpl,                      "dcmpl"},
-       {(functionptr) builtin_dcmpg,                      "dcmpg"},
-       {(functionptr) builtin_i2l,                                "i2l"},
-       {(functionptr) builtin_i2f,                                "i2f"},
-       {(functionptr) builtin_i2d,                                "i2d"},
-       {(functionptr) builtin_l2i,                                "l2i"},
-       {(functionptr) builtin_l2f,                                "l2f"},
-       {(functionptr) builtin_l2d,                                "l2d"},
-       {(functionptr) builtin_f2i,                                "f2i"},
-       {(functionptr) builtin_f2l,                                "f2l"},
-       {(functionptr) builtin_f2d,                                "f2d"},
-       {(functionptr) builtin_d2i,                                "d2i"},
-       {(functionptr) builtin_d2l,                                "d2l"},
-#if defined(__I386__)
-       {(functionptr) asm_builtin_f2i,                    "f2i"},
-       {(functionptr) asm_builtin_f2l,                    "f2l"},
-       {(functionptr) asm_builtin_d2i,                    "d2i"},
-       {(functionptr) asm_builtin_d2l,                    "d2l"},
-#endif
-       {(functionptr) builtin_d2f,                                "d2f"},
-       {(functionptr) NULL,                                       "unknown"}
-};
-#endif
-
 
 /*****************************************************************************
                                                                TYPE CHECKS
@@ -223,7 +126,6 @@ s4 builtin_isanysubclass(classinfo *sub, classinfo *super)
        return res;
 }
 
-/* XXX inline this? */
 s4 builtin_isanysubclass_vftbl(vftbl *sub,vftbl *super)
 {
        int base;
@@ -310,7 +212,6 @@ s4 builtin_checkcast(java_objectheader *obj, classinfo *class)
                        
 ******************************************************************************/
 
-/* XXX inline this? */
 static s4 builtin_descriptorscompatible(arraydescriptor *desc,arraydescriptor *target)
 {
        if (desc==target) return 1;
@@ -525,7 +426,6 @@ s4 builtin_canstore_onedim (java_objectarray *a, java_objectheader *o)
 
 /* This is an optimized version where a is guaranteed to be a
  * one-dimensional array of a class type */
-/* XXX this could be inlined by the code generator */
 s4 builtin_canstore_onedim_class(java_objectarray *a, java_objectheader *o)
 {
        vftbl *elementvftbl;
@@ -821,8 +721,10 @@ java_arrayheader *builtin_nmultianewarray (int n, vftbl *arrayvftbl, long *dims)
 
        /* get the vftbl of the components to create */
        componentvftbl = arrayvftbl->arraydesc->componentvftbl;
-       if (!componentvftbl) /* XXX the verifier could check this */
-               panic ("multianewarray with too many dimensions");
+
+       /* The verifier guarantees this. */
+       /* if (!componentvftbl) */
+       /*      panic ("multianewarray with too many dimensions"); */
 
        /* create the component arrays */
        for (i = 0; i < size; i++) {
index d3db09a53befeb35fc9bfb9ec3a8b296b702e27b..78e9b3a7883a4cde420d567980a992b46c16fd71 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Edwin Steiner
 
-   $Id: builtin.h 879 2004-01-12 13:31:56Z twisti $
+   $Id: builtin.h 890 2004-01-19 12:24:13Z edwin $
 
 */
 
  * must be an entry in the builtin_desc table in jit/jit.c.
  */
  
-/* XXX delete */
-#if 0
-typedef struct builtin_descriptor {
-       functionptr bptr;
-       char        *name;
-       } builtin_descriptor;
-#endif
-
 typedef struct builtin_descriptor builtin_descriptor;
 
 /* There is a builtin_descriptor in builtin_desc for every builtin
@@ -232,12 +224,12 @@ void builtin_trace_args(s8 a0, s8 a1, s8 a2, s8 a3, s8 a4, s8 a5, s8 a6, s8 a7,
 /* NOT AN OP */
 #endif
 #endif
-void builtin_displaymethodstart(methodinfo *method); /* XXX? */
+void builtin_displaymethodstart(methodinfo *method);
 /* NOT AN OP */
 void builtin_displaymethodstop(methodinfo *method, s8 l, double d, float f);
 /* NOT AN OP */
-/* void builtin_displaymethodstop(methodinfo *method); */ /* XXX? */
-void builtin_displaymethodexception(methodinfo *method); /* XXX? */
+/* void builtin_displaymethodstop(methodinfo *method); */
+void builtin_displaymethodexception(methodinfo *method);
 /* NOT AN OP */
 
 void builtin_monitorenter(java_objectheader *o);
@@ -289,36 +281,36 @@ s8 builtin_lneg(s8 a);
 s4 builtin_lcmp(s8 a, s8 b);
 #define BUILTIN_lcmp (functionptr) builtin_lcmp
 
-float builtin_fadd(float a, float b); /* XXX? */
+float builtin_fadd(float a, float b);
 /* NOT AN OP */
-float builtin_fsub(float a, float b); /* XXX? */
+float builtin_fsub(float a, float b);
 /* NOT AN OP */
-float builtin_fmul(float a, float b); /* XXX? */
+float builtin_fmul(float a, float b);
 /* NOT AN OP */
-float builtin_fdiv(float a, float b); /* XXX? */
+float builtin_fdiv(float a, float b);
 /* NOT AN OP */
-float builtin_fneg(float a);          /* XXX? */
+float builtin_fneg(float a);         
 /* NOT AN OP */
-s4 builtin_fcmpl(float a, float b);   /* XXX? */
+s4 builtin_fcmpl(float a, float b);  
 /* NOT AN OP */
-s4 builtin_fcmpg(float a, float b);   /* XXX? */
+s4 builtin_fcmpg(float a, float b);  
 /* NOT AN OP */
 float builtin_frem(float a, float b);
 #define BUILTIN_frem (functionptr) builtin_frem
 
-double builtin_dadd(double a, double b); /* XXX? */
+double builtin_dadd(double a, double b);
 /* NOT AN OP */
-double builtin_dsub(double a, double b); /* XXX? */
+double builtin_dsub(double a, double b);
 /* NOT AN OP */
-double builtin_dmul(double a, double b); /* XXX? */
+double builtin_dmul(double a, double b);
 /* NOT AN OP */
-double builtin_ddiv(double a, double b); /* XXX? */
+double builtin_ddiv(double a, double b);
 /* NOT AN OP */
-double builtin_dneg(double a);           /* XXX? */ 
+double builtin_dneg(double a);          
 /* NOT AN OP */
-s4 builtin_dcmpl(double a, double b);    /* XXX? */
+s4 builtin_dcmpl(double a, double b);   
 /* NOT AN OP */
-s4 builtin_dcmpg(double a, double b);    /* XXX? */
+s4 builtin_dcmpg(double a, double b);   
 /* NOT AN OP */
 double builtin_drem(double a, double b);
 #define BUILTIN_drem (functionptr) builtin_drem
@@ -345,7 +337,7 @@ s8       builtin_f2l(float a);
 s8       asm_builtin_f2l(float a);
 /* NOT AN OP */
 
-double   builtin_f2d(float a);     /* XXX? */
+double   builtin_f2d(float a);
 /* NOT AN OP */
 
 s4       builtin_d2i(double a);
@@ -357,7 +349,7 @@ s8       builtin_d2l(double a);
 s8       asm_builtin_d2l(double a);
 /* NOT AN OP */
 
-float    builtin_d2f(double a);    /* XXX? */
+float    builtin_d2f(double a);
 /* NOT AN OP */
 
 java_arrayheader *builtin_clone_array(void *env, java_arrayheader *o);
index a73597d58afc442f97a396b020caf735be57d53d..e8d8bd58d3e424205c3ca445e425be4484203552 100644 (file)
@@ -30,7 +30,7 @@
             Mark Probst
                        Edwin Steiner
 
-   $Id: loader.c 881 2004-01-13 19:57:08Z edwin $
+   $Id: loader.c 890 2004-01-19 12:24:13Z edwin $
 
 */
 
@@ -763,7 +763,7 @@ static int checkmethoddescriptor (utf *d)
 
     /* check arguments */
     while (utf_ptr != end_pos && *utf_ptr != ')') {
-               /* XXX we cannot count the this argument here because
+               /* We cannot count the this argument here because
                 * we don't know if the method is static. */
                if (*utf_ptr == 'J' || *utf_ptr == 'D')
                        argcount+=2;
@@ -790,7 +790,6 @@ static int checkmethoddescriptor (utf *d)
 
        /* XXX use the following if -noverify */
 #if 0
-       /* XXX check length */
        /* check arguments */
        while ((c = *utf_ptr++) != ')') {
                start = utf_ptr-1;
@@ -1070,7 +1069,6 @@ static void method_load(methodinfo *m, classinfo *c)
                        panic("Method has more than 255 arguments");
 
                /* check flag consistency */
-               /* XXX could check if <clinit> is STATIC */
                if (m->name != utf_clinit) {
                        i = (m->flags & (ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED));
                        if (i != 0 && i != ACC_PUBLIC && i != ACC_PRIVATE && i != ACC_PROTECTED)
@@ -1706,7 +1704,7 @@ static int class_load(classinfo *c)
        /* check ACC flags consistency */
        if ((c->flags & ACC_INTERFACE) != 0) {
                if ((c->flags & ACC_ABSTRACT) == 0) {
-                       /* XXX We work around this because interfaces in JDK 1.1 are
+                       /* We work around this because interfaces in JDK 1.1 are
                         * not declared abstract. */
 
                        c->flags |= ACC_ABSTRACT;
@@ -1974,7 +1972,7 @@ void class_new_array(classinfo *c)
        methodinfo *clone;
        int namelen;
 
-       /* XXX remove */ /* dolog("class_new_array: %s",c->name->text); */
+       /* DEBUG */ /* dolog("class_new_array: %s",c->name->text); */
 
        /* Array classes are not loaded from classfiles. */
        list_remove(&unloadedclasses, c);
@@ -2004,21 +2002,21 @@ void class_new_array(classinfo *c)
        c->flags = ACC_PUBLIC | ACC_FINAL | ACC_ABSTRACT;
 
     c->interfacescount = 2;
-    c->interfaces = MNEW(classinfo*,2); /* XXX use GC? */
+    c->interfaces = MNEW(classinfo*,2);
     c->interfaces[0] = class_java_lang_Cloneable;
     c->interfaces[1] = class_java_io_Serializable;
 
        c->methodscount = 1;
-       c->methods = MNEW (methodinfo, c->methodscount); /* XXX use GC? */
+       c->methods = MNEW (methodinfo, c->methodscount);
 
        clone = c->methods;
        memset(clone, 0, sizeof(methodinfo));
-       clone->flags = ACC_PUBLIC; /* XXX protected? */
+       clone->flags = ACC_PUBLIC;
        clone->name = utf_new_char("clone");
        clone->descriptor = utf_new_char("()Ljava/lang/Object;");
        clone->class = c;
        clone->stubroutine = createnativestub((functionptr) &builtin_clone_array, clone);
-       clone->monoPoly = MONO; /* XXX should be poly? */
+       clone->monoPoly = MONO;
 
        /* XXX: field: length? */
 
@@ -3223,7 +3221,7 @@ classinfo *loader_load(utf *topname)
        if (linkverbose)
                dolog("Linking...");
 
-       /* XXX added a hack to break infinite linking loops. A better
+       /* Added a hack to break infinite linking loops. A better
         * linking algorithm would be nice. -Edwin */
        notlinkable = NULL;
        while ((c = list_first(&unlinkedclasses))) {
@@ -3285,7 +3283,7 @@ classinfo *loader_load(utf *topname)
        pthread_mutex_unlock(&compiler_mutex);
 #endif
 
-       /* XXX DEBUG */ if (linkverbose && !top) dolog("returning NULL from loader_load");
+       /* DEBUG */ /*if (linkverbose && !top) dolog("returning NULL from loader_load");*/
        
        return top; 
 }
@@ -3471,7 +3469,7 @@ classinfo *class_from_descriptor(char *utf_ptr, char *end_ptr,
                          if (mode & CLASSLOAD_SKIP) return class_java_lang_Object;
                          name = utf_new(start,utf_ptr-start);
                          return (mode & CLASSLOAD_LOAD)
-                                 ? loader_load(name) : class_new(name); /* XXX */
+                                 ? loader_load(name) : class_new(name); /* XXX handle errors */
                }
        }