Merge from subtype.
[cacao.git] / src / vm / jit / s390 / patcher.c
index 63af568e0ec081f079d8b072497eb863fc8aa4c6..1add8371907da523544b80c3f0dbe8479616def7 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/s390/patcher.c - s390 code patching functions
 
-   Copyright (C) 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
-   C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-   E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-   J. Wenninger, Institut f. Computersprachen - TU Wien
+   Copyright (C) 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
 #include <stdint.h>
 
 #include "mm/memory.h"
-#include "native/native.h"
-#include "vm/builtin.h"
-#include "vm/exceptions.h"
-#include "vm/initialize.h"
-#include "vm/jit/patcher-common.h"
+#include "native/native.hpp"
+
+#include "vm/jit/builtin.hpp"
+#include "vm/class.hpp"
+#include "vm/field.hpp"
+#include "vm/initialize.hpp"
+#include "vm/options.h"
+#include "vm/references.h"
+#include "vm/resolve.hpp"
+#include "vm/types.h"
+
+#include "vm/jit/patcher-common.hpp"
 #include "vm/jit/s390/codegen.h"
 #include "vm/jit/s390/md-abi.h"
-#include "vm/jit/stacktrace.h"
-#include "vm/resolve.h"
-#include "vm/types.h"
-#include "vmcore/class.h"
-#include "vmcore/field.h"
-#include "vmcore/options.h"
-#include "vmcore/references.h"
+
 
 #define PATCH_BACK_ORIGINAL_MCODE \
        *((u2 *) pr->mpc) = (u2) pr->mcode;
@@ -90,8 +89,8 @@ bool patcher_get_putstatic(patchref_t *pr)
 
        /* check if the field's class is initialized */
 
-       if (!(fi->class->state & CLASS_INITIALIZED))
-               if (!initialize_class(fi->class))
+       if (!(fi->clazz->state & CLASS_INITIALIZED))
+               if (!initialize_class(fi->clazz))
                        return false;
 
        PATCH_BACK_ORIGINAL_MCODE;
@@ -132,11 +131,6 @@ bool patcher_get_putfield(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* If there is an operand load before, skip the load size passed in disp (see ICMD_PUTFIELD) */
 
        ra += disp;
@@ -220,11 +214,6 @@ bool patcher_invokevirtual(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* patch vftbl index */
 
 
@@ -268,22 +257,17 @@ bool patcher_invokeinterface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* get interfacetable index */
 
        idx = (s4) (OFFSET(vftbl_t, interfacetable[0]) -
-               sizeof(methodptr) * m->class->index);
+               sizeof(methodptr) * m->clazz->index);
 
        ASSERT_VALID_IMM(idx);
 
        /* get method offset */
 
        off =
-               (s4) (sizeof(methodptr) * (m - m->class->methods));
+               (s4) (sizeof(methodptr) * (m - m->clazz->methods));
 
        ASSERT_VALID_DISP(off);
 
@@ -429,11 +413,6 @@ bool patcher_checkcast_instanceof_interface(patchref_t *pr)
 
        PATCH_BACK_ORIGINAL_MCODE;
 
-       /* If NOPs are generated, skip them */
-
-       if (opt_shownops)
-               ra += PATCHER_NOPS_SKIP;
-
        /* patch super class index */
 
        /* From here, split your editor and open codegen.c */