Mercurial > hg > graal-compiler
changeset 22415:13080797bccb
[SPARC] Create mixin for SPARC LIR instructions and inherit SPARCBlockEndOp from AbstractBlockEndOp
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Mon Aug 10 13:53:55 2015 +0200 @@ -117,7 +117,7 @@ } } - protected SPARCLIRInstruction createMove(AllocatableValue dst, Value src) { + protected LIRInstruction createMove(AllocatableValue dst, Value src) { boolean srcIsSlot = isStackSlotValue(src); boolean dstIsSlot = isStackSlotValue(dst); if (src instanceof SPARCAddressValue) {
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Mon Aug 10 13:53:55 2015 +0200 @@ -37,7 +37,6 @@ import jdk.internal.jvmci.code.*; import jdk.internal.jvmci.code.DataSection.Data; -import com.oracle.graal.debug.*; import jdk.internal.jvmci.hotspot.*; import jdk.internal.jvmci.meta.*; @@ -47,6 +46,7 @@ import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; +import com.oracle.graal.debug.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; @@ -56,7 +56,7 @@ import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.sparc.*; -import com.oracle.graal.lir.sparc.SPARCLIRInstruction.SizeEstimate; +import com.oracle.graal.lir.sparc.SPARCLIRInstructionMixin.SizeEstimate; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; @@ -252,8 +252,8 @@ assert after.equals(op) : "Instructions before/after don't match " + op + "/" + after; int constantSizeAfter = calculateDataSectionSize(crb.compilationResult.getDataSection()); int actual = constantSizeAfter - constantSizeBefore; - if (op instanceof SPARCLIRInstruction) { - SizeEstimate size = ((SPARCLIRInstruction) op).estimateSize(); + if (op instanceof SPARCLIRInstructionMixin) { + com.oracle.graal.lir.sparc.SPARCLIRInstructionMixin.SizeEstimate size = ((SPARCLIRInstructionMixin) op).estimateSize(); assert size != null : "No size prediction available for op: " + op; Class<?> c = op.getClass(); CONSTANT_ESTIMATED_STATS.add(c, size.constantSize); @@ -356,8 +356,8 @@ int size = 0; for (AbstractBlockBase<?> block : lir.codeEmittingOrder()) { for (LIRInstruction inst : lir.getLIRforBlock(block)) { - if (inst instanceof SPARCLIRInstruction) { - SizeEstimate pred = ((SPARCLIRInstruction) inst).estimateSize(); + if (inst instanceof SPARCLIRInstructionMixin) { + SizeEstimate pred = ((SPARCLIRInstructionMixin) inst).estimateSize(); if (pred != null) { size += pred.constantSize; } @@ -414,7 +414,7 @@ boolean overlap = acc.add(inst); if (!overlap && inst instanceof SPARCTailDelayedLIRInstruction) { // We have found a non overlapping LIR instruction which can be delayed - ((SPARCTailDelayedLIRInstruction) inst).setDelayedControlTransfer(delayedTransfer); + ((SPARCLIRInstructionMixin) inst).setDelayedControlTransfer(delayedTransfer); delayedTransfer = null; } } @@ -423,7 +423,7 @@ } private static boolean leavesRegisterWindow(LIRInstruction inst) { - return inst instanceof SPARCLIRInstruction && ((SPARCLIRInstruction) inst).leavesRegisterWindow(); + return inst instanceof SPARCLIRInstructionMixin && ((SPARCLIRInstructionMixin) inst).leavesRegisterWindow(); } /**
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java Mon Aug 10 13:53:55 2015 +0200 @@ -61,6 +61,6 @@ masm.stx(scratchRegister, new SPARCAddress(thread, threadLastJavaSpOffset)); // Save the thread register when calling out to the runtime. - SPARCMove.move(crb, masm, threadTemp, thread.asValue(LIRKind.value(Kind.Long)), delayedControlTransfer); + SPARCMove.move(crb, masm, threadTemp, thread.asValue(LIRKind.value(Kind.Long)), getDelayedControlTransfer()); } }
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Mon Aug 10 13:53:55 2015 +0200 @@ -254,7 +254,7 @@ } @Override - protected SPARCLIRInstruction createMove(AllocatableValue dst, Value src) { + protected LIRInstruction createMove(AllocatableValue dst, Value src) { Value usedSource; if (COMPRESSED_NULL.equals(src)) { usedSource = INT_0;
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Mon Aug 10 13:53:55 2015 +0200 @@ -80,7 +80,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - emitUnary(crb, masm, opcode, result, x, null, delayedControlTransfer); + emitUnary(crb, masm, opcode, result, x, null, getDelayedControlTransfer()); } @Override @@ -128,7 +128,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - emitRegReg(crb, masm, opcode, result, x, y, state, delayedControlTransfer); + emitRegReg(crb, masm, opcode, result, x, y, state, getDelayedControlTransfer()); } @Override @@ -179,7 +179,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - emitRegConstant(crb, masm, opcode, result, x, y, null, delayedControlTransfer); + emitRegConstant(crb, masm, opcode, result, x, y, null, getDelayedControlTransfer()); } @Override @@ -217,7 +217,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - emitRem(crb, masm, opcode, result, x, y, scratch1, scratch2, state, delayedControlTransfer); + emitRem(crb, masm, opcode, result, x, y, scratch1, scratch2, state, getDelayedControlTransfer()); } @Override
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBlockEndOp.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBlockEndOp.java Mon Aug 10 13:53:55 2015 +0200 @@ -22,65 +22,32 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; - +import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.StandardOp.*; +import com.oracle.graal.lir.StandardOp.AbstractBlockEndOp; +import com.oracle.graal.lir.asm.*; -import jdk.internal.jvmci.meta.*; - -public abstract class SPARCBlockEndOp extends SPARCLIRInstruction implements BlockEndOp { +public abstract class SPARCBlockEndOp extends AbstractBlockEndOp implements SPARCLIRInstructionMixin { public static final LIRInstructionClass<SPARCBlockEndOp> TYPE = LIRInstructionClass.create(SPARCBlockEndOp.class); - - @Alive({REG, STACK, CONST}) private Value[] outgoingValues; - private int size; + private final SPARCLIRInstructionMixinStore store; protected SPARCBlockEndOp(LIRInstructionClass<? extends SPARCBlockEndOp> c) { this(c, null); } protected SPARCBlockEndOp(LIRInstructionClass<? extends SPARCBlockEndOp> c, SizeEstimate sizeEstimate) { - super(c, sizeEstimate); - this.outgoingValues = Value.NO_VALUES; - this.size = 0; + super(c); + store = new SPARCLIRInstructionMixinStore(sizeEstimate); } - public void setOutgoingValues(Value[] values) { - assert outgoingValues.length == 0; - assert values != null; - outgoingValues = values; - size = values.length; - } - - public int getOutgoingSize() { - return size; - } - - public Value getOutgoingValue(int idx) { - assert checkRange(idx); - return outgoingValues[idx]; + public SPARCLIRInstructionMixinStore getSPARCLIRInstructionStore() { + return store; } - private boolean checkRange(int idx) { - return idx < size; - } - - public void clearOutgoingValues() { - outgoingValues = Value.NO_VALUES; - size = 0; + @Override + public void emitCode(CompilationResultBuilder crb) { + emitCode(crb, (SPARCMacroAssembler) crb.asm); } - public int addOutgoingValues(Value[] v) { - - int t = size + v.length; - if (t >= outgoingValues.length) { - Value[] newArray = new Value[t]; - System.arraycopy(outgoingValues, 0, newArray, 0, size); - outgoingValues = newArray; - } - System.arraycopy(v, 0, outgoingValues, size, v.length); - size = t; - return t; - - } + protected abstract void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm); }
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java Mon Aug 10 13:53:55 2015 +0200 @@ -60,7 +60,7 @@ new SPARCMacroAssembler.Setx(addr.getDisplacement(), tempReg, false).emit(masm); addr = new SPARCAddress(addr.getBase(), tempReg); } - delayedControlTransfer.emitControlTransfer(crb, masm); + getDelayedControlTransfer().emitControlTransfer(crb, masm); switch (input.getKind()) { case Int: masm.lduwa(addr.getBase(), addr.getIndex(), asIntReg(result), Asi.ASI_PRIMARY_LITTLE);
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCJumpOp.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCJumpOp.java Mon Aug 10 13:53:55 2015 +0200 @@ -24,22 +24,23 @@ import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; +import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; import com.oracle.graal.asm.sparc.*; -import com.oracle.graal.asm.sparc.SPARCAssembler.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.JumpOp; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.lir.sparc.SPARCLIRInstruction.*; -public final class SPARCJumpOp extends JumpOp implements SPARCDelayedControlTransfer { +public final class SPARCJumpOp extends JumpOp implements SPARCDelayedControlTransfer, SPARCLIRInstructionMixin { public static final LIRInstructionClass<SPARCJumpOp> TYPE = LIRInstructionClass.create(SPARCJumpOp.class); public static final SizeEstimate SIZE = SizeEstimate.create(2); private boolean emitDone = false; private int delaySlotPosition = -1; + private final SPARCLIRInstructionMixinStore store; public SPARCJumpOp(LabelRef destination) { super(TYPE, destination); + this.store = new SPARCLIRInstructionMixinStore(SIZE); } public void emitControlTransfer(CompilationResultBuilder crb, SPARCMacroAssembler masm) { @@ -65,12 +66,12 @@ } } - public static SizeEstimate getSize() { - return SIZE; - } - public void resetState() { delaySlotPosition = -1; emitDone = false; } + + public SPARCLIRInstructionMixinStore getSPARCLIRInstructionStore() { + return store; + } }
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstruction.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstruction.java Mon Aug 10 13:53:55 2015 +0200 @@ -29,9 +29,9 @@ /** * Convenience class to provide SPARCMacroAssembler for the {@link #emitCode} method. */ -public abstract class SPARCLIRInstruction extends LIRInstruction { +public abstract class SPARCLIRInstruction extends LIRInstruction implements SPARCLIRInstructionMixin { public static final LIRInstructionClass<SPARCLIRInstruction> TYPE = LIRInstructionClass.create(SPARCLIRInstruction.class); - private final SizeEstimate size; + private final SPARCLIRInstructionMixinStore store; protected SPARCLIRInstruction(LIRInstructionClass<? extends LIRInstruction> c) { this(c, null); @@ -39,72 +39,17 @@ protected SPARCLIRInstruction(LIRInstructionClass<? extends LIRInstruction> c, SizeEstimate size) { super(c); - this.size = size; + store = new SPARCLIRInstructionMixinStore(size); } - protected SPARCDelayedControlTransfer delayedControlTransfer = SPARCDelayedControlTransfer.DUMMY; - @Override - public final void emitCode(CompilationResultBuilder crb) { + public void emitCode(CompilationResultBuilder crb) { emitCode(crb, (SPARCMacroAssembler) crb.asm); } - public abstract void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm); - - public boolean leavesRegisterWindow() { - return false; - } - - public void setDelayedControlTransfer(SPARCDelayedControlTransfer holder) { - this.delayedControlTransfer = holder; - } - - public SizeEstimate estimateSize() { - return size; - } + protected abstract void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm); - /** - * This class represents a size estimation of a particular LIR instruction. It contains a - * pessimistic estimate of emitted SPARC instructions and emitted bytes into the constant - * section. - */ - public static class SizeEstimate { - /** - * Cache the first size definition (with just 0 as constant size). - */ - private static final SizeEstimate[] cache = new SizeEstimate[5]; - static { - for (int i = 0; i < cache.length; i++) { - cache[i] = new SizeEstimate(i, 0); - } - } - public final int instructionSize; - public final int constantSize; - - public SizeEstimate(int instructionSize, int constantSize) { - this.instructionSize = instructionSize; - this.constantSize = constantSize; - } - - public static SizeEstimate create(int instructionSize, int constantSize) { - if (constantSize == 0 && instructionSize < cache.length) { - return cache[instructionSize]; - } else { - return new SizeEstimate(instructionSize, constantSize); - } - } - - public static SizeEstimate create(int instructionSize) { - if (instructionSize < cache.length) { - return cache[instructionSize]; - } else { - return new SizeEstimate(instructionSize, 0); - } - } - - @Override - public String toString() { - return "SE[i=" + instructionSize + ", c=" + constantSize + "]"; - } + public SPARCLIRInstructionMixinStore getSPARCLIRInstructionStore() { + return store; } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCLIRInstructionMixin.java Mon Aug 10 13:53:55 2015 +0200 @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2015, 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.lir.sparc; + +public interface SPARCLIRInstructionMixin { + + default boolean leavesRegisterWindow() { + return false; + } + + default void setDelayedControlTransfer(SPARCDelayedControlTransfer holder) { + assert this instanceof SPARCTailDelayedLIRInstruction : this; + getSPARCLIRInstructionStore().delayedControlTransfer = holder; + } + + default SPARCDelayedControlTransfer getDelayedControlTransfer() { + return getSPARCLIRInstructionStore().delayedControlTransfer; + } + + default SizeEstimate estimateSize() { + return getSPARCLIRInstructionStore().estimate; + } + + SPARCLIRInstructionMixinStore getSPARCLIRInstructionStore(); + + /** + * This class represents a size estimation of a particular LIR instruction. It contains a + * pessimistic estimate of emitted SPARC instructions and emitted bytes into the constant + * section. + */ + public static class SizeEstimate { + /** + * Cache the first size definition (with just 0 as constant size). + */ + private static final SizeEstimate[] cache = new SizeEstimate[5]; + static { + for (int i = 0; i < cache.length; i++) { + cache[i] = new SizeEstimate(i, 0); + } + } + public final int instructionSize; + public final int constantSize; + + public SizeEstimate(int instructionSize, int constantSize) { + this.instructionSize = instructionSize; + this.constantSize = constantSize; + } + + public static SizeEstimate create(int instructionSize, int constantSize) { + if (constantSize == 0 && instructionSize < cache.length) { + return cache[instructionSize]; + } else { + return new SizeEstimate(instructionSize, constantSize); + } + } + + public static SizeEstimate create(int instructionSize) { + if (instructionSize < cache.length) { + return cache[instructionSize]; + } else { + return new SizeEstimate(instructionSize, 0); + } + } + + @Override + public String toString() { + return "SE[i=" + instructionSize + ", c=" + constantSize + "]"; + } + } + + public static class SPARCLIRInstructionMixinStore { + public SizeEstimate estimate; + public SPARCDelayedControlTransfer delayedControlTransfer = SPARCDelayedControlTransfer.DUMMY; + + public SPARCLIRInstructionMixinStore(SizeEstimate estimate) { + this.estimate = estimate; + } + } +}
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java Mon Aug 10 13:53:55 2015 +0200 @@ -53,7 +53,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { Kind inputKind = (Kind) input.getLIRKind().getPlatformKind(); - delayedControlTransfer.emitControlTransfer(crb, masm); + getDelayedControlTransfer().emitControlTransfer(crb, masm); switch (opcode) { case SQRT: switch (inputKind) {
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Mon Aug 10 13:53:55 2015 +0200 @@ -63,10 +63,10 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { if (isRegister(result)) { - const2reg(crb, masm, result, g0, constant, delayedControlTransfer); + const2reg(crb, masm, result, g0, constant, getDelayedControlTransfer()); } else if (isStackSlot(result)) { StackSlot slot = asStackSlot(result); - const2stack(crb, masm, slot, g0, constant, delayedControlTransfer, constant); + const2stack(crb, masm, slot, g0, constant, getDelayedControlTransfer(), constant); } } @@ -103,13 +103,13 @@ Register baseRegister = asRegister(constantTableBase); if (isRegister(result)) { Register resultRegister = asRegister(result); - loadFromConstantTable(crb, masm, constantKind, baseRegister, resultRegister, delayedControlTransfer, recordReference); + loadFromConstantTable(crb, masm, constantKind, baseRegister, resultRegister, getDelayedControlTransfer(), recordReference); } else if (isStackSlot(result)) { try (ScratchRegister scratch = masm.getScratchRegister()) { Register scratchRegister = scratch.getRegister(); - loadFromConstantTable(crb, masm, constantKind, baseRegister, scratchRegister, delayedControlTransfer, recordReference); + loadFromConstantTable(crb, masm, constantKind, baseRegister, scratchRegister, getDelayedControlTransfer(), recordReference); StackSlot slot = asStackSlot(result); - reg2stack(crb, masm, slot, scratchRegister.asValue(), delayedControlTransfer); + reg2stack(crb, masm, slot, scratchRegister.asValue(), getDelayedControlTransfer()); } } } @@ -131,7 +131,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - move(crb, masm, getResult(), getInput(), delayedControlTransfer); + move(crb, masm, getResult(), getInput(), getDelayedControlTransfer()); } @Override @@ -184,7 +184,7 @@ } private void moveDirect(CompilationResultBuilder crb, SPARCMacroAssembler masm, Kind inputKind, Kind resultKind) { - delayedControlTransfer.emitControlTransfer(crb, masm); + getDelayedControlTransfer().emitControlTransfer(crb, masm); if (resultKind == Float) { if (inputKind == Int || inputKind == Short || inputKind == Char || inputKind == Byte) { masm.movwtos(asIntReg(input), asFloatReg(result)); @@ -220,7 +220,7 @@ Register scratch = sc.getRegister(); SPARCAddress tempAddress = generateSimm13OffsetLoad((SPARCAddress) crb.asAddress(temp), masm, scratch); masm.st(asRegister(input), tempAddress, resultKindSize); - delayedControlTransfer.emitControlTransfer(crb, masm); + getDelayedControlTransfer().emitControlTransfer(crb, masm); masm.ld(tempAddress, asRegister(result), resultKindSize, false); } } @@ -275,7 +275,7 @@ @Override public void emitMemAccess(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - emitLoad(crb, masm, address.toAddress(), result, signExtend, kind, delayedControlTransfer, state); + emitLoad(crb, masm, address.toAddress(), result, signExtend, kind, getDelayedControlTransfer(), state); } } @@ -295,7 +295,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { SPARCAddress address = addressValue.toAddress(); - loadEffectiveAddress(crb, masm, address, asLongReg(result), delayedControlTransfer); + loadEffectiveAddress(crb, masm, address, asLongReg(result), getDelayedControlTransfer()); } } @@ -339,7 +339,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - delayedControlTransfer.emitControlTransfer(crb, masm); + getDelayedControlTransfer().emitControlTransfer(crb, masm); masm.membar(barriers); } } @@ -359,7 +359,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - delayedControlTransfer.emitControlTransfer(crb, masm); + getDelayedControlTransfer().emitControlTransfer(crb, masm); SPARCAddress addr = input.toAddress(); crb.recordImplicitException(masm.position(), state); // Just need to check whether this is a valid address or not; alignment is not @@ -397,7 +397,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { move(crb, masm, result, newValue, SPARCDelayedControlTransfer.DUMMY); - compareAndSwap(crb, masm, address, cmpValue, result, delayedControlTransfer); + compareAndSwap(crb, masm, address, cmpValue, result, getDelayedControlTransfer()); } } @@ -417,7 +417,7 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { SPARCAddress address = (SPARCAddress) crb.asAddress(slot); - loadEffectiveAddress(crb, masm, address, asLongReg(result), delayedControlTransfer); + loadEffectiveAddress(crb, masm, address, asLongReg(result), getDelayedControlTransfer()); } } @@ -452,7 +452,7 @@ @Override public void emitMemAccess(CompilationResultBuilder crb, SPARCMacroAssembler masm) { - emitStore(input, address.toAddress(), kind, delayedControlTransfer, state, crb, masm); + emitStore(input, address.toAddress(), kind, getDelayedControlTransfer(), state, crb, masm); } } @@ -475,7 +475,7 @@ try (ScratchRegister sc = masm.getScratchRegister()) { Register scratch = sc.getRegister(); SPARCAddress addr = generateSimm13OffsetLoad(address.toAddress(), masm, scratch); - delayedControlTransfer.emitControlTransfer(crb, masm); + getDelayedControlTransfer().emitControlTransfer(crb, masm); if (state != null) { crb.recordImplicitException(masm.position(), state); }
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTailDelayedLIRInstruction.java Mon Aug 10 13:38:41 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTailDelayedLIRInstruction.java Mon Aug 10 13:53:55 2015 +0200 @@ -44,6 +44,5 @@ * {@link SPARCDelayedControlTransfer#emitControlTransfer(com.oracle.graal.lir.asm.CompilationResultBuilder, SPARCMacroAssembler)} * . The DelayedControlTransfer instruction will emit the code just with Nop in the delay slot. */ -public interface SPARCTailDelayedLIRInstruction { - void setDelayedControlTransfer(SPARCDelayedControlTransfer holder); +public interface SPARCTailDelayedLIRInstruction extends SPARCLIRInstructionMixin { }