Merged trunk and subtype.
[cacao.git] / src / vm / jit / builtin.cpp
index 5dbd12a7520dda46fab14008d0e0265fefdd58d2..cd53c03dd4c51e11d7391c256fefc82b9085a596 100644 (file)
@@ -655,15 +655,11 @@ bool builtin_canstore(java_handle_objectarray_t *oa, java_handle_t *o)
 
 bool fast_subtype_check(struct _vftbl *s, struct _vftbl *t)
 {
-       int i;
        if (s->subtype_display[t->subtype_depth] == t)
                return true;
        if (t->subtype_offset != OFFSET(vftbl_t, subtype_display[DISPLAY_SIZE]))
                return false;
-       for (i=0; i<s->subtype_overflow_length; i++)
-               if (s->subtype_overflow[i] == t)
-                       return true;
-       return false;
+       return s->subtype_depth >= t->subtype_depth && s->subtype_overflow[t->subtype_depth - DISPLAY_SIZE] == t;
 }
 
 bool builtin_fast_canstore(java_objectarray_t *oa, java_object_t *o)