* ICMD_CHECKASIZE, ICMD_CHECKEXCEPTION: Removed.
[cacao.git] / src / vm / jit / parse.c
index 3b97ce5bbc232fda310e39e393a395e805344c13..f14d8697265623b0a57c3d928e1265af268ae85c 100644 (file)
@@ -31,7 +31,7 @@
             Joseph Wenninger
             Christian Thalinger
 
-   $Id: parse.c 2969 2005-07-10 15:24:35Z twisti $
+   $Id: parse.c 3330 2005-10-04 18:52:44Z twisti $
 
 */
 
@@ -40,7 +40,9 @@
 #include <string.h>
 
 #include "config.h"
-#include "types.h"
+
+#include "vm/types.h"
+
 #include "mm/memory.h"
 #include "native/native.h"
 #include "toolbox/logging.h"
@@ -654,7 +656,6 @@ SHOWOPCODE(DEBUG4)
                /* managing arrays ****************************************************/
 
                case JAVA_NEWARRAY:
-                       OP(ICMD_CHECKASIZE);
                        switch (code_get_s1(p + 1, inline_env->method)) {
                        case 4:
                                bte = builtintable_get_internal(BUILTIN_newarray_boolean);
@@ -684,12 +685,10 @@ SHOWOPCODE(DEBUG4)
                                log_text("Invalid array-type to create");
                                assert(0);
                        }
-                       BUILTIN(bte, bte->md->paramcount, NULL, currentline);
-                       OP(ICMD_CHECKEXCEPTION);
+                       BUILTIN(bte, true, NULL, currentline);
                        break;
 
                case JAVA_ANEWARRAY:
-                       OP(ICMD_CHECKASIZE);
                        i = code_get_u2(p + 1, inline_env->method);
                        compr = (constant_classref *) class_getconstant(inline_env->method->class, i, CONSTANT_Class);
 
@@ -702,23 +701,20 @@ SHOWOPCODE(DEBUG4)
                        if (c) {
                                bte = builtintable_get_internal(BUILTIN_newarray);
                                LOADCONST_A_BUILTIN(c->vftbl);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, true, NULL, currentline);
 
                        } else {
                                bte = builtintable_get_internal(PATCHER_builtin_newarray);
                                LOADCONST_A_BUILTIN(cr);
-                               BUILTIN(bte, bte->md->paramcount, cr, currentline);
+                               BUILTIN(bte, true, cr, currentline);
                        }
                        s_count++;
-                       OP(ICMD_CHECKEXCEPTION);
                        break;
 
                case JAVA_MULTIANEWARRAY:
                        inline_env->method->isleafmethod = false;
                        i = code_get_u2(p + 1, inline_env->method);
                        {
-                               constant_classref *cr;
-                               classinfo *c;
                                s4 v = code_get_u1(p + 3, inline_env->method);
 
                                cr = (constant_classref *) class_getconstant(inline_env->method->class, i, CONSTANT_Class);
@@ -998,14 +994,9 @@ SHOWOPCODE(DEBUG4)
                /* load and store of object fields ************************************/
 
                case JAVA_AASTORE:
-#if defined(__POWERPC__) || defined(__X86_64__) || defined(__I386__)
                        bte = builtintable_get_internal(BUILTIN_canstore);
                        OP2A(opcode, bte->md->paramcount, bte, currentline);
                        inline_env->method->isleafmethod = false;
-#else
-                       bte = builtintable_get_internal(BUILTIN_aastore);
-                       BUILTIN(bte, bte->md->paramcount, NULL, currentline);
-#endif
                        break;
 
                case JAVA_GETSTATIC:
@@ -1074,7 +1065,7 @@ SHOWOPCODE(DEBUG4)
                                        if (!descriptor_params_from_paramtypes(md, ACC_STATIC))
                                                return NULL;
 
-                               OP2A_NOINC(opcode, md->paramcount, mr, currentline);
+                               OP2A_NOINC(opcode, 0, mr, currentline);
 
                                um = create_unresolved_method(inline_env->method->class,
                                                                                          inline_env->method, iptr);
@@ -1121,7 +1112,7 @@ SHOWOPCODE(DEBUG4)
                                        if (!descriptor_params_from_paramtypes(md, 0))
                                                return NULL;
                                
-                               OP2A_NOINC(opcode, md->paramcount, mr, currentline);
+                               OP2A_NOINC(opcode, 0, mr, currentline);
 
                                um = create_unresolved_method(inline_env->method->class,
                                                                                          inline_env->method, iptr);
@@ -1167,7 +1158,7 @@ SHOWOPCODE(DEBUG4)
                                        if (!descriptor_params_from_paramtypes(md, 0))
                                                return NULL;
 
-                               OP2A_NOINC(opcode, md->paramcount, mr, currentline);
+                               OP2A_NOINC(opcode, 0, mr, currentline);
 
                                um = create_unresolved_method(inline_env->method->class,
                                                                                          inline_env->method, iptr);
@@ -1207,16 +1198,15 @@ SHOWOPCODE(DEBUG4)
                        if (c && c->initialized) {
                                bte = builtintable_get_internal(BUILTIN_new);
                                LOADCONST_A_BUILTIN(c);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, true, NULL, currentline);
 
                        } else {
                                bte = builtintable_get_internal(PATCHER_builtin_new);
                                LOADCONST_A_BUILTIN(cr);
-                               BUILTIN(bte, bte->md->paramcount, cr, currentline);
+                               BUILTIN(bte, true, cr, currentline);
                        }
 
                        s_count++;
