Merged with tip.
[cacao.git] / src / vm / jit / verify / typecheck.c
index fab2c184d65958a4f6745e3f66844342c6a74e48..f76e75226f0fb2409e678311c35fb8ec99badad4 100644 (file)
@@ -1,9 +1,7 @@
 /* src/vm/jit/verify/typecheck.c - typechecking (part of bytecode verification)
 
-   Copyright (C) 1996-2005, 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) 1996-2005, 2006, 2007, 2008
+   CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
@@ -22,8 +20,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: typecheck.c 8159 2007-06-28 00:31:31Z michi $
-
 */
 
 /*
@@ -152,9 +148,11 @@ error reporting.
 #include "toolbox/logging.h"
 
 #include "vm/access.h"
+#include "vm/array.h"
 #include "vm/builtin.h"
 #include "vm/exceptions.h"
 #include "vm/global.h"
+#include "vm/primitive.hpp"
 #include "vm/resolve.h"
 
 #include "vm/jit/jit.h"
@@ -163,7 +161,6 @@ error reporting.
 
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
-#include "vmcore/primitive.h"
 
 #include <typecheck-common.h>
 
@@ -423,7 +420,7 @@ static void typecheck_invalidate_locals(verifier_state *state, s4 index, bool tw
        s4 *localmap = jd->local_map;
        varinfo *vars = jd->var;
 
-       javaindex = state->reverselocalmap[index];
+       javaindex = jd->reverselocalmap[index];
 
        /* invalidate locals of two-word type at index javaindex-1 */
 
@@ -682,8 +679,6 @@ bool typecheck(jitdata *jd)
        codegendata    *cd;
        varinfo        *savedlocals;
        verifier_state  state;             /* current state of the verifier */
-       s4              i;
-       s4              t;
 
        /* collect statistics */
 
@@ -745,18 +740,12 @@ bool typecheck(jitdata *jd)
     if (state.initmethod) 
                state.numlocals++; /* VERIFIER_EXTRA_LOCALS */
 
-       state.reverselocalmap = DMNEW(s4, state.validlocals);
-       for (i=0; i<jd->maxlocals; ++i)
-               for (t=0; t<5; ++t) {
-                       s4 varindex = jd->local_map[5*i + t];
-                       if (varindex >= 0)
-                               state.reverselocalmap[varindex] = i;
-               }
-
        DOLOG(
+               s4 i;
+               s4 t;
                LOG("reverselocalmap:");
                for (i=0; i<state.validlocals; ++i) {
-                       LOG2("    %i => javaindex %i", i, state.reverselocalmap[i]);
+                       LOG2("    %i => javaindex %i", i, jd->reverselocalmap[i]);
                });
 
     /* allocate the buffer of active exception handlers */