From c0cf15bb37b188ab217d87244ed912b001c4dc3f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 26 Dec 2007 12:19:45 -0700 Subject: [PATCH] add missing instructions and fix shift long instructions to pop an int instead of a long as the shift count --- src/compile.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/compile.cpp b/src/compile.cpp index add8438339..b7a612d2f5 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -18,7 +18,7 @@ vmJump(void* address, void* base, void* stack, void* thread); namespace { -const bool Verbose = true; +const bool Verbose = false; const bool DebugTraces = false; class MyThread: public Thread { @@ -2282,6 +2282,10 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip) c->release(a); } break; + case ineg: { + c->neg4(frame->topInt()); + } break; + case instanceof: { uint16_t index = codeReadInt16(t, code, ip); @@ -2477,6 +2481,12 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip) c->release(a); } break; + case land: { + Operand* a = frame->popLong(); + c->and8(a, frame->topLong()); + c->release(a); + } break; + case lcmp: { Operand* next = c->label(); Operand* less = c->label(); @@ -2669,13 +2679,13 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip) } return; case lshl: { - Operand* a = frame->popLong(); + Operand* a = frame->popInt(); c->shl8(a, frame->topLong()); c->release(a); } break; case lshr: { - Operand* a = frame->popLong(); + Operand* a = frame->popInt(); c->shr8(a, frame->topLong()); c->release(a); } break; @@ -2712,7 +2722,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip) } break; case lushr: { - Operand* a = frame->popLong(); + Operand* a = frame->popInt(); c->ushr8(a, frame->topLong()); c->release(a); } break; @@ -3062,6 +3072,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned ip) default: abort(t); } } break; + + default: abort(t); } } }