From 15857135c03833595836d11a1427c0bb09f9735d Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 23 Dec 2007 11:48:22 -0700 Subject: [PATCH] more JIT fixes; all tests now pass on x86-32 --- makefile | 2 +- src/compile.cpp | 2 +- src/compiler.cpp | 26 ++++++++++++++++++++++++-- test/GC.java | 4 ++-- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/makefile b/makefile index f911fe1c58..214888f396 100644 --- a/makefile +++ b/makefile @@ -28,7 +28,7 @@ src = src classpath = classpath test = test -input = $(test-build)/Reflection.class +input = $(test-build)/Threads.class build-cxx = g++ build-cc = gcc diff --git a/src/compile.cpp b/src/compile.cpp index 58dd513ad1..43f73e22f1 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 { diff --git a/src/compiler.cpp b/src/compiler.cpp index 1c0104dd7d..ecbed45b15 100644 --- a/src/compiler.cpp +++ b/src/compiler.cpp @@ -1540,6 +1540,16 @@ RegisterOperand::accept(Context* c, Operation operation, } } break; + case mul: { + if (operand->selection == DefaultSelection + or operand->selection == Select4) + { + encode2(c, 0x0faf, value(c), operand, operand->selection); + } else { + abort(c); + } + } break; + default: abort(c); } } @@ -1649,6 +1659,7 @@ AddressOperand::apply(Context* c, Operation operation) conditional(c, 0x8d, this); break; + case jl: conditional(c, 0x8c, this); break; @@ -1656,6 +1667,13 @@ AddressOperand::apply(Context* c, Operation operation) case jle: conditional(c, 0x8e, this); break; + + case push: { + RegisterOperand* tmp = temporary(c); + tmp->accept(c, mov, this); + tmp->apply(c, push); + tmp->release(c); + } break; default: abort(c); } @@ -1986,7 +2004,7 @@ MemoryOperand::accept(Context* c, Operation operation, } else { assert(c, operand->selection == Select8); - RegisterOperand* tmp = temporary(c); + RegisterOperand* tmp = temporary(c, rcx); RegisterOperand* ax = temporary(c, rax); RegisterOperand* dx = temporary(c, rdx); @@ -2003,7 +2021,11 @@ MemoryOperand::accept(Context* c, Operation operation, ax->accept(c, mul, lowSrc); tmp->accept(c, add, ax); ax->accept(c, mov, lowDst); - ax->accept(c, mul, lowSrc); + + // mul lowSrc,%eax + c->code.append(0xf7); + c->code.append(0xe8 | lowSrc->value(c)); + dx->accept(c, add, tmp); lowDst->accept(c, mov, ax); diff --git a/test/GC.java b/test/GC.java index 145a10b3e6..286e64f8b4 100644 --- a/test/GC.java +++ b/test/GC.java @@ -29,9 +29,9 @@ public class GC { } public static void main(String[] args) { - //small(); + small(); medium(); - //large(); + large(); } }