implement checkcast and instanceof

This commit is contained in:
Joel Dice
2007-09-29 15:08:29 -06:00
parent 569cfa9e07
commit b0500a881c
2 changed files with 119 additions and 32 deletions

View File

@ -1713,12 +1713,9 @@ interpret(Thread* t)
} goto loop;
case instanceof: {
uint8_t index1 = codeBody(t, code, ip++);
uint8_t index2 = codeBody(t, code, ip++);
uint16_t index = codeReadInt16(t, code, ip);
if (peekObject(t, sp - 1)) {
uint16_t index = (index1 << 8) | index2;
object class_ = resolveClass(t, codePool(t, code), index - 1);
if (UNLIKELY(exception)) goto throw_;