changeset 21485:b6ebdfc9f611

[SPARC] Use SPARCAddressValue in NullCheckOp
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Fri, 22 May 2015 11:29:13 +0200
parents 63cb65489159
children 95647f646143
files graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java
diffstat 3 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Fri May 22 10:53:28 2015 +0200
+++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java	Fri May 22 11:29:13 2015 +0200
@@ -1075,4 +1075,9 @@
         return result;
     }
 
+    public void emitNullCheck(Value address, LIRFrameState state) {
+        PlatformKind kind = address.getPlatformKind();
+        assert kind == Kind.Object || kind == Kind.Long : address + " - " + kind + " not an object!";
+        append(new NullCheckOp(asAddressValue(address), state));
+    }
 }
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Fri May 22 10:53:28 2015 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Fri May 22 11:29:13 2015 +0200
@@ -440,17 +440,15 @@
         return result;
     }
 
+    @Override
     public void emitNullCheck(Value address, LIRFrameState state) {
-        PlatformKind kind = address.getLIRKind().getPlatformKind();
-        if (address.getLIRKind().getPlatformKind() == Kind.Int) {
+        PlatformKind kind = address.getPlatformKind();
+        if (kind == Kind.Int) {
             CompressEncoding encoding = config.getOopEncoding();
-            Value uncompressed;
-            uncompressed = emitUncompress(address, encoding, false);
-
-            append(new NullCheckOp(load(uncompressed), state));
+            Value uncompressed = emitUncompress(address, encoding, false);
+            append(new NullCheckOp(asAddressValue(uncompressed), state));
         } else {
-            assert kind == Kind.Object || kind == Kind.Long : address + " - " + kind + " not an object!";
-            append(new NullCheckOp(load(address), state));
+            super.emitNullCheck(address, state);
         }
     }
 
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Fri May 22 10:53:28 2015 +0200
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Fri May 22 11:29:13 2015 +0200
@@ -421,10 +421,10 @@
     public static final class NullCheckOp extends SPARCLIRInstruction implements NullCheck, SPARCTailDelayedLIRInstruction {
         public static final LIRInstructionClass<NullCheckOp> TYPE = LIRInstructionClass.create(NullCheckOp.class);
 
-        @Use({REG}) protected AllocatableValue input;
+        @Use({COMPOSITE}) protected SPARCAddressValue input;
         @State protected LIRFrameState state;
 
-        public NullCheckOp(Variable input, LIRFrameState state) {
+        public NullCheckOp(SPARCAddressValue input, LIRFrameState state) {
             super(TYPE);
             this.input = input;
             this.state = state;
@@ -433,8 +433,9 @@
         @Override
         public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
             delayedControlTransfer.emitControlTransfer(crb, masm);
+            SPARCAddress addr = input.toAddress();
             crb.recordImplicitException(masm.position(), state);
-            masm.ldx(new SPARCAddress(asRegister(input), 0), g0);
+            masm.ldx(addr, g0);
         }
 
         public Value getCheckedValue() {