fix x86-32 regressions due to JIT refactoring

This commit is contained in:
Joel Dice 2007-12-26 10:16:21 -07:00
parent b361e1b637
commit 6ed28a13c3
2 changed files with 37 additions and 6 deletions

View File

@ -28,7 +28,7 @@ src = src
classpath = classpath classpath = classpath
test = test test = test
input = $(test-build)/Reflection.class input = $(test-build)/Threads.class
build-cxx = g++ build-cxx = g++
build-cc = gcc build-cc = gcc

View File

@ -907,6 +907,7 @@ class ArgumentEvent: public Event {
for (int i = count - 1; i >= 0; --i) { for (int i = count - 1; i >= 0; --i) {
if (i > 0 and arguments[i - 1] == 0) { if (i > 0 and arguments[i - 1] == 0) {
arguments[i]->apply(c, MyOperand::push8); arguments[i]->apply(c, MyOperand::push8);
-- i;
} else { } else {
arguments[i]->apply(c, MyOperand::push4); arguments[i]->apply(c, MyOperand::push4);
} }
@ -1181,6 +1182,15 @@ RegisterOperand::apply(Context* c, Operation operation)
} }
break; break;
case neg4:
case neg8:
assert(c, BytesPerWord == 8 or operation == neg4); // todo
rex(c);
c->code.append(0xf7);
c->code.append(0xd8 | value(c));
break;
default: abort(c); default: abort(c);
} }
} }
@ -1456,6 +1466,13 @@ RegisterOperand::accept(Context* c, Operation operation,
encode(c, 0x63, value(c), operand, true); encode(c, 0x63, value(c), operand, true);
break; break;
case mul4:
case mul8:
assert(c, BytesPerWord == 8 or operation == mul4); // todo
encode2(c, 0x0faf, value(c), operand, true);
break;
default: abort(c); default: abort(c);
} }
} }
@ -2090,13 +2107,27 @@ MemoryOperand::accept(Context* c, Operation operation,
switch (operation) { switch (operation) {
case mov1ToW: case mov1ToW:
case mov2ToW: case mov2ToW:
case mov2zToW: { case mov2zToW:
RegisterOperand* tmp = temporary(c); case mov4To8: {
tmp->accept(c, operation, operand); if (BytesPerWord == 4 and operation == mov4To8) {
accept(c, mov, tmp); RegisterOperand* ax = temporary(c, rax);
tmp->release(c); RegisterOperand* dx = temporary(c, rdx);
ax->accept(c, mov4, operand);
c->code.append(0x99); // cdq
accept(c, mov8, register_(c, rax, rdx));
ax->release(c);
dx->release(c);
} else {
RegisterOperand* tmp = temporary(c);
tmp->accept(c, operation, operand);
accept(c, mov, tmp);
tmp->release(c);
}
} break; } break;
case mov4:
case mov8: case mov8:
case and4: { case and4: {
RegisterOperand* tmp = temporary(c); RegisterOperand* tmp = temporary(c);