changeset 5635:e1b2b2de608d

Fixed an issue in the new instance stub call operation: rax must be reserved as a temp as it is overwritten in the runtime stub.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 17 Jun 2012 18:04:59 +0200
parents e0aa35b489f3
children 9bf0810f5c6c
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/AMD64NewInstanceStubCallOp.java
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Sat Jun 16 16:53:02 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Sun Jun 17 18:04:59 2012 +0200
@@ -48,9 +48,9 @@
     @Override
     public void generate(LIRGenerator gen) {
         Variable result = gen.newVariable(Kind.Object);
-        gen.emitMove(gen.operand(hub), AMD64.rdx.asValue());
+        gen.emitMove(gen.operand(hub), AMD64.rdx.asValue(Kind.Object));
         LIRDebugInfo info = gen.state();
-        AMD64NewInstanceStubCallOp op = new AMD64NewInstanceStubCallOp(result, AMD64.rdx.asValue(), info);
+        AMD64NewInstanceStubCallOp op = new AMD64NewInstanceStubCallOp(result, AMD64.rdx.asValue(Kind.Object), info);
         gen.append(op);
         gen.setResult(this, result);
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/AMD64NewInstanceStubCallOp.java	Sat Jun 16 16:53:02 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/AMD64NewInstanceStubCallOp.java	Sun Jun 17 18:04:59 2012 +0200
@@ -40,7 +40,7 @@
  */
 public class AMD64NewInstanceStubCallOp extends AMD64LIRInstruction {
     public AMD64NewInstanceStubCallOp(Value result, Value hub, LIRDebugInfo info) {
-        super("NEW_INSTANCE", new Value[] {result}, info, new Value[] {hub}, NO_OPERANDS, NO_OPERANDS);
+        super("NEW_INSTANCE", new Value[] {result}, info, new Value[] {hub}, NO_OPERANDS, new Value[]{AMD64.rax.asValue(Kind.Object)});
     }
 
     @Override
@@ -63,6 +63,8 @@
             return EnumSet.of(OperandFlag.Register);
         } else if (mode == OperandMode.Output) {
             return EnumSet.of(OperandFlag.Register);
+        } else if (mode == OperandMode.Temp) {
+            return EnumSet.of(OperandFlag.Register);
         }
         throw GraalInternalError.shouldNotReachHere();
     }