assert that the target of an invokestatic call is a static method and that the targets of all other invokes are non-static

This commit is contained in:
Joel Dice 2008-07-12 14:52:14 -06:00
parent 623b5f84dc
commit bf58eaa6ba

View File

@ -2623,6 +2623,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
object target = resolveMethod(t, codePool(t, code), index - 1);
if (UNLIKELY(t->exception)) return;
assert(t, (methodFlags(t, target) & ACC_STATIC) == 0);
unsigned parameterFootprint = methodParameterFootprint(t, target);
unsigned instance = parameterFootprint - 1;
@ -2661,6 +2663,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
target = findMethod(t, target, classSuper(t, class_));
}
assert(t, (methodFlags(t, target) & ACC_STATIC) == 0);
compileDirectInvoke(t, frame, target);
} break;
@ -2670,6 +2674,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
object target = resolveMethod(t, codePool(t, code), index - 1);
if (UNLIKELY(t->exception)) return;
assert(t, methodFlags(t, target) & ACC_STATIC);
compileDirectInvoke(t, frame, target);
} break;
@ -2679,6 +2685,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip,
object target = resolveMethod(t, codePool(t, code), index - 1);
if (UNLIKELY(t->exception)) return;
assert(t, (methodFlags(t, target) & ACC_STATIC) == 0);
unsigned parameterFootprint = methodParameterFootprint(t, target);
unsigned offset = ClassVtable + (methodOffset(t, target) * BytesPerWord);