* src/vm/jit/parse.cpp,
[cacao.git] / src / vm / jit / m68k / codegen.c
index 478b6f3cf578a07a739152f77a9a0669ab3b40a1..a6ad45abeef0244cfe0ed521ba3f4dd8acdce5fb 100644 (file)
 #include <stdint.h>
 
 #include "md-abi.h"
-#include "md-os.h"
 
 #include "vm/types.h"
 #include "vm/jit/m68k/codegen.h"
 #include "vm/jit/m68k/emit.h"
 
 #include "mm/memory.h"
-#include "native/jni.h"
-#include "native/localref.h"
-#include "native/native.h"
 
-#include "threads/lock-common.h"
+#include "native/localref.hpp"
+#include "native/native.hpp"
 
-#include "vm/builtin.h"
-#include "vm/exceptions.h"
+#include "threads/lock.hpp"
+
+#include "vm/jit/builtin.hpp"
+#include "vm/exceptions.hpp"
 #include "vm/global.h"
-#include "vm/stringlocal.h"
-#include "vm/vm.h"
+#include "vm/loader.hpp"
+#include "vm/options.h"
+#include "vm/utf8.h"
+#include "vm/vm.hpp"
 
 #include "vm/jit/asmpart.h"
-#include "vm/jit/codegen-common.h"
-#include "vm/jit/patcher-common.h"
+#include "vm/jit/codegen-common.hpp"
+#include "vm/jit/patcher-common.hpp"
 #include "vm/jit/dseg.h"
-#include "vm/jit/linenumbertable.h"
-#include "vm/jit/emit-common.h"
-#include "vm/jit/jit.h"
+#include "vm/jit/linenumbertable.hpp"
+#include "vm/jit/emit-common.hpp"
+#include "vm/jit/jit.hpp"
 #include "vm/jit/abi.h"
-#include "vm/jit/parse.h"
+#include "vm/jit/parse.hpp"
 #include "vm/jit/reg.h"
-#include "vm/jit/replace.h"
-#include "vm/jit/stacktrace.h"
-
-#include "vmcore/loader.h"
-#include "vmcore/options.h"
-#include "vmcore/utf8.h"
+#include "vm/jit/replace.hpp"
+#include "vm/jit/stacktrace.hpp"
+#include "vm/jit/trap.h"
 
 
 bool codegen_emit(jitdata *jd) 
@@ -258,7 +256,7 @@ bool codegen_emit(jitdata *jd)
                        M_ALD(REG_ATMP1, REG_SP, cd->stackframesize + 4);
                        M_ATST(REG_ATMP1);
                        M_BNE(2);
-                       M_TRAP(M68K_EXCEPTION_HARDWARE_NULLPOINTER);
+                       M_TRAP(TRAP_NullPointerException);
                }
 
                M_AST(REG_ATMP1, REG_SP, rd->memuse * 8);
@@ -1994,9 +1992,6 @@ nowperformreturn:
                                superindex = super->index;
                        }
                        
-                       if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                               CODEGEN_CRITICAL_SECTION_NEW;
-
                        s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP2);
 
@@ -2060,14 +2055,10 @@ nowperformreturn:
 
                                M_ALD(REG_ATMP1, s1, OFFSET(java_object_t, vftbl));
 
-                               CODEGEN_CRITICAL_SECTION_START;
-
                                M_ILD(REG_ITMP1, REG_ATMP1, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP3, REG_ATMP2, OFFSET(vftbl_t, baseval));
                                M_ILD(REG_ITMP2, REG_ATMP2, OFFSET(vftbl_t, diffval));
 
-                               CODEGEN_CRITICAL_SECTION_END;
-
                                M_ISUB(REG_ITMP3, REG_ITMP1);
                                M_ICMP(REG_ITMP2, REG_ITMP1);
                                M_BHI(4);
@@ -2119,9 +2110,6 @@ nowperformreturn:
                                        superindex = super->index;
                                }
 
-                               if ((super == NULL) || !(super->flags & ACC_INTERFACE))
-                                       CODEGEN_CRITICAL_SECTION_NEW;
-
                                s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                                assert(VAROP(iptr->s1)->type == TYPE_ADR);
 
@@ -2181,14 +2169,10 @@ nowperformreturn:
 
                                        M_ALD(REG_ATMP2, s1, OFFSET(java_object_t, vftbl));
 
-                                       CODEGEN_CRITICAL_SECTION_START;
-
                                        M_ILD(REG_ITMP3, REG_ATMP2, OFFSET(vftbl_t, baseval));  /* REG_ITMP3 == sub->vftbl->baseval */
                                        M_ILD(REG_ITMP1, REG_ATMP3, OFFSET(vftbl_t, baseval));
                                        M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, diffval));
 
-                                       CODEGEN_CRITICAL_SECTION_END;
-
                                        M_ISUB(REG_ITMP1, REG_ITMP3);
                                        M_ICMP(REG_ITMP2, REG_ITMP3);   /* XXX was CMPU */
 
@@ -2455,7 +2439,7 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f, int s
                        M_AST(REG_ATMP3, REG_SP, 1 * 4);
 
                /* env ist first argument */
-               M_AMOV_IMM(_Jv_env, REG_ATMP1);
+               M_AMOV_IMM(VM_get_jnienv(), REG_ATMP1);
                M_AST(REG_ATMP1, REG_SP, 0 * 4);
        }