* src/vmcore/class.h (classinfo): Changed type of super and interfaces
[cacao.git] / src / vm / jit / verify / typeinfo.c
index 660a25b1233f5f298040d234105a7faabc784e46..b3313cea5bfc6e584994f6a2057bf03309aa2d53 100644 (file)
@@ -22,8 +22,6 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: typeinfo.c 7246 2007-01-29 18:49:05Z twisti $
-
 */
 
 
 #include <string.h>
 
 #include "mm/memory.h"
+
 #include "toolbox/logging.h"
 
+#include "vm/array.h"
 #include "vm/exceptions.h"
+#include "vm/primitive.h"
+#include "vm/resolve.h"
 
 #include "vm/jit/jit.h"
 #include "vm/jit/verify/typeinfo.h"
@@ -43,7 +45,6 @@
 #include "vmcore/class.h"
 #include "vmcore/descriptor.h"
 #include "vmcore/loader.h"
-#include "vmcore/resolve.h"
 
 
 /* check if a linked class is an array class. Only use for linked classes! */
@@ -417,13 +418,13 @@ interface_extends_interface(classinfo *cls,classinfo *interf)
 
     /* first check direct superinterfaces */
     for (i=0; i<cls->interfacescount; ++i) {
-        if (cls->interfaces[i].cls == interf)
+        if (cls->interfaces[i] == interf)
             return true;
     }
     
     /* check indirect superinterfaces */
     for (i=0; i<cls->interfacescount; ++i) {
-        if (interface_extends_interface(cls->interfaces[i].cls,interf))
+        if (interface_extends_interface(cls->interfaces[i],interf))
             return true;
     }
     
@@ -1190,7 +1191,7 @@ typeinfo_init_varinfos_from_methoddesc(varinfo *vars,
                                                                         typedescriptor *returntype)
 {
        s4 i;
-    s4 index;
+    s4 varindex;
        s4 type;
        s4 slot = 0;
 
@@ -1204,21 +1205,21 @@ typeinfo_init_varinfos_from_methoddesc(varinfo *vars,
     /* check arguments */
     for (i=startindex; i<desc->paramcount; ++i) {
                type = desc->paramtypes[i].type;
-               index = map[5*slot + type];
+               varindex = map[5*slot + type];
 
                slot++;
                if (IS_2_WORD_TYPE(type))
                        slot++;
 
-               if (index == UNUSED)
+               if (varindex == UNUSED)
                        continue;
 
-               if (index >= buflen) {
+               if (varindex >= buflen) {
                        exceptions_throw_internalerror("Buffer too small for method arguments.");
                        return false;
                }
 
-               if (!typeinfo_init_varinfo_from_typedesc(vars + index, desc->paramtypes + i))
+               if (!typeinfo_init_varinfo_from_typedesc(vars + varindex, desc->paramtypes + i))
                        return false;
     }
 
@@ -1851,13 +1852,16 @@ typeinfo_merge_nonarrays(typeinfo *dest,
     /* {We know: y is at least as deep in the hierarchy as x.} */
 
     /* Find nearest common anchestor for the classes. */
+
     common = x.cls;
-    tcls = y.cls;
+    tcls   = y.cls;
+
     while (tcls->index > common->index)
-        tcls = tcls->super.cls;
+        tcls = tcls->super;
+
     while (common != tcls) {
-        common = common->super.cls;
-        tcls = tcls->super.cls;
+        common = common->super;
+        tcls = tcls->super;
     }
 
     /* {common == nearest common anchestor of x and y.} */