< prev index next >

src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java

Print this page

        

*** 20,32 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.vm.ci.code; ! import java.util.*; ! ! import jdk.vm.ci.meta.*; /** * Miscellaneous collection of utility methods used by {@code jdk.vm.ci.code} and its clients. */ public class CodeUtil { --- 20,38 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package jdk.vm.ci.code; ! import java.util.ArrayList; ! import java.util.Arrays; ! import java.util.Collections; ! import java.util.Map; ! ! import jdk.vm.ci.meta.JavaType; ! import jdk.vm.ci.meta.MetaUtil; ! import jdk.vm.ci.meta.ResolvedJavaMethod; ! import jdk.vm.ci.meta.Signature; /** * Miscellaneous collection of utility methods used by {@code jdk.vm.ci.code} and its clients. */ public class CodeUtil {
*** 321,373 **** } public interface RefMapFormatter { String formatStackSlot(int frameRefMapIndex); - - String formatRegister(int regRefMapIndex); - } - - /** - * Formats a location in a register 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.getRegisters()) { - if (r.getReferenceMapIndex() >= 0) { - 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 { /** * The size of a stack slot. */ public final int slotSize; --- 327,342 ---- } public interface RefMapFormatter { String formatStackSlot(int frameRefMapIndex); } /** ! * Formats a location present in a reference map. */ ! public static class DefaultRefMapFormatter implements RefMapFormatter { /** * The size of a stack slot. */ public final int slotSize;
*** 381,392 **** * The offset (in bytes) from the slot pointed to by {@link #fp} to the slot corresponding * to bit 0 in the frame reference map. */ public final int refMapToFPOffset; ! public DefaultRefMapFormatter(Architecture arch, int slotSize, Register fp, int refMapToFPOffset) { ! super(arch); this.slotSize = slotSize; this.fp = fp; this.refMapToFPOffset = refMapToFPOffset; } --- 350,360 ---- * The offset (in bytes) from the slot pointed to by {@link #fp} to the slot corresponding * to bit 0 in the frame reference map. */ public final int refMapToFPOffset; ! public DefaultRefMapFormatter(int slotSize, Register fp, int refMapToFPOffset) { this.slotSize = slotSize; this.fp = fp; this.refMapToFPOffset = refMapToFPOffset; }
< prev index next >