# HG changeset patch # User Stefan Anzinger # Date 1430925244 -7200 # Node ID 0927730ed87fbaf1c149d7e3da2f986ac1f666ca # Parent ccddbb1409d2d224a103ddb173a0ea3167029610# Parent bd6f19542e08155194eee4ea2a5bb4880777185f Merge diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java --- a/graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java Wed May 06 11:08:36 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java Wed May 06 17:14:04 2015 +0200 @@ -58,7 +58,7 @@ @Test public void test3() { - testAllocation("test3snippet", 3, 1, 0); + testAllocation("test3snippet", 3, 0, 0); } public static long test3snippet(long x) { diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java Wed May 06 11:08:36 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java Wed May 06 17:14:04 2015 +0200 @@ -51,6 +51,7 @@ public static class TestClassInt { public int x; public int y; + public int z; public TestClassInt() { this(0, 0); @@ -68,7 +69,7 @@ @Override public boolean equals(Object obj) { TestClassInt other = (TestClassInt) obj; - return x == other.x && y == other.y; + return x == other.x && y == other.y && z == other.z; } @Override diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java Wed May 06 11:08:36 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java Wed May 06 17:14:04 2015 +0200 @@ -36,15 +36,23 @@ public static int zero = 0; private static final Unsafe unsafe; - private static final long fieldOffsetX; - private static final long fieldOffsetY; + private static final long fieldOffset1; + private static final long fieldOffset2; static { unsafe = UnsafeAccess.unsafe; try { - fieldOffsetX = unsafe.objectFieldOffset(TestClassInt.class.getField("x")); - fieldOffsetY = unsafe.objectFieldOffset(TestClassInt.class.getField("y")); - assert fieldOffsetY == fieldOffsetX + 4; + long localFieldOffset1 = unsafe.objectFieldOffset(TestClassInt.class.getField("x")); + // Make the fields 8 byte aligned (Required for testing setLong on Architectures which + // does not support unaligned memory access + if (localFieldOffset1 % 8 == 0) { + fieldOffset1 = localFieldOffset1; + fieldOffset2 = unsafe.objectFieldOffset(TestClassInt.class.getField("y")); + } else { + fieldOffset1 = unsafe.objectFieldOffset(TestClassInt.class.getField("y")); + fieldOffset2 = unsafe.objectFieldOffset(TestClassInt.class.getField("z")); + } + assert fieldOffset2 == fieldOffset1 + 4; } catch (Exception e) { throw new RuntimeException(e); } @@ -57,8 +65,8 @@ public static int testSimpleIntSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putInt(x, fieldOffsetX, 101); - return unsafe.getInt(x, fieldOffsetX); + unsafe.putInt(x, fieldOffset1, 101); + return unsafe.getInt(x, fieldOffset1); } @Test @@ -68,7 +76,7 @@ public static TestClassInt testMaterializedIntSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putInt(x, fieldOffsetX, 101); + unsafe.putInt(x, fieldOffset1, 101); return x; } @@ -79,8 +87,8 @@ public static double testSimpleDoubleSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putDouble(x, fieldOffsetX, 10.1); - return unsafe.getDouble(x, fieldOffsetX); + unsafe.putDouble(x, fieldOffset1, 10.1); + return unsafe.getDouble(x, fieldOffset1); } @Test @@ -97,12 +105,12 @@ TestClassInt x; if (a) { x = new TestClassInt(0, 0); - unsafe.putDouble(x, fieldOffsetX, doubleField); + unsafe.putDouble(x, fieldOffset1, doubleField); } else { x = new TestClassInt(); - unsafe.putDouble(x, fieldOffsetX, doubleField2); + unsafe.putDouble(x, fieldOffset1, doubleField2); } - return unsafe.getDouble(x, fieldOffsetX); + return unsafe.getDouble(x, fieldOffset1); } @Test @@ -112,7 +120,7 @@ public static TestClassInt testMaterializedDoubleSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putDouble(x, fieldOffsetX, 10.1); + unsafe.putDouble(x, fieldOffset1, 10.1); return x; } @@ -126,10 +134,10 @@ public static TestClassInt testDeoptDoubleVarSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putDouble(x, fieldOffsetX, doubleField); + unsafe.putDouble(x, fieldOffset1, doubleField); doubleField2 = 123; try { - doubleField = ((int) unsafe.getDouble(x, fieldOffsetX)) / zero; + doubleField = ((int) unsafe.getDouble(x, fieldOffset1)) / zero; } catch (RuntimeException e) { return x; } @@ -143,10 +151,10 @@ public static TestClassInt testDeoptDoubleConstantSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putDouble(x, fieldOffsetX, 10.123); + unsafe.putDouble(x, fieldOffset1, 10.123); doubleField2 = 123; try { - doubleField = ((int) unsafe.getDouble(x, fieldOffsetX)) / zero; + doubleField = ((int) unsafe.getDouble(x, fieldOffset1)) / zero; } catch (RuntimeException e) { return x; } @@ -163,10 +171,10 @@ public static TestClassInt testDeoptLongVarSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putLong(x, fieldOffsetX, longField); + unsafe.putLong(x, fieldOffset1, longField); longField2 = 123; try { - longField = unsafe.getLong(x, fieldOffsetX) / zero; + longField = unsafe.getLong(x, fieldOffset1) / zero; } catch (RuntimeException e) { return x; } @@ -180,10 +188,10 @@ public static TestClassInt testDeoptLongConstantSnippet() { TestClassInt x = new TestClassInt(); - unsafe.putLong(x, fieldOffsetX, 0x2222222210123L); + unsafe.putLong(x, fieldOffset1, 0x2222222210123L); longField2 = 123; try { - longField = unsafe.getLong(x, fieldOffsetX) / zero; + longField = unsafe.getLong(x, fieldOffset1) / zero; } catch (RuntimeException e) { return x; } diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Wed May 06 11:08:36 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Wed May 06 17:14:04 2015 +0200 @@ -49,6 +49,7 @@ import com.oracle.graal.lir.sparc.SPARCMove.NullCheckOp; import com.oracle.graal.lir.sparc.SPARCMove.StoreConstantOp; import com.oracle.graal.lir.sparc.SPARCMove.StoreOp; +import com.oracle.graal.sparc.*; public class SPARCHotSpotLIRGenerator extends SPARCLIRGenerator implements HotSpotLIRGenerator { @@ -214,6 +215,17 @@ } @Override + public boolean canInlineConstant(JavaConstant c) { + if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(c)) { + return true; + } else if (c instanceof HotSpotObjectConstant) { + return ((HotSpotObjectConstant) c).isCompressed(); + } else { + return super.canInlineConstant(c); + } + } + + @Override public void emitStore(LIRKind kind, Value address, Value inputVal, LIRFrameState state) { SPARCAddressValue storeAddress = asAddressValue(address); if (isConstant(inputVal)) { @@ -243,15 +255,85 @@ } @Override + protected SPARCLIRInstruction createMove(AllocatableValue dst, Value src) { + if (src instanceof JavaConstant) { + return new SPARCHotSpotMove.HotSpotLoadConstantOp(dst, (JavaConstant) src); + } else { + return super.createMove(dst, src); + } + } + + @Override + public void emitCompareBranch(PlatformKind cmpKind, Value x, Value y, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination, + double trueDestinationProbability) { + Value localX = x; + Value localY = y; + if (localX instanceof HotSpotObjectConstant) { + localX = load(localX); + } + if (localY instanceof HotSpotObjectConstant) { + localY = load(localY); + } + super.emitCompareBranch(cmpKind, localX, localY, cond, unorderedIsTrue, trueDestination, falseDestination, trueDestinationProbability); + } + + @Override + protected boolean emitCompare(PlatformKind cmpKind, Value a, Value b) { + Value localA = a; + Value localB = b; + if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(localA)) { + localA = SPARC.g0.asValue(LIRKind.value(Kind.Int)); + } else if (localA instanceof HotSpotObjectConstant) { + localA = load(localA); + } + if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(localB)) { + localB = SPARC.g0.asValue(LIRKind.value(Kind.Int)); + } else if (localB instanceof HotSpotObjectConstant) { + localB = load(localB); + } + return super.emitCompare(cmpKind, localA, localB); + } + + @Override public Value emitCompress(Value pointer, CompressEncoding encoding, boolean nonNull) { - // TODO - throw GraalInternalError.unimplemented(); + LIRKind inputKind = pointer.getLIRKind(); + assert inputKind.getPlatformKind() == Kind.Long || inputKind.getPlatformKind() == Kind.Object; + if (inputKind.isReference(0)) { + // oop + Variable result = newVariable(LIRKind.reference(Kind.Int)); + append(new SPARCHotSpotMove.CompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull)); + return result; + } else { + // metaspace pointer + Variable result = newVariable(LIRKind.value(Kind.Int)); + AllocatableValue base = Value.ILLEGAL; + if (encoding.base != 0) { + base = emitMove(JavaConstant.forLong(encoding.base)); + } + append(new SPARCHotSpotMove.CompressPointer(result, asAllocatable(pointer), base, encoding, nonNull)); + return result; + } } @Override public Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull) { - // TODO - throw GraalInternalError.unimplemented(); + LIRKind inputKind = pointer.getLIRKind(); + assert inputKind.getPlatformKind() == Kind.Int; + if (inputKind.isReference(0)) { + // oop + Variable result = newVariable(LIRKind.reference(Kind.Object)); + append(new SPARCHotSpotMove.UncompressPointer(result, asAllocatable(pointer), getProviders().getRegisters().getHeapBaseRegister().asValue(), encoding, nonNull)); + return result; + } else { + // metaspace pointer + Variable result = newVariable(LIRKind.value(Kind.Long)); + AllocatableValue base = Value.ILLEGAL; + if (encoding.base != 0) { + base = emitMove(JavaConstant.forLong(encoding.base)); + } + append(new SPARCHotSpotMove.UncompressPointer(result, asAllocatable(pointer), base, encoding, nonNull)); + return result; + } } /** @@ -360,8 +442,16 @@ public void emitNullCheck(Value address, LIRFrameState state) { PlatformKind kind = address.getLIRKind().getPlatformKind(); - assert kind == Kind.Object || kind == Kind.Long : address + " - " + kind + " not an object!"; - append(new NullCheckOp(load(address), state)); + if (address.getLIRKind().getPlatformKind() == Kind.Int) { + CompressEncoding encoding = config.getOopEncoding(); + Value uncompressed; + uncompressed = emitUncompress(address, encoding, false); + + append(new NullCheckOp(load(uncompressed), state)); + } else { + assert kind == Kind.Object || kind == Kind.Long : address + " - " + kind + " not an object!"; + append(new NullCheckOp(load(address), state)); + } } @Override diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Wed May 06 17:14:04 2015 +0200 @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.graal.hotspot.sparc; + +import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; + +import com.oracle.graal.api.code.*; +import com.oracle.graal.api.meta.*; +import com.oracle.graal.asm.*; +import com.oracle.graal.asm.sparc.SPARCAssembler.Annul; +import com.oracle.graal.asm.sparc.SPARCAssembler.BranchPredict; +import com.oracle.graal.asm.sparc.SPARCAssembler.CC; +import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; +import com.oracle.graal.asm.sparc.SPARCAssembler.RCondition; +import com.oracle.graal.asm.sparc.*; +import com.oracle.graal.compiler.common.*; +import com.oracle.graal.hotspot.HotSpotVMConfig.CompressEncoding; +import com.oracle.graal.hotspot.meta.*; +import com.oracle.graal.lir.*; +import com.oracle.graal.lir.StandardOp.MoveOp; +import com.oracle.graal.lir.asm.*; +import com.oracle.graal.lir.sparc.*; + +public class SPARCHotSpotMove { + + public static final class HotSpotLoadConstantOp extends SPARCLIRInstruction implements MoveOp { + public static final LIRInstructionClass TYPE = LIRInstructionClass.create(HotSpotLoadConstantOp.class); + + @Def({REG}) private AllocatableValue result; + private final JavaConstant input; + + public HotSpotLoadConstantOp(AllocatableValue result, JavaConstant input) { + super(TYPE); + this.result = result; + this.input = input; + } + + @Override + public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { + assert isRegister(result); + if (HotSpotCompressedNullConstant.COMPRESSED_NULL.equals(input)) { + masm.mov(0, asRegister(result)); + } else if (input instanceof HotSpotObjectConstant) { + boolean compressed = ((HotSpotObjectConstant) input).isCompressed(); + if (crb.target.inlineObjects) { + crb.recordInlineDataInCode(input); + if (compressed) { + masm.sethi(0xDEADDEAD >>> 10, asRegister(result)); + masm.add(asRegister(result), 0xAD & 0x3F, asRegister(result)); + } else { + new SPARCMacroAssembler.Setx(0xDEADDEADDEADDEADL, asRegister(result), true).emit(masm); + } + } else { + GraalInternalError.unimplemented(); + } + } else if (input instanceof HotSpotMetaspaceConstant) { + assert input.getKind() == Kind.Int || input.getKind() == Kind.Long; + boolean compressed = input.getKind() == Kind.Int; + boolean isImmutable = GraalOptions.ImmutableCode.getValue(); + boolean generatePIC = GraalOptions.GeneratePIC.getValue(); + crb.recordInlineDataInCode(input); + if (compressed) { + if (isImmutable && generatePIC) { + GraalInternalError.unimplemented(); + } else { + new SPARCMacroAssembler.Setx(input.asInt(), asRegister(result), true).emit(masm); + } + } else { + if (isImmutable && generatePIC) { + GraalInternalError.unimplemented(); + } else { + new SPARCMacroAssembler.Setx(input.asLong(), asRegister(result), true).emit(masm); + } + } + } else { + SPARCMove.move(crb, masm, result, input, SPARCDelayedControlTransfer.DUMMY); + } + } + + public Value getInput() { + return input; + } + + public AllocatableValue getResult() { + return result; + } + } + + public static final class CompressPointer extends SPARCLIRInstruction { + public static final LIRInstructionClass TYPE = LIRInstructionClass.create(CompressPointer.class); + + private final CompressEncoding encoding; + private final boolean nonNull; + + @Def({REG}) protected AllocatableValue result; + @Use({REG}) protected AllocatableValue input; + @Alive({REG, ILLEGAL}) protected AllocatableValue baseRegister; + + public CompressPointer(AllocatableValue result, AllocatableValue input, AllocatableValue baseRegister, CompressEncoding encoding, boolean nonNull) { + super(TYPE); + this.result = result; + this.input = input; + this.baseRegister = baseRegister; + this.encoding = encoding; + this.nonNull = nonNull; + } + + @Override + public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { + SPARCMove.move(crb, masm, result, input, SPARCDelayedControlTransfer.DUMMY); + + Register resReg = asRegister(result); + if (encoding.base != 0) { + Register baseReg = asRegister(baseRegister); + if (!nonNull) { + masm.cmp(resReg, baseReg); + masm.movcc(ConditionFlag.Equal, CC.Xcc, baseReg, resReg); + } + masm.sub(resReg, baseReg, resReg); + } + + if (encoding.shift != 0) { + masm.srlx(resReg, encoding.shift, resReg); + } + } + } + + public static final class UncompressPointer extends SPARCLIRInstruction { + public static final LIRInstructionClass TYPE = LIRInstructionClass.create(UncompressPointer.class); + + private final CompressEncoding encoding; + private final boolean nonNull; + + @Def({REG}) protected AllocatableValue result; + @Use({REG}) protected AllocatableValue input; + @Alive({REG, ILLEGAL}) protected AllocatableValue baseRegister; + + public UncompressPointer(AllocatableValue result, AllocatableValue input, AllocatableValue baseRegister, CompressEncoding encoding, boolean nonNull) { + super(TYPE); + this.result = result; + this.input = input; + this.baseRegister = baseRegister; + this.encoding = encoding; + this.nonNull = nonNull; + } + + @Override + public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { + SPARCMove.move(crb, masm, result, input, SPARCDelayedControlTransfer.DUMMY); + + Register resReg = asRegister(result); + if (encoding.shift != 0) { + masm.sllx(resReg, 32, resReg); + masm.srlx(resReg, 32 - encoding.shift, resReg); + } + + if (encoding.base != 0) { + if (nonNull) { + masm.add(resReg, asRegister(baseRegister), resReg); + } else { + masm.cmp(resReg, resReg); + + Label done = new Label(); + masm.bpr(RCondition.Rc_nz, Annul.ANNUL, done, BranchPredict.PREDICT_TAKEN, resReg); + masm.add(asRegister(baseRegister), resReg, resReg); + masm.bind(done); + } + } + } + } + +} diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java Wed May 06 11:08:36 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java Wed May 06 17:14:04 2015 +0200 @@ -115,13 +115,23 @@ } } + private static class LookupTypeCacheElement { + int lastCpi = Integer.MIN_VALUE; + JavaType javaType; + + public LookupTypeCacheElement(int lastCpi, JavaType javaType) { + super(); + this.lastCpi = lastCpi; + this.javaType = javaType; + } + } + /** * Reference to the C++ ConstantPool object. */ private final long metaspaceConstantPool; private final Object[] cache; - private ResolvedJavaType lastType; - private int lastTypeCpi = Integer.MIN_VALUE; + private volatile LookupTypeCacheElement lastLookupType; public HotSpotConstantPool(long metaspaceConstantPool) { this.metaspaceConstantPool = metaspaceConstantPool; @@ -489,22 +499,15 @@ @Override public JavaType lookupType(int cpi, int opcode) { - if (cpi == this.lastTypeCpi) { - synchronized (this) { - if (cpi == this.lastTypeCpi) { - return this.lastType; - } - } + final LookupTypeCacheElement elem = this.lastLookupType; + if (elem != null && elem.lastCpi == cpi) { + return elem.javaType; + } else { + final long metaspacePointer = runtime().getCompilerToVM().lookupKlassInPool(metaspaceConstantPool, cpi); + JavaType result = getJavaType(metaspacePointer); + this.lastLookupType = new LookupTypeCacheElement(cpi, result); + return result; } - final long metaspacePointer = runtime().getCompilerToVM().lookupKlassInPool(metaspaceConstantPool, cpi); - JavaType result = getJavaType(metaspacePointer); - if (result instanceof ResolvedJavaType) { - synchronized (this) { - this.lastType = (ResolvedJavaType) result; - this.lastTypeCpi = cpi; - } - } - return result; } @Override diff -r bd6f19542e08 -r 0927730ed87f graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Wed May 06 11:08:36 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Wed May 06 17:14:04 2015 +0200 @@ -66,7 +66,7 @@ public static final LIRInstructionClass TYPE = LIRInstructionClass.create(Unary2Op.class); @Opcode private final SPARCArithmetic opcode; - @Def({REG, HINT}) protected AllocatableValue result; + @Def({REG}) protected AllocatableValue result; @Use({REG}) protected AllocatableValue x; public Unary2Op(SPARCArithmetic opcode, AllocatableValue result, AllocatableValue x) { @@ -90,7 +90,7 @@ public static final LIRInstructionClass TYPE = LIRInstructionClass.create(BinaryRegReg.class); @Opcode private final SPARCArithmetic opcode; - @Def({REG, HINT}) protected Value result; + @Def({REG}) protected Value result; @Use({REG}) protected Value x; @Alive({REG}) protected Value y; @State LIRFrameState state; @@ -127,7 +127,7 @@ public static final LIRInstructionClass TYPE = LIRInstructionClass.create(BinaryRegConst.class); @Opcode private final SPARCArithmetic opcode; - @Def({REG, HINT}) protected AllocatableValue result; + @Def({REG}) protected AllocatableValue result; @Use({REG}) protected Value x; @State protected LIRFrameState state; protected JavaConstant y; diff -r bd6f19542e08 -r 0927730ed87f src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp --- a/src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp Wed May 06 11:08:36 2015 +0200 +++ b/src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp Wed May 06 17:14:04 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,13 @@ Handle obj = HotSpotObjectConstantImpl::object(constant); jobject value = JNIHandles::make_local(obj()); if (HotSpotObjectConstantImpl::compressed(constant)) { - fatal("unimplemented: narrow oop relocation"); +#ifdef _LP64 + int oop_index = _oop_recorder->find_index(value); + RelocationHolder rspec = oop_Relocation::spec(oop_index); + _instructions->relocate(pc, rspec, 1); +#else + fatal("compressed oop on 32bit"); +#endif } else { NativeMovConstReg* move = nativeMovConstReg_at(pc); move->set_data((intptr_t) value); diff -r bd6f19542e08 -r 0927730ed87f src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Wed May 06 11:08:36 2015 +0200 +++ b/src/share/vm/runtime/arguments.cpp Wed May 06 17:14:04 2015 +0200 @@ -1502,9 +1502,9 @@ // to use UseCompressedOops is InitialHeapSize. size_t max_heap_size = MAX2(MaxHeapSize, InitialHeapSize); // Set default on graal with sparc to not use compressed oops as long they are not implemented -#if defined(GRAAL) && defined(TARGET_ARCH_sparc) +/*#if defined(GRAAL) && defined(TARGET_ARCH_sparc) FLAG_SET_DEFAULT(UseCompressedOops, false); -#else // if !(GRAAL && SOLARIS) +#else // if !(GRAAL && SOLARIS)*/ if (max_heap_size <= max_heap_for_compressed_oops()) { #if !defined(COMPILER1) || defined(TIERED) if (FLAG_IS_DEFAULT(UseCompressedOops)) { @@ -1529,7 +1529,7 @@ } #endif // _LP64 #endif // ZERO -#endif // !(GRAAL && SOLARIS) +//#endif // !(GRAAL && SOLARIS) }