# HG changeset patch # User Roland Schatz # Date 1444986754 -7200 # Node ID ef7d87db544aaf1635ed38fdadcc32baa763e952 # Parent d43f6d932ad56c862decc160f19be413e2e03304 Remove unused reference map index. diff -r d43f6d932ad5 -r ef7d87db544a jvmci/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java --- a/jvmci/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java Fri Oct 16 00:16:51 2015 +0200 +++ b/jvmci/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java Fri Oct 16 11:12:34 2015 +0200 @@ -68,9 +68,7 @@ r8, r9, r10, r11, r12, r13, r14, r15 }; - private static final int XMM_REFERENCE_MAP_SHIFT = 2; - - public static final RegisterCategory XMM = new RegisterCategory("XMM", cpuRegisters.length, XMM_REFERENCE_MAP_SHIFT); + public static final RegisterCategory XMM = new RegisterCategory("XMM"); // XMM registers public static final Register xmm0 = new Register(16, 0, "xmm0", XMM); @@ -221,8 +219,7 @@ private final AMD64Kind largestKind; public AMD64(EnumSet features, EnumSet flags) { - super("AMD64", AMD64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_STORE | STORE_STORE, 1, cpuRegisters.length + - ((features.contains(CPUFeature.AVX512F) ? xmmRegistersAVX512 : xmmRegistersSSE).length << XMM_REFERENCE_MAP_SHIFT), 8); + super("AMD64", AMD64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_STORE | STORE_STORE, 1, 8); this.features = features; this.flags = flags; assert features.contains(CPUFeature.SSE2) : "minimum config for x64"; diff -r d43f6d932ad5 -r ef7d87db544a jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java --- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java Fri Oct 16 00:16:51 2015 +0200 +++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java Fri Oct 16 11:12:34 2015 +0200 @@ -36,13 +36,6 @@ public abstract class Architecture { /** - * The number of entries required in a {@link ReferenceMap} covering all the registers that may - * store references. The index of a register in the reference map is given by - * {@link Register#getReferenceMapIndex()}. - */ - private final int registerReferenceMapSize; - - /** * The architecture specific type of a native word. */ private final PlatformKind wordKind; @@ -86,7 +79,7 @@ private final int returnAddressSize; protected Architecture(String name, PlatformKind wordKind, ByteOrder byteOrder, boolean unalignedMemoryAccess, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset, - int registerReferenceMapSize, int returnAddressSize) { + int returnAddressSize) { this.name = name; this.registers = registers; this.wordKind = wordKind; @@ -94,7 +87,6 @@ this.unalignedMemoryAccess = unalignedMemoryAccess; this.implicitMemoryBarriers = implicitMemoryBarriers; this.machineCodeCallDisplacementOffset = nativeCallDisplacementOffset; - this.registerReferenceMapSize = registerReferenceMapSize; this.returnAddressSize = returnAddressSize; } @@ -108,10 +100,6 @@ return getName().toLowerCase(); } - public int getRegisterReferenceMapSize() { - return registerReferenceMapSize; - } - /** * Gets the natural size of words (typically registers and pointers) of this architecture, in * bytes. @@ -218,7 +206,6 @@ assert this.byteOrder.equals(that.byteOrder); assert this.implicitMemoryBarriers == that.implicitMemoryBarriers; assert this.machineCodeCallDisplacementOffset == that.machineCodeCallDisplacementOffset; - assert this.registerReferenceMapSize == that.registerReferenceMapSize; assert Arrays.equals(this.registers, that.registers); assert this.returnAddressSize == that.returnAddressSize; assert this.unalignedMemoryAccess == that.unalignedMemoryAccess; diff -r d43f6d932ad5 -r ef7d87db544a jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java --- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java Fri Oct 16 00:16:51 2015 +0200 +++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java Fri Oct 16 11:12:34 2015 +0200 @@ -329,50 +329,12 @@ public interface RefMapFormatter { String formatStackSlot(int frameRefMapIndex); - - String formatRegister(int regRefMapIndex); } /** - * Formats a location in a register reference map. + * Formats a location present in a reference map. */ - public static class DefaultRegFormatter implements RefMapFormatter { - - private final Register[] registers; - - public DefaultRegFormatter(Architecture arch) { - registers = new Register[arch.getRegisterReferenceMapSize()]; - for (Register r : arch.getAvailableValueRegisters()) { - if (r.mayContainReference()) { - assert registers[r.getReferenceMapIndex()] == null : "overlapping registers " + r + " and " + registers[r.getReferenceMapIndex()] + " in reference map"; - registers[r.getReferenceMapIndex()] = r; - } - } - } - - public String formatStackSlot(int frameRefMapIndex) { - return null; - } - - public String formatRegister(int regRefMapIndex) { - int i = regRefMapIndex; - int idx = 0; - while (registers[i] == null) { - i--; - idx++; - } - if (idx == 0) { - return registers[i].toString(); - } else { - return String.format("%s+%d", registers[i].toString(), idx); - } - } - } - - /** - * Formats a location present in a register or frame reference map. - */ - public static class DefaultRefMapFormatter extends DefaultRegFormatter { + public static class DefaultRefMapFormatter implements RefMapFormatter { /** * The size of a stack slot. @@ -390,8 +352,7 @@ */ public final int refMapToFPOffset; - public DefaultRefMapFormatter(Architecture arch, int slotSize, Register fp, int refMapToFPOffset) { - super(arch); + public DefaultRefMapFormatter(int slotSize, Register fp, int refMapToFPOffset) { this.slotSize = slotSize; this.fp = fp; this.refMapToFPOffset = refMapToFPOffset; diff -r d43f6d932ad5 -r ef7d87db544a jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java --- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java Fri Oct 16 00:16:51 2015 +0200 +++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java Fri Oct 16 11:12:34 2015 +0200 @@ -81,32 +81,15 @@ public static class RegisterCategory { private final String name; - private final boolean mayContainReference; - private final int referenceMapOffset; - private final int referenceMapShift; public RegisterCategory(String name) { - this(name, true, 0, 0); + this(name, true); } public RegisterCategory(String name, boolean mayContainReference) { - this(name, mayContainReference, 0, 0); - } - - public RegisterCategory(String name, int referenceMapOffset) { - this(name, true, referenceMapOffset, 0); - } - - public RegisterCategory(String name, int referenceMapOffset, int referenceMapShift) { - this(name, true, referenceMapOffset, referenceMapShift); - } - - private RegisterCategory(String name, boolean mayContainReference, int referenceMapOffset, int referenceMapShift) { this.name = name; this.mayContainReference = mayContainReference; - this.referenceMapOffset = referenceMapOffset; - this.referenceMapShift = referenceMapShift; } @Override @@ -123,7 +106,7 @@ public boolean equals(Object obj) { if (obj instanceof RegisterCategory) { RegisterCategory that = (RegisterCategory) obj; - return this.referenceMapOffset == that.referenceMapOffset && this.referenceMapShift == that.referenceMapShift && this.name.equals(that.name); + return this.name.equals(that.name); } return false; } @@ -156,15 +139,6 @@ } /** - * Get the start index of this register in the {@link ReferenceMap}. This method may only be - * called if {@link #mayContainReference()} is true. - */ - public int getReferenceMapIndex() { - assert mayContainReference(); - return (encoding << registerCategory.referenceMapShift) + registerCategory.referenceMapOffset; - } - - /** * Gets this register as a {@linkplain RegisterValue value} with a specified kind. * * @param kind the specified kind diff -r d43f6d932ad5 -r ef7d87db544a jvmci/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java --- a/jvmci/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java Fri Oct 16 00:16:51 2015 +0200 +++ b/jvmci/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java Fri Oct 16 11:12:34 2015 +0200 @@ -40,17 +40,10 @@ */ public class SPARC extends Architecture { - private static final int CPU_REGISTER_COUNT = 32; - /** - * The upper half registers are counted as single precision even though registers d32..d62 are - * not accessible with single precision instructions. - */ - private static final int FPU_REGISTER_COUNT = 64; - public static final RegisterCategory CPU = new RegisterCategory("CPU"); - public static final RegisterCategory FPUs = new RegisterCategory("FPUs", CPU_REGISTER_COUNT); - public static final RegisterCategory FPUd = new RegisterCategory("FPUd", CPU_REGISTER_COUNT); - public static final RegisterCategory FPUq = new RegisterCategory("FPUq", CPU_REGISTER_COUNT); + public static final RegisterCategory FPUs = new RegisterCategory("FPUs"); + public static final RegisterCategory FPUd = new RegisterCategory("FPUd"); + public static final RegisterCategory FPUq = new RegisterCategory("FPUq"); // General purpose registers public static final Register g0 = new Register(0, 0, "g0", CPU); @@ -250,7 +243,7 @@ public final Set features; public SPARC(Set features) { - super("SPARC", SPARCKind.XWORD, BIG_ENDIAN, false, allRegisters, LOAD_LOAD | LOAD_STORE | STORE_STORE, 1, CPU_REGISTER_COUNT + FPU_REGISTER_COUNT, 8); + super("SPARC", SPARCKind.XWORD, BIG_ENDIAN, false, allRegisters, LOAD_LOAD | LOAD_STORE | STORE_STORE, 1, 8); this.features = features; }