* patcher_builtin_newarray, patcher_builtin_multianewarray,
[cacao.git] / src / vm / jit / i386 / patcher.c
index 36c431f521bd3f9b6183b4f27d6a910927a4f361..2831080f1ca10c3e8a9ceb4e567304087b137f59 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: patcher.c 3392 2005-10-10 13:40:11Z twisti $
+   $Id: patcher.c 3569 2005-11-04 16:47:25Z twisti $
 
 */
 
@@ -42,8 +42,8 @@
 #include "vm/field.h"
 #include "vm/initialize.h"
 #include "vm/options.h"
+#include "vm/resolve.h"
 #include "vm/references.h"
-#include "vm/jit/helper.h"
 #include "vm/jit/patcher.h"
 
 
@@ -80,7 +80,7 @@ bool patcher_get_putstatic(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(fi = helper_resolve_fieldinfo(uf))) {
+       if (!(fi = resolve_field_eager(uf))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -149,7 +149,7 @@ bool patcher_getfield(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(fi = helper_resolve_fieldinfo(uf))) {
+       if (!(fi = resolve_field_eager(uf))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -213,7 +213,7 @@ bool patcher_putfield(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(fi = helper_resolve_fieldinfo(uf))) {
+       if (!(fi = resolve_field_eager(uf))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -286,7 +286,7 @@ bool patcher_putfieldconst(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(fi = helper_resolve_fieldinfo(uf))) {
+       if (!(fi = resolve_field_eager(uf))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -359,7 +359,7 @@ bool patcher_builtin_new(u1 *sp)
 
        /* get the classinfo */
 
-       if (!(c = helper_resolve_classinfo_nonabstract(cr))) {
+       if (!(c = resolve_classref_eager_nonabstract(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -424,7 +424,7 @@ bool patcher_builtin_newarray(u1 *sp)
 
        /* get the classinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -435,9 +435,9 @@ bool patcher_builtin_newarray(u1 *sp)
        *((u4 *) (ra + 8 + 0)) = (u4) mcode;
        *((u1 *) (ra + 8 + 4)) = (u1) (mcode >> 32);
 
-       /* patch the class' vftbl pointer */
+       /* patch the classinfo pointer */
 
-       *((ptrint *) (ra + 4)) = (ptrint) c->vftbl;
+       *((ptrint *) (ra + 4)) = (ptrint) c;
 
        /* if we show disassembly, we have to skip the nop's */
 
@@ -493,7 +493,7 @@ bool patcher_builtin_multianewarray(u1 *sp)
 
        /* get the classinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -509,9 +509,9 @@ bool patcher_builtin_multianewarray(u1 *sp)
        if (opt_showdisassemble)
                ra = ra + 5;
 
-       /* patch the class' vftbl pointer */
+       /* patch the classinfo pointer */
 
-       *((ptrint *) (ra + 7 + 4)) = (ptrint) c->vftbl;
+       *((ptrint *) (ra + 7 + 4)) = (ptrint) c;
 
        /* patch new function address */
 
@@ -558,7 +558,7 @@ bool patcher_builtin_arraycheckcast(u1 *sp)
 
        /* get the classinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -574,9 +574,9 @@ bool patcher_builtin_arraycheckcast(u1 *sp)
        if (opt_showdisassemble)
                ra = ra + 5;
 
-       /* patch the class' vftbl pointer */
+       /* patch the classinfo pointer */
 
-       *((ptrint *) (ra + 4)) = (ptrint) c->vftbl;
+       *((ptrint *) (ra + 4)) = (ptrint) c;
 
        /* patch new function address */
 
@@ -623,7 +623,7 @@ bool patcher_builtin_arrayinstanceof(u1 *sp)
 
        /* get the classinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -634,9 +634,9 @@ bool patcher_builtin_arrayinstanceof(u1 *sp)
        *((u4 *) (ra + 8 + 0)) = (u4) mcode;
        *((u1 *) (ra + 8 + 4)) = (u1) (mcode >> 32);
 
-       /* patch the class' vftbl pointer */
+       /* patch the classinfo pointer */
 
-       *((ptrint *) (ra + 4)) = (ptrint) c->vftbl;
+       *((ptrint *) (ra + 4)) = (ptrint) c;
 
        /* if we show disassembly, we have to skip the nop's */
 
@@ -687,7 +687,7 @@ bool patcher_invokestatic_special(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(m = helper_resolve_methodinfo(um))) {
+       if (!(m = resolve_method_eager(um))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -748,7 +748,7 @@ bool patcher_invokevirtual(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(m = helper_resolve_methodinfo(um))) {
+       if (!(m = resolve_method_eager(um))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -811,7 +811,7 @@ bool patcher_invokeinterface(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(m = helper_resolve_methodinfo(um))) {
+       if (!(m = resolve_method_eager(um))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -876,7 +876,7 @@ bool patcher_checkcast_instanceof_flags(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -939,7 +939,7 @@ bool patcher_checkcast_instanceof_interface(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -1006,7 +1006,7 @@ bool patcher_checkcast_class(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;
@@ -1069,7 +1069,7 @@ bool patcher_instanceof_class(u1 *sp)
 
        /* get the fieldinfo */
 
-       if (!(c = helper_resolve_classinfo(cr))) {
+       if (!(c = resolve_classref_eager(cr))) {
                PATCHER_MONITOREXIT;
 
                return false;