# HG changeset patch # User Thomas Wuerthinger # Date 1361895914 -3600 # Node ID b8f38745675743cee54773b439d2314ac0713018 # Parent caa932ca99b363d32c63a0d6b09a6b49e96c1e98# Parent 7a5bbcc36bb202320a5657e74ee7a7d072a71317 Merge. diff -r 7a5bbcc36bb2 -r b8f387456757 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java Tue Feb 26 16:35:23 2013 +0100 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java Tue Feb 26 17:25:14 2013 +0100 @@ -23,9 +23,6 @@ package com.oracle.graal.api.code; import java.nio.*; -import java.util.*; - -import com.oracle.graal.api.code.Register.RegisterFlag; /** * Represents a CPU architecture, including information such as its endianness, CPU registers, word @@ -79,22 +76,6 @@ */ private final int returnAddressSize; - private final EnumMap registersByTypeAndEncoding; - - /** - * Gets the register for a given {@linkplain Register#encoding encoding} and type. - * - * @param encoding a register value as used in a machine instruction - * @param type the type of the register - */ - public Register registerFor(int encoding, RegisterFlag type) { - Register[] regs = registersByTypeAndEncoding.get(type); - assert encoding >= 0 && encoding < regs.length; - Register reg = regs[encoding]; - assert reg != null; - return reg; - } - protected Architecture(String name, int wordSize, ByteOrder byteOrder, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset, int registerReferenceMapBitCount, int returnAddressSize) { this.name = name; @@ -105,18 +86,6 @@ this.machineCodeCallDisplacementOffset = nativeCallDisplacementOffset; this.registerReferenceMapBitCount = registerReferenceMapBitCount; this.returnAddressSize = returnAddressSize; - - registersByTypeAndEncoding = new EnumMap<>(RegisterFlag.class); - EnumMap categorizedRegs = Register.categorize(registers); - for (RegisterFlag type : RegisterFlag.values()) { - Register[] regs = categorizedRegs.get(type); - int max = Register.maxRegisterEncoding(regs); - Register[] regsByEnc = new Register[max + 1]; - for (Register reg : regs) { - regsByEnc[reg.encoding] = reg; - } - registersByTypeAndEncoding.put(type, regsByEnc); - } } /** @@ -161,14 +130,6 @@ } /** - * Gets a mask of the barrier constants denoting the barriers that are not required to be - * explicitly inserted under this architecture. - */ - public int getImplicitMemoryBarriers() { - return implicitMemoryBarriers; - } - - /** * Gets the size of the return address pushed to the stack by a call instruction. A value of 0 * denotes that call linkage uses registers instead. */ diff -r 7a5bbcc36bb2 -r b8f387456757 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Feb 26 16:35:23 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Feb 26 17:25:14 2013 +0100 @@ -90,6 +90,16 @@ */ private final ArrayList lockDataSlots; + /** + * Checks whether the supplied constant can be used without loading it into a register for store + * operations, i.e., on the right hand side of a memory access. + * + * @param c The constant to check. + * @return True if the constant can be used directly, false if the constant needs to be in a + * register. + */ + public abstract boolean canStoreConstant(Constant c); + public LIRGenerator(StructuredGraph graph, CodeCacheProvider runtime, TargetDescription target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir) { this.graph = graph; this.runtime = runtime; diff -r 7a5bbcc36bb2 -r b8f387456757 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java Tue Feb 26 16:35:23 2013 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java Tue Feb 26 17:25:14 2013 +0100 @@ -347,28 +347,4 @@ } } } - - /** - * Clears the specified location as a reference in the reference map of the debug information. - * The tracked location can be a {@link RegisterValue} or a {@link StackSlot}. Note that a - * {@link Constant} is automatically tracked. - * - * @param location The location to be removed from the reference map. - * @param registerRefMap A register reference map, as created by {@link #initRegisterRefMap()}. - * @param frameRefMap A frame reference map, as created by {@link #initFrameRefMap()}. - */ - public void clearReference(Value location, BitSet registerRefMap, BitSet frameRefMap) { - if (location.getKind() == Kind.Object) { - if (location instanceof RegisterValue) { - registerRefMap.clear(asRegister(location).number); - } else if (isStackSlot(location)) { - int index = frameRefMapIndex(asStackSlot(location)); - if (index < frameRefMap.size()) { - frameRefMap.clear(index); - } - } else { - assert isConstant(location); - } - } - } } diff -r 7a5bbcc36bb2 -r b8f387456757 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java Tue Feb 26 16:35:23 2013 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java Tue Feb 26 17:25:14 2013 +0100 @@ -33,8 +33,6 @@ */ public class StandardOp { - private static Value[] EMPTY = new Value[0]; - /** * Marker interface for LIR ops that can fall through to the next operation, like a switch * statement. setFallThroughTarget(null) can be used to make the operation fall through to the @@ -99,24 +97,6 @@ } } - public static class PhiJumpOp extends JumpOp { - - @Alive({REG, STACK, CONST}) protected Value[] phiInputs; - - public PhiJumpOp(LabelRef destination, Value[] phiInputs) { - super(destination, null); - this.phiInputs = phiInputs; - } - - public void markResolved() { - phiInputs = EMPTY; - } - - public Value[] getPhiInputs() { - return phiInputs; - } - } - /** * Marker interface for a LIR operation that is a conditional jump to {@link #destination()}. * Conditional jumps may be negated or optimized away after register allocation. diff -r 7a5bbcc36bb2 -r b8f387456757 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Tue Feb 26 16:35:23 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java Tue Feb 26 17:25:14 2013 +0100 @@ -45,16 +45,6 @@ */ public abstract boolean canInlineConstant(Constant c); - /** - * Checks whether the supplied constant can be used without loading it into a register for store - * operations, i.e., on the right hand side of a memory access. - * - * @param c The constant to check. - * @return True if the constant can be used directly, false if the constant needs to be in a - * register. - */ - public abstract boolean canStoreConstant(Constant c); - public abstract RegisterAttributes attributes(Register register); public abstract Value operand(ValueNode object);