basic block struct changed
[cacao.git] / ncomp / nparse.c
index e510f3eddb1b8769f74f708e7563e7190f269716..b2f6ec98688bb042ae8c3893fc48d7a491c5bd19 100644 (file)
@@ -616,7 +616,7 @@ static void parse()
                        /************ load and store of object fields ********/
 
                        case JAVA_AASTORE:
-                               BUILTIN3((functionptr) new_builtin_aastore, TYPE_VOID);
+                               BUILTIN3((functionptr) asm_builtin_aastore, TYPE_VOID);
                                break;
 
                        case JAVA_PUTSTATIC:
@@ -707,11 +707,10 @@ static void parse()
                                /* array type cast-check */
                                if (class_constanttype (class, i) == CONSTANT_Arraydescriptor) {
                                        LOADCONST_A(class_getconstant(class, i, CONSTANT_Arraydescriptor));
-                                       BUILTIN2((functionptr) new_builtin_checkarraycast, TYPE_ADR);
+                                       BUILTIN2((functionptr) asm_builtin_checkarraycast, TYPE_ADR);
                                        }
                                else { /* object type cast-check */
-                                       LOADCONST_A(class_getconstant(class, i, CONSTANT_Class));
-                                       BUILTIN2((functionptr) new_builtin_checkcast, TYPE_ADR);
+                                       OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
                                        }
                                break;
 
@@ -724,8 +723,7 @@ static void parse()
                                        BUILTIN2((functionptr) builtin_arrayinstanceof, TYPE_INT);
                                        }
                                else { /* object type cast-check */
-                                       LOADCONST_A(class_getconstant(class, i, CONSTANT_Class));
-                                       BUILTIN2((functionptr) builtin_instanceof, TYPE_INT);
+                                       OP2A(opcode, 1, (class_getconstant(class, i, CONSTANT_Class)));
                                        }
                                break;
 
@@ -734,11 +732,11 @@ static void parse()
                                if (checksync) {
 #ifdef SOFTNULLPTRCHECK
                                        if (checknull) {
-                                               BUILTIN1((functionptr) new_builtin_monitorenter, TYPE_VOID);
+                                               BUILTIN1((functionptr) asm_builtin_monitorenter, TYPE_VOID);
                                                }
                                        else {
 /*                                             BUILTIN1((functionptr) builtin_monitorenter, TYPE_VOID); */
-                                               BUILTIN1((functionptr) new_builtin_monitorenter, TYPE_VOID);
+                                               BUILTIN1((functionptr) asm_builtin_monitorenter, TYPE_VOID);
                                                }
 #else
                                        BUILTIN1((functionptr) builtin_monitorenter, TYPE_VOID);
@@ -925,7 +923,7 @@ static void parse()
        /* additional block if target 0 is not first intermediate instruction     */
 
        if (!block_index[0] || (block_index[0] > 1)) {
-               bptr->ipc = 0;
+               bptr->iinstr = instr;
                bptr->mpc = -1;
                bptr->flags = -1;
                bptr->type = BBTYPE_STD;
@@ -939,7 +937,9 @@ static void parse()
 
        for (p = 0; p < jcodelength; p++)
                if (block_index[p] & 1) {
-                       bptr->ipc = block_index[p] >> 1;
+                       bptr->iinstr = instr + (block_index[p] >> 1);
+                       if (b_count != 0)
+                               (bptr - 1)->icount = bptr->iinstr - (bptr - 1)->iinstr;
                        bptr->mpc = -1;
                        bptr->flags = -1;
                        bptr->type = BBTYPE_STD;
@@ -952,7 +952,9 @@ static void parse()
 
        /* allocate additional block at end */
 
-       bptr->ipc = instr_count;
+       bptr->iinstr = NULL;
+       (bptr - 1)->icount = (instr + instr_count) - (bptr - 1)->iinstr;
+       bptr->icount = 0;
        bptr->mpc = -1;
        bptr->flags = -1;
        bptr->type = BBTYPE_STD;