fix thinko in getstatic

This commit is contained in:
Joel Dice 2007-10-17 20:50:43 -06:00
parent 02c1939de5
commit 64acabf130

View File

@ -19,7 +19,7 @@ vmJump(void* address, void* base, void* stack);
namespace { namespace {
const bool Verbose = true; const bool Verbose = false;
const unsigned FrameThread = BytesPerWord * 2; const unsigned FrameThread = BytesPerWord * 2;
const unsigned FrameMethod = FrameThread + BytesPerWord; const unsigned FrameMethod = FrameThread + BytesPerWord;
@ -3281,9 +3281,9 @@ class JavaCompiler: public Compiler {
if (UNLIKELY(t->exception)) return 0; if (UNLIKELY(t->exception)) return 0;
object table = classStaticTable(t, fieldClass(t, field)); object table = classStaticTable(t, fieldClass(t, field));
unsigned offset = (fieldOffset(t, field) * BytesPerWord) + ArrayBody;
mov(poolRegister(), poolReference(table), rax); mov(poolRegister(), poolReference(table), rax);
add((fieldOffset(t, field) * BytesPerWord) + ArrayBody, rax);
switch (fieldCode(t, field)) { switch (fieldCode(t, field)) {
case ByteField: case ByteField:
@ -3295,6 +3295,7 @@ class JavaCompiler: public Compiler {
Label zero(this); Label zero(this);
Label next(this); Label next(this);
mov(rax, offset, rax);
cmp(0, rax); cmp(0, rax);
je(zero); je(zero);
@ -3313,6 +3314,7 @@ class JavaCompiler: public Compiler {
Label zero(this); Label zero(this);
Label next(this); Label next(this);
mov(rax, offset, rax);
cmp(0, rax); cmp(0, rax);
je(zero); je(zero);
@ -3332,7 +3334,7 @@ class JavaCompiler: public Compiler {
} break; } break;
case ObjectField: { case ObjectField: {
pushObject(rax, 0); pushObject(rax, offset);
} break; } break;
default: abort(t); default: abort(t);