-                       OP(ICMD_CHECKEXCEPTION);
                        break;
 
                case JAVA_CHECKCAST:
@@ -1229,7 +1219,6 @@ SHOWOPCODE(DEBUG4)
 
                        if (cr->name->text[0] == '[') {
                                /* array type cast-check */
-#if defined(__POWERPC__) || defined(__X86_64__) || defined(__I386__)
                                if (c) {
                                        bte = builtintable_get_internal(BUILTIN_arraycheckcast);
                                        OP2AT(ICMD_ARRAYCHECKCAST, 1, bte, c->vftbl, currentline);
@@ -1239,20 +1228,6 @@ SHOWOPCODE(DEBUG4)
                                        OP2AT(ICMD_ARRAYCHECKCAST, 0, bte, cr, currentline);
                                }
                                inline_env->method->isleafmethod = false;
-#else
-                               if (c) {
-                                       bte = builtintable_get_internal(BUILTIN_arraycheckcast);
-                                       LOADCONST_A_BUILTIN(c->vftbl);
-                                       BUILTIN(bte, bte->md->paramcount, NULL, currentline);
-
-                               } else {
-                                       bte = builtintable_get_internal(PATCHER_builtin_arraycheckcast);
-                                       LOADCONST_A_BUILTIN(cr);
-                                       BUILTIN(bte, bte->md->paramcount, cr, currentline);
-                               }
-                               s_count++;
-                               inline_env->method->isleafmethod = false;
-#endif
 
                        } else {
                                /* object type cast-check */
@@ -1277,12 +1252,12 @@ SHOWOPCODE(DEBUG4)
                                if (c) {
                                        bte = builtintable_get_internal(BUILTIN_arrayinstanceof);
                                        LOADCONST_A_BUILTIN(c->vftbl);
-                                       BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                                       BUILTIN(bte, false, NULL, currentline);
 
                                } else {
                                        bte = builtintable_get_internal(PATCHER_builtin_arrayinstanceof);
                                        LOADCONST_A_BUILTIN(cr);
-                                       BUILTIN(bte, bte->md->paramcount, cr, currentline);
+                                       BUILTIN(bte, false, cr, currentline);
                                }
                                s_count++;
 
@@ -1301,7 +1276,7 @@ SHOWOPCODE(DEBUG4)
                        if (checksync) {
                                OP(ICMD_CHECKNULL);
                                bte = builtintable_get_internal(BUILTIN_monitorenter);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, false, NULL, currentline);
                        } else
 #endif
                                {
@@ -1314,7 +1289,7 @@ SHOWOPCODE(DEBUG4)
 #if defined(USE_THREADS)
                        if (checksync) {
                                bte = builtintable_get_internal(BUILTIN_monitorexit);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, false, NULL, currentline);
                        } else
 #endif
                                {
@@ -1369,7 +1344,7 @@ SHOWOPCODE(DEBUG4)
                        OP(opcode);
 #else
                        bte = builtintable_get_internal(BUILTIN_frem);
-                       BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                       BUILTIN(bte, false, NULL, currentline);
 #endif
                        break;
 
@@ -1378,7 +1353,7 @@ SHOWOPCODE(DEBUG4)
                        OP(opcode);
 #else
                        bte = builtintable_get_internal(BUILTIN_drem);
-                       BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                       BUILTIN(bte, false, NULL, currentline);
 #endif
                        break;
 
@@ -1386,7 +1361,7 @@ SHOWOPCODE(DEBUG4)
 #if defined(__ALPHA__)
                        if (!opt_noieee) {
                                bte = builtintable_get_internal(BUILTIN_f2i);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, false, NULL, currentline);
                        } else
 #endif
                                {
@@ -1398,7 +1373,7 @@ SHOWOPCODE(DEBUG4)
 #if defined(__ALPHA__)
                        if (!opt_noieee) {
                                bte = builtintable_get_internal(BUILTIN_f2l);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, false, NULL, currentline);
                        } else 
 #endif
                                {
@@ -1410,7 +1385,7 @@ SHOWOPCODE(DEBUG4)
 #if defined(__ALPHA__)
                        if (!opt_noieee) {
                                bte = builtintable_get_internal(BUILTIN_d2i);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, false, NULL, currentline);
                        } else
 #endif
                                {
@@ -1422,7 +1397,7 @@ SHOWOPCODE(DEBUG4)
 #if defined(__ALPHA__)
                        if (!opt_noieee) {
                                bte = builtintable_get_internal(BUILTIN_d2l);
-                               BUILTIN(bte, bte->md->paramcount, NULL, currentline);
+                               BUILTIN(bte, false, NULL, currentline);
                        } else
 #endif
                                {