* configure.ac (static-classpath): Removed.
[cacao.git] / src / vm / jit / i386 / codegen.c
index 997f0e5d5a14af9badd5c0ffb754c7085ddc5c36..f68f8e21af74113deae440daae46d26537172cb2 100644 (file)
@@ -2110,9 +2110,9 @@ bool codegen_emit(jitdata *jd)
 
                        M_AST(s1, REG_SP, 0 * 4);
                        M_AST(s3, REG_SP, 1 * 4);
-                       M_MOV_IMM(BUILTIN_canstore, REG_ITMP1);
+                       M_MOV_IMM(BUILTIN_FAST_canstore, REG_ITMP1);
                        M_CALL(REG_ITMP1);
-                       emit_exception_check(cd, iptr);
+                       emit_arraystore_check(cd, iptr);
 
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
@@ -3577,10 +3577,6 @@ void codegen_emit_stub_builtin(jitdata *jd, builtintable_entry *bte)
        M_MOV_IMM(codegen_stub_builtin_enter, REG_ITMP1);
        M_CALL(REG_ITMP1);
 
-       /* builtins are allowed to have 4 arguments max */
-
-       assert(md->paramcount <= 4);
-
        /* copy arguments into new stackframe */
 
        for (i = 0; i < md->paramcount; i++) {
@@ -3740,10 +3736,8 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f)
 
        /* get function address (this must happen before the stackframeinfo) */
 
-#if !defined(WITH_STATIC_CLASSPATH)
        if (f == NULL)
                codegen_addpatchref(cd, PATCHER_resolve_native, m, 0);
-#endif
 
        M_AST_IMM((ptrint) f, REG_SP, 4 * 4);
 
@@ -3773,21 +3767,18 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f)
        /* prepare data structures for native function call */
 
        M_MOV(REG_SP, REG_ITMP1);
-       M_AADD_IMM(cd->stackframesize * 8, REG_ITMP1);
-
        M_AST(REG_ITMP1, REG_SP, 0 * 4);
        M_IST_IMM(0, REG_SP, 1 * 4);
        dseg_adddata(cd);
 
-       M_MOV(REG_SP, REG_ITMP2);
-       M_AADD_IMM(cd->stackframesize * 8 + SIZEOF_VOID_P, REG_ITMP2);
-
-       M_AST(REG_ITMP2, REG_SP, 2 * 4);
-       M_ALD(REG_ITMP3, REG_SP, cd->stackframesize * 8);
-       M_AST(REG_ITMP3, REG_SP, 3 * 4);
        M_MOV_IMM(codegen_start_native_call, REG_ITMP1);
        M_CALL(REG_ITMP1);
 
+       /* remember class argument */
+
+       if (m->flags & ACC_STATIC)
+               M_MOV(REG_RESULT, REG_ITMP2);
+
        M_ALD(REG_ITMP3, REG_SP, 4 * 4);
 
        /* copy arguments into new stackframe */
@@ -3816,7 +3807,7 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f)
        /* if function is static, put class into second argument */
 
        if (m->flags & ACC_STATIC)
-               M_AST_IMM(m->class, REG_SP, 1 * 4);
+               M_AST(REG_ITMP2, REG_SP, 1 * 4);
 
        /* put env into first argument */