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"
#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! */
/* 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;
}
typedescriptor *returntype)
{
s4 i;
- s4 index;
+ s4 varindex;
s4 type;
s4 slot = 0;
/* 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;
}
/* {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.} */