more JIT fixes; all tests now pass on x86-32

This commit is contained in:
Joel Dice 2007-12-23 11:48:22 -07:00
parent a020a3f6bb
commit 15857135c0
4 changed files with 28 additions and 6 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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);

View File

@ -29,9 +29,9 @@ public class GC {
}
public static void main(String[] args) {
//small();
small();
medium();
//large();
large();
}
}