Changed some includes.
[cacao.git] / src / vm / jit / inline / sets.c
index dd7820fa09434bfa43466f04c0200994916123ae..b1c3cbfe6ce69fc6c4128e851663d3031dd5b6a6 100644 (file)
@@ -1,10 +1,9 @@
-/* jit/sets.c -
+/* vm/jit/inline/sets.c -
 
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Institut f. Computersprachen, TU Wien
-   R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, M. Probst,
-   S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich,
-   J. Wenninger
+   Copyright (C) 1996-2005 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
 
    This file is part of CACAO.
 
 
    Authors: Carolyn Oates
 
-   $Id: sets.c 662 2003-11-21 18:06:25Z jowenn $
+   $Id: sets.c 2107 2005-03-28 22:44:28Z twisti $
 
 */
 
 
 #include <stdio.h>
-#include "sets.h"
+
 #include "types.h"
-#include "global.h"
-#include "loader.h"
-#include "tables.h"
-#include "toolbox/memory.h"
+#include "mm/memory.h"
+#include "vm/global.h"
+#include "vm/linker.h"
+#include "vm/loader.h"
+#include "vm/tables.h"
+#include "vm/jit/inline/sets.h"
 
 
 /*
@@ -173,10 +174,10 @@ methSetNode *addMethRef(methSetNode *s,  methodinfo *m)
 }
 
 
-/*------------------------------------------------------------*/
+/*x------------------------------------------------------------*/
 methSet *add2MethSet(methSet *sm,  methodinfo *m)
 {
-       methSetNode *s1;
+       methSetNode *snew;
        methSetNode *s;
  
        if (sm == NULL) {
@@ -184,22 +185,22 @@ methSet *add2MethSet(methSet *sm,  methodinfo *m)
        }
        s = sm->head;
        if (!inMethSet(s,m)) {
-               s1 = NEW(methSetNode);
+               snew = NEW(methSetNode);
                if (sm->head == NULL) {
-                       sm->head = s1;
-                       sm->pos   = s1;
-                       s1->index = 1;
+                       sm->head  = snew;
+                       sm->pos   = snew;
+                       snew->index = 1;
                }        
                else {
-                       sm->tail->nextmethRef  = s1;
+                       sm->tail->nextmethRef  = snew;
                        sm->length++;
-                       s1->index = sm->length;
+                       snew->index = sm->length;
        }
-               s1->monoPoly = MONO; 
-               s1->nextmethRef= NULL;
-               s1->methRef = m;
-               s1->lastptrIntoClassSet2 = NULL;
-               sm->tail = s1;
+               snew->monoPoly = MONO; 
+               snew->nextmethRef= NULL;
+               snew->methRef = m;
+               snew->lastptrIntoClassSet2 = NULL; /* ????? */
+               sm->tail = snew;
        }
        return sm;
 }
@@ -307,6 +308,7 @@ int inRange(classSetNode *s, classinfo *c)
 
        for (i = s; i != NULL; i = i->nextClass) {
                classinfo *cs = i->classType;
+               LAZYLOADING(c)  /* ??? is c reallz needed ???*/
                if (cs->vftbl->baseval <= c->vftbl->baseval) {
                        if (c->vftbl->baseval <= (cs->vftbl->baseval+cs->vftbl->diffval)) {
                                rc = -1;  /* subtype */
@@ -354,9 +356,12 @@ classSetNode * intersectSubtypesWithSet(classinfo *t, classSetNode *s) {
 
        /* for each s class */
        for (c=s; c != NULL; c = c->nextClass) {
-               vftbl *t_cl_vt = t->vftbl;
-               vftbl *c_cl_vt = c->classType->vftbl;
-
+               vftbl_t *t_cl_vt;
+               vftbl_t *c_cl_vt;
+               LAZYLOADING(c->classType)
+               LAZYLOADING(t)
+               t_cl_vt = t->vftbl;
+               c_cl_vt = c->classType->vftbl;
                /* if s class is in the t Class range */
                if (  (t_cl_vt->baseval <=  c_cl_vt->baseval)
                          && (c_cl_vt->baseval <= (t_cl_vt->baseval+t_cl_vt->diffval)) ) {