# HG changeset patch # User Thomas Wuerthinger # Date 1339271402 -7200 # Node ID 69a8969dbf40c1c4f127437c69a7f1a45a4f7e2e # Parent 883c11613de5bf63cf7ebd4378c6e0c0f9237bc2 Reduce public fields in api.code project. diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java --- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/DataFlowAnalysis.java Sat Jun 09 21:50:02 2012 +0200 @@ -58,7 +58,7 @@ } private boolean isAllocatableRegister(Value value) { - return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable; + return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable(); } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java --- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/LinearScanAllocator.java Sat Jun 09 21:50:02 2012 +0200 @@ -106,7 +106,7 @@ } private boolean isAllocatableRegister(Value value) { - return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable; + return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable(); } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java --- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/simple/SpillAllAllocator.java Sat Jun 09 21:50:02 2012 +0200 @@ -102,7 +102,7 @@ } private boolean isAllocatableRegister(Value value) { - return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable; + return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable(); } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java --- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/IntervalPrinter.java Sat Jun 09 21:50:02 2012 +0200 @@ -112,7 +112,7 @@ } private boolean isAllocatableRegister(Value value) { - return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable; + return isRegister(value) && registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable(); } private int curOpId; diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java --- a/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.alloc/src/com/oracle/graal/alloc/util/RegisterVerifier.java Sat Jun 09 21:50:02 2012 +0200 @@ -158,7 +158,7 @@ Iterator iter = curInputState.keySet().iterator(); while (iter.hasNext()) { Object value1 = iter.next(); - if (value1 instanceof Register && frameMap.registerConfig.getAttributesMap()[((Register) value1).number].isCallerSave) { + if (value1 instanceof Register && frameMap.registerConfig.getAttributesMap()[((Register) value1).number].isCallerSave()) { Debug.log(" remove caller save register %s", value1); iter.remove(); } @@ -183,7 +183,7 @@ } private boolean isIgnoredRegister(Value value) { - return isRegister(value) && !frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable; + return isRegister(value) && !frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable(); } private Value use(Value value, EnumSet flags) { diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java Sat Jun 09 21:50:02 2012 +0200 @@ -39,27 +39,10 @@ */ public static final Address Placeholder = new Address(Kind.Illegal, Value.IllegalValue); - /** - * Base register that defines the start of the address computation. - * If not present, is denoted by {@link Value#IllegalValue}. - */ - public Value base; - - /** - * Index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}. - * If not present, is denoted by {@link Value#IllegalValue}. - */ - public Value index; - - /** - * Scaling factor for indexing, dependent on target operand size. - */ - public final Scale scale; - - /** - * Optional additive displacement. - */ - public final int displacement; + private Value base; + private Value index; + private final Scale scale; + private final int displacement; /** * Creates a {@code CiAddress} with given base register, no scaling and no displacement. @@ -91,8 +74,8 @@ */ public Address(Kind kind, Value base, Value index, Scale scale, int displacement) { super(kind); - this.base = base; - this.index = index; + this.setBase(base); + this.setIndex(index); this.scale = scale; this.displacement = displacement; @@ -144,18 +127,18 @@ StringBuilder s = new StringBuilder(); s.append(kind.javaName).append("["); String sep = ""; - if (isLegal(base)) { - s.append(base); + if (isLegal(getBase())) { + s.append(getBase()); sep = " + "; } - if (isLegal(index)) { - s.append(sep).append(index).append(" * ").append(scale.value); + if (isLegal(getIndex())) { + s.append(sep).append(getIndex()).append(" * ").append(getScale().value); sep = " + "; } - if (displacement < 0) { - s.append(" - ").append(-displacement); - } else if (displacement > 0) { - s.append(sep).append(displacement); + if (getDisplacement() < 0) { + s.append(" - ").append(-getDisplacement()); + } else if (getDisplacement() > 0) { + s.append(sep).append(getDisplacement()); } s.append("]"); return s.toString(); @@ -165,13 +148,51 @@ public boolean equals(Object obj) { if (obj instanceof Address) { Address addr = (Address) obj; - return kind == addr.kind && displacement == addr.displacement && base.equals(addr.base) && scale == addr.scale && index.equals(addr.index); + return kind == addr.kind && getDisplacement() == addr.getDisplacement() && getBase().equals(addr.getBase()) && getScale() == addr.getScale() && getIndex().equals(addr.getIndex()); } return false; } @Override public int hashCode() { - return base.hashCode() ^ index.hashCode() ^ (displacement << 4) ^ (scale.value << 8) ^ (kind.ordinal() << 12); + return getBase().hashCode() ^ getIndex().hashCode() ^ (getDisplacement() << 4) ^ (getScale().value << 8) ^ (kind.ordinal() << 12); + } + + /** + * @return Base register that defines the start of the address computation. + * If not present, is denoted by {@link Value#IllegalValue}. + */ + public Value getBase() { + return base; + } + + public void setBase(Value base) { + this.base = base; + } + + /** + * @return Index register, the value of which (possibly scaled by {@link #scale}) is added to {@link #base}. + * If not present, is denoted by {@link Value#IllegalValue}. + */ + public Value getIndex() { + return index; + } + + public void setIndex(Value index) { + this.index = index; + } + + /** + * @return Scaling factor for indexing, dependent on target operand size. + */ + public Scale getScale() { + return scale; + } + + /** + * @return Optional additive displacement. + */ + public int getDisplacement() { + return displacement; } } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodeFrame.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodeFrame.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodeFrame.java Sat Jun 09 21:50:02 2012 +0200 @@ -133,7 +133,7 @@ * @return {@code null} if this frame has no caller */ public BytecodeFrame caller() { - return (BytecodeFrame) caller; + return (BytecodeFrame) getCaller(); } @Override diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodePosition.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodePosition.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodePosition.java Sat Jun 09 21:50:02 2012 +0200 @@ -36,22 +36,9 @@ private static final long serialVersionUID = 8633885274526033515L; - /** - * The position where this position has been called, {@code null} if none. - */ - public final BytecodePosition caller; - - /** - * The runtime interface method for this position. - */ - public final ResolvedJavaMethod method; - - /** - * The location within the method, as a bytecode index. The constant - * {@code -1} may be used to indicate the location is unknown, for example - * within code synthesized by the compiler. - */ - public final int bci; + private final BytecodePosition caller; + private final ResolvedJavaMethod method; + private final int bci; /** * Constructs a new object representing a given parent/caller, a given method, and a given BCI. @@ -86,11 +73,11 @@ } if (obj instanceof BytecodePosition) { BytecodePosition other = (BytecodePosition) obj; - if (other.method.equals(method) && other.bci == bci) { - if (caller == null) { - return other.caller == null; + if (other.getMethod().equals(getMethod()) && other.getBCI() == getBCI()) { + if (getCaller() == null) { + return other.getCaller() == null; } - return caller.equals(other.caller); + return getCaller().equals(other.getCaller()); } } return false; @@ -98,6 +85,29 @@ @Override public int hashCode() { + return getBCI(); + } + + /** + * @return The location within the method, as a bytecode index. The constant + * {@code -1} may be used to indicate the location is unknown, for example + * within code synthesized by the compiler. + */ + public int getBCI() { return bci; } + + /** + * @return The runtime interface method for this position. + */ + public ResolvedJavaMethod getMethod() { + return method; + } + + /** + * The position where this position has been called, {@code null} if none. + */ + public BytecodePosition getCaller() { + return caller; + } } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java Sat Jun 09 21:50:02 2012 +0200 @@ -112,31 +112,6 @@ return 63 - Long.numberOfLeadingZeros(val); } - public static int align(int size, int align) { - assert isPowerOf2(align); - return (size + align - 1) & ~(align - 1); - } - - /** - * Gets a word with the nth bit set. - * - * @param n the nth bit to set - * @return an integer value with the nth bit set - */ - public static int nthBit(int n) { - return n >= Integer.SIZE ? 0 : 1 << n; - } - - /** - * Gets a word with the right-most n bits set. - * - * @param n the number of right most bits to set - * @return an integer value with the right-most n bits set - */ - public static int rightNBits(int n) { - return nthBit(n) - 1; - } - /** * Gets a string for a given method formatted according to a given format specification. A format specification is * composed of characters that are to be copied verbatim to the result and specifiers that denote an attribute of @@ -318,16 +293,6 @@ } /** - * Creates a set that uses reference-equality instead of {@link Object#equals(Object)} when comparing values. - * - * @param the type of elements in the set - * @return a set based on reference-equality - */ - public static Set newIdentityHashSet() { - return Collections.newSetFromMap(new IdentityHashMap()); - } - - /** * Prepends the String {@code indentation} to every line in String {@code lines}, including a possibly non-empty * line following the final newline. */ @@ -481,10 +446,10 @@ * @return the value of {@code sb} */ public static StringBuilder append(StringBuilder sb, BytecodePosition pos) { - appendLocation(sb.append("at "), pos.method, pos.bci); - if (pos.caller != null) { + appendLocation(sb.append("at "), pos.getMethod(), pos.getBCI()); + if (pos.getCaller() != null) { sb.append(NEW_LINE); - append(sb, pos.caller); + append(sb, pos.getCaller()); } return sb; } @@ -497,7 +462,7 @@ * @return the value of {@code sb} */ public static StringBuilder append(StringBuilder sb, BytecodeFrame frame) { - appendLocation(sb.append("at "), frame.method, frame.bci); + appendLocation(sb.append("at "), frame.getMethod(), frame.getBCI()); if (frame.values != null && frame.values.length > 0) { sb.append(NEW_LINE); String table = tabulateValues(frame); @@ -515,9 +480,9 @@ if (frame.caller() != null) { sb.append(NEW_LINE); append(sb, frame.caller()); - } else if (frame.caller != null) { + } else if (frame.getCaller() != null) { sb.append(NEW_LINE); - append(sb, frame.caller); + append(sb, frame.getCaller()); } return sb; } @@ -577,7 +542,7 @@ String nl = NEW_LINE; if (info.hasRegisterRefMap()) { sb.append(" reg-ref-map:"); - BitSet bm = info.registerRefMap; + BitSet bm = info.getRegisterRefMap(); if (formatter != null) { for (int reg = bm.nextSetBit(0); reg >= 0; reg = bm.nextSetBit(reg + 1)) { sb.append(" " + formatter.formatRegister(reg)); @@ -587,7 +552,7 @@ } if (info.hasStackRefMap()) { sb.append("frame-ref-map:"); - BitSet bm = info.frameRefMap; + BitSet bm = info.getFrameRefMap(); if (formatter != null) { for (int i = bm.nextSetBit(0); i >= 0; i = bm.nextSetBit(i + 1)) { sb.append(" " + formatter.formatStackSlot(i)); @@ -598,8 +563,8 @@ BytecodeFrame frame = info.frame(); if (frame != null) { append(sb, frame); - } else if (info.codePos != null) { - append(sb, info.codePos); + } else if (info.getBytecodePosition() != null) { + append(sb, info.getBytecodePosition()); } return sb; } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Sat Jun 09 21:50:02 2012 +0200 @@ -315,25 +315,10 @@ } } - /** - * List of safepoints, sorted by {@link Site#pcOffset}. - */ - public final List safepoints = new ArrayList<>(); - - /** - * List of data references. - */ - public final List dataReferences = new ArrayList<>(); - - /** - * List of exception handlers. - */ - public final List exceptionHandlers = new ArrayList<>(); - - /** - * List of marks. - */ - public final List marks = new ArrayList<>(); + private final List safepoints = new ArrayList<>(); + private final List dataReferences = new ArrayList<>(); + private final List exceptionHandlers = new ArrayList<>(); + private final List marks = new ArrayList<>(); private int frameSize = -1; private int customStackAreaOffset = -1; @@ -396,7 +381,7 @@ */ public void recordDataReference(int codePos, Constant data, int alignment) { assert codePos >= 0 && data != null; - dataReferences.add(new DataPatch(codePos, data, alignment)); + getDataReferences().add(new DataPatch(codePos, data, alignment)); } /** @@ -421,7 +406,7 @@ * @param throwableType the type of exceptions handled by the handler */ public void recordExceptionHandler(int codePos, int handlerPos) { - exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos)); + getExceptionHandlers().add(new ExceptionHandler(codePos, handlerPos)); } /** @@ -436,11 +421,11 @@ private void addSafepoint(Safepoint safepoint) { // The safepoints list must always be sorted - if (!safepoints.isEmpty() && safepoints.get(safepoints.size() - 1).pcOffset >= safepoint.pcOffset) { + if (!getSafepoints().isEmpty() && getSafepoints().get(getSafepoints().size() - 1).pcOffset >= safepoint.pcOffset) { // This re-sorting should be very rare - Collections.sort(safepoints); + Collections.sort(getSafepoints()); } - safepoints.add(safepoint); + getSafepoints().add(safepoint); } /** @@ -452,7 +437,7 @@ */ public Mark recordMark(int codePos, Object id, Mark[] references) { Mark mark = new Mark(codePos, id, references); - marks.add(mark); + getMarks().add(mark); return mark; } @@ -532,11 +517,11 @@ private static void appendDebugInfo(StringBuilder sb, DebugInfo info) { if (info != null) { - appendRefMap(sb, "stackMap", info.frameRefMap); - appendRefMap(sb, "registerMap", info.registerRefMap); - BytecodePosition codePos = info.codePos; + appendRefMap(sb, "stackMap", info.getFrameRefMap()); + appendRefMap(sb, "registerMap", info.getRegisterRefMap()); + BytecodePosition codePos = info.getBytecodePosition(); if (codePos != null) { - CodeUtil.appendLocation(sb.append(" "), codePos.method, codePos.bci); + CodeUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); if (info.hasFrame()) { sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); if (info.frame().numLocks > 0) { @@ -552,4 +537,32 @@ sb.append(' ').append(name).append('[').append(map.toString()).append(']'); } } + + /** + * @return the list of safepoints, sorted by {@link Site#pcOffset} + */ + public List getSafepoints() { + return safepoints; + } + + /** + * @return the list of data references + */ + public List getDataReferences() { + return dataReferences; + } + + /** + * @return the list of exception handlers + */ + public List getExceptionHandlers() { + return exceptionHandlers; + } + + /** + * @return the list of marks + */ + public List getMarks() { + return marks; + } } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DebugInfo.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DebugInfo.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DebugInfo.java Sat Jun 09 21:50:02 2012 +0200 @@ -33,24 +33,9 @@ private static final long serialVersionUID = -6047206624915812516L; - /** - * The code position (including all inlined methods) of this debug info. - * If this is a {@link BytecodeFrame} instance, then it is also the deoptimization information for each inlined frame. - */ - public final BytecodePosition codePos; - - /** - * The reference map for the registers at this point. The reference map is packed in that - * for bit {@code k} in byte {@code n}, it refers to the register whose - * {@linkplain Register#number number} is {@code (k + n * 8)}. - */ - public final BitSet registerRefMap; - - /** - * The reference map for the stack frame at this point. A set bit at {@code k} in the map - * represents stack slot number {@code k}. - */ - public final BitSet frameRefMap; + private final BytecodePosition bytecodePosition; + private final BitSet registerRefMap; + private final BitSet frameRefMap; /** * Creates a new {@code CiDebugInfo} from the given values. @@ -60,7 +45,7 @@ * @param frameRefMap the reference map for {@code frame}, which may be {@code null} */ public DebugInfo(BytecodePosition codePos, BitSet registerRefMap, BitSet frameRefMap) { - this.codePos = codePos; + this.bytecodePosition = codePos; this.registerRefMap = registerRefMap; this.frameRefMap = frameRefMap; } @@ -69,21 +54,21 @@ * @return {@code true} if this debug information has a frame */ public boolean hasFrame() { - return codePos instanceof BytecodeFrame; + return getBytecodePosition() instanceof BytecodeFrame; } /** * @return {@code true} if this debug info has a reference map for the registers */ public boolean hasRegisterRefMap() { - return registerRefMap != null && registerRefMap.size() > 0; + return getRegisterRefMap() != null && getRegisterRefMap().size() > 0; } /** * @return {@code true} if this debug info has a reference map for the stack */ public boolean hasStackRefMap() { - return frameRefMap != null && frameRefMap.size() > 0; + return getFrameRefMap() != null && getFrameRefMap().size() > 0; } @@ -94,7 +79,7 @@ */ public BytecodeFrame frame() { if (hasFrame()) { - return (BytecodeFrame) codePos; + return (BytecodeFrame) getBytecodePosition(); } return null; } @@ -103,4 +88,29 @@ public String toString() { return CodeUtil.append(new StringBuilder(100), this, null).toString(); } + + /** + * @return The code position (including all inlined methods) of this debug info. + * If this is a {@link BytecodeFrame} instance, then it is also the deoptimization information for each inlined frame. + */ + public BytecodePosition getBytecodePosition() { + return bytecodePosition; + } + + /** + * @return The reference map for the registers at this point. The reference map is packed in that + * for bit {@code k} in byte {@code n}, it refers to the register whose + * {@linkplain Register#number number} is {@code (k + n * 8)}. + */ + public BitSet getRegisterRefMap() { + return registerRefMap; + } + + /** + * @return The reference map for the stack frame at this point. A set bit at {@code k} in the map + * represents stack slot number {@code k}. + */ + public BitSet getFrameRefMap() { + return frameRefMap; + } } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java Sat Jun 09 21:50:02 2012 +0200 @@ -27,9 +27,9 @@ public final class MonitorValue extends Value { private static final long serialVersionUID = 8241681800464483691L; - public Value owner; - public final Value lockData; - public final boolean eliminated; + private Value owner; + private final Value lockData; + private final boolean eliminated; public MonitorValue(Value owner, Value lockData, boolean eliminated) { super(Kind.Illegal); @@ -38,6 +38,22 @@ this.eliminated = eliminated; } + public Value getOwner() { + return owner; + } + + public void setOwner(Value newOwner) { + this.owner = newOwner; + } + + public Value getLockData() { + return lockData; + } + + public boolean isEliminated() { + return eliminated; + } + @Override public String toString() { return "monitor[" + owner + (lockData != null ? ", " + lockData : "") + (eliminated ? ", eliminated" : "") + "]"; diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterAttributes.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterAttributes.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterAttributes.java Sat Jun 09 21:50:02 2012 +0200 @@ -30,32 +30,14 @@ * a compilation will determine which registers are callee saved. */ public class RegisterAttributes { - - /** - * Denotes a register whose value preservation (if required) across a call is the responsibility of the caller. - */ - public final boolean isCallerSave; - - /** - * Denotes a register whose value preservation (if required) across a call is the responsibility of the callee. - */ - public final boolean isCalleeSave; - - /** - * Denotes a register that is available for use by a register allocator. - */ - public final boolean isAllocatable; - - /** - * Denotes a register guaranteed to be non-zero if read in compiled Java code. - * For example, a register dedicated to holding the current thread. - */ - public boolean isNonZero; + private final boolean callerSave; + private final boolean calleeSave; + private final boolean allocatable; public RegisterAttributes(boolean isCallerSave, boolean isCalleeSave, boolean isAllocatable) { - this.isCallerSave = isCallerSave; - this.isCalleeSave = isCalleeSave; - this.isAllocatable = isAllocatable; + this.callerSave = isCallerSave; + this.calleeSave = isCalleeSave; + this.allocatable = isAllocatable; } public static final RegisterAttributes NONE = new RegisterAttributes(false, false, false); @@ -92,4 +74,25 @@ } return map; } + + /** + * @return Denotes a register that is available for use by a register allocator. + */ + public boolean isAllocatable() { + return allocatable; + } + + /** + * @return Denotes a register whose value preservation (if required) across a call is the responsibility of the callee. + */ + public boolean isCalleeSave() { + return calleeSave; + } + + /** + * @return Denotes a register whose value preservation (if required) across a call is the responsibility of the caller. + */ + public boolean isCallerSave() { + return callerSave; + } } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java Sat Jun 09 21:50:02 2012 +0200 @@ -32,26 +32,30 @@ public final class RegisterValue extends Value { private static final long serialVersionUID = 7999341472196897163L; - /** - * The register. - */ - public final Register reg; + private final Register register; /** * Should only be called from {@link Register#CiRegister} to ensure canonicalization. */ protected RegisterValue(Kind kind, Register register) { super(kind); - this.reg = register; + this.register = register; } @Override public int hashCode() { - return (reg.number << 4) ^ kind.ordinal(); + return (getRegister().number << 4) ^ kind.ordinal(); } @Override public String toString() { - return reg.name + kindSuffix(); + return getRegister().name + kindSuffix(); + } + + /** + * @return the register that contains the value + */ + public Register getRegister() { + return register; } } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java Sat Jun 09 21:50:02 2012 +0200 @@ -83,7 +83,7 @@ public static Register asRegister(Value value) { assert value != null; - return ((RegisterValue) value).reg; + return ((RegisterValue) value).getRegister(); } public static Register asIntReg(Value value) { diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Sat Jun 09 21:50:02 2012 +0200 @@ -956,7 +956,7 @@ } boolean isProcessed(Value operand) { - return !isRegister(operand) || attributes(asRegister(operand)).isAllocatable; + return !isRegister(operand) || attributes(asRegister(operand)).isAllocatable(); } void addDef(Value operand, int defPos, RegisterPriority registerPriority, Kind kind) { @@ -1139,7 +1139,7 @@ // add a temp range for each register if operation destroys caller-save registers if (op.hasCall()) { for (Register r : callerSaveRegs) { - if (attributes(r).isAllocatable) { + if (attributes(r).isAllocatable()) { addTemp(r.asValue(), opId, RegisterPriority.None, Kind.Illegal); } } @@ -1694,7 +1694,7 @@ } private boolean isCallerSave(Value operand) { - return attributes(asRegister(operand)).isCallerSave; + return attributes(asRegister(operand)).isCallerSave(); } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java Sat Jun 09 21:50:02 2012 +0200 @@ -570,7 +570,7 @@ @Override protected LabelRef createDeoptStub(DeoptimizationAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo) { - assert info.topFrame.bci >= 0 : "invalid bci for deopt framestate"; + assert info.topFrame.getBCI() >= 0 : "invalid bci for deopt framestate"; AMD64DeoptimizationStub stub = new AMD64DeoptimizationStub(action, reason, info, deoptInfo); lir.stubs.add(stub); return LabelRef.forLabel(stub.label); diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetMethod.java Sat Jun 09 21:50:02 2012 +0200 @@ -48,15 +48,15 @@ this.name = null; sites = getSortedSites(targetMethod); - if (targetMethod.exceptionHandlers == null) { + if (targetMethod.getExceptionHandlers() == null) { exceptionHandlers = null; } else { - exceptionHandlers = targetMethod.exceptionHandlers.toArray(new ExceptionHandler[targetMethod.exceptionHandlers.size()]); + exceptionHandlers = targetMethod.getExceptionHandlers().toArray(new ExceptionHandler[targetMethod.getExceptionHandlers().size()]); } } private static Site[] getSortedSites(CompilationResult target) { - List[] lists = new List[] {target.safepoints, target.dataReferences, target.marks}; + List[] lists = new List[] {target.getSafepoints(), target.getDataReferences(), target.getMarks()}; int count = 0; for (List list : lists) { count += list.size(); diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Sat Jun 09 21:50:02 2012 +0200 @@ -90,7 +90,7 @@ addExceptionHandlersComment(tm, hcf); Register fp = regConfig.getFrameRegister(); RefMapFormatter slotFormatter = new RefMapFormatter(target.arch, target.wordSize, fp, 0); - for (Safepoint safepoint : tm.safepoints) { + for (Safepoint safepoint : tm.getSafepoints()) { if (safepoint instanceof Call) { Call call = (Call) safepoint; if (call.debugInfo != null) { @@ -104,10 +104,10 @@ addOperandComment(hcf, safepoint.pcOffset, "{safepoint}"); } } - for (DataPatch site : tm.dataReferences) { + for (DataPatch site : tm.getDataReferences()) { hcf.addOperandComment(site.pcOffset, "{" + site.constant + "}"); } - for (Mark mark : tm.marks) { + for (Mark mark : tm.getMarks()) { hcf.addComment(mark.pcOffset, getMarkName(mark)); } } @@ -153,10 +153,10 @@ } private static void addExceptionHandlersComment(CompilationResult tm, HexCodeFile hcf) { - if (!tm.exceptionHandlers.isEmpty()) { + if (!tm.getExceptionHandlers().isEmpty()) { String nl = HexCodeFile.NEW_LINE; StringBuilder buf = new StringBuilder("------ Exception Handlers ------").append(nl); - for (CompilationResult.ExceptionHandler e : tm.exceptionHandlers) { + for (CompilationResult.ExceptionHandler e : tm.getExceptionHandlers()) { buf.append(" "). append(e.pcOffset).append(" -> "). append(e.handlerPos). diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRDebugInfo.java Sat Jun 09 21:50:02 2012 +0200 @@ -84,8 +84,8 @@ Value value = values[i]; if (value instanceof MonitorValue) { MonitorValue monitor = (MonitorValue) value; - if (processed(monitor.owner)) { - monitor.owner = proc.doValue(monitor.owner, OperandMode.Alive, STATE_FLAGS); + if (processed(monitor.getOwner())) { + monitor.setOwner(proc.doValue(monitor.getOwner(), OperandMode.Alive, STATE_FLAGS)); } } else if (processed(value)) { diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Sat Jun 09 21:50:02 2012 +0200 @@ -281,8 +281,8 @@ if (isAddress(value)) { assert flagsFor(mode, i).contains(OperandFlag.Address); Address address = asAddress(value); - address.base = proc.doValue(address.base, mode, ADDRESS_FLAGS); - address.index = proc.doValue(address.index, mode, ADDRESS_FLAGS); + address.setBase(proc.doValue(address.getBase(), mode, ADDRESS_FLAGS)); + address.setIndex(proc.doValue(address.getIndex(), mode, ADDRESS_FLAGS)); } else { values[i] = proc.doValue(values[i], mode, flagsFor(mode, i)); } @@ -432,7 +432,7 @@ buf.append(" [bci:"); String sep = ""; for (BytecodeFrame cur = info.topFrame; cur != null; cur = cur.caller()) { - buf.append(sep).append(cur.bci); + buf.append(sep).append(cur.getBCI()); sep = ","; } buf.append("]"); diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java Sat Jun 09 21:50:02 2012 +0200 @@ -55,7 +55,7 @@ } private boolean isAllocatableRegister(Value value) { - return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable; + return isRegister(value) && frameMap.registerConfig.getAttributesMap()[asRegister(value).number].isAllocatable(); } public static boolean verify(final LIRInstruction op) { diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Sat Jun 09 21:50:02 2012 +0200 @@ -108,9 +108,9 @@ Debug.metric("TargetMethods").increment(); Debug.metric("CodeBytesEmitted").add(targetMethod.targetCodeSize()); - Debug.metric("SafepointsEmitted").add(targetMethod.safepoints.size()); - Debug.metric("DataPatches").add(targetMethod.dataReferences.size()); - Debug.metric("ExceptionHandlersEmitted").add(targetMethod.exceptionHandlers.size()); + Debug.metric("SafepointsEmitted").add(targetMethod.getSafepoints().size()); + Debug.metric("DataPatches").add(targetMethod.getDataReferences().size()); + Debug.metric("ExceptionHandlersEmitted").add(targetMethod.getExceptionHandlers().size()); Debug.log("Finished target method %s, isStub %b", name, isStub); /* diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Sat Jun 09 21:50:02 2012 +0200 @@ -438,7 +438,7 @@ out.adjustIndentation(-level); String state; if (inst.info.hasDebugInfo()) { - state = debugInfoToString(inst.info.debugInfo().codePos, inst.info.debugInfo().registerRefMap, inst.info.debugInfo().frameRefMap, target.arch); + state = debugInfoToString(inst.info.debugInfo().getBytecodePosition(), inst.info.debugInfo().getRegisterRefMap(), inst.info.debugInfo().getFrameRefMap(), target.arch); } else { state = debugInfoToString(inst.info.topFrame, null, null, target.arch); } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/DoubleSnippets.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/DoubleSnippets.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/DoubleSnippets.java Sat Jun 09 21:50:02 2012 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.snippets; -import com.oracle.max.cri.util.*; import com.oracle.graal.nodes.calc.*; /** diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/FloatSnippets.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/FloatSnippets.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/FloatSnippets.java Sat Jun 09 21:50:02 2012 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.snippets; -import com.oracle.max.cri.util.*; import com.oracle.graal.nodes.calc.*; /** diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/JavacBug.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/JavacBug.java Sat Jun 09 21:50:02 2012 +0200 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2011, 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.snippets; + +/** + * Used to indicate that an otherwise strange looking code pattern is required to work around a bug in javac. + */ +public @interface JavacBug { + /** + * A description of the bug. Only really useful if there is no existing entry for the bug in the Bug Database. + */ + String value() default ""; + + /** + * An identifier in the Bug Database. + */ + int id() default 0; +} diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java --- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64Assembler.java Sat Jun 09 21:50:02 2012 +0200 @@ -193,11 +193,11 @@ } private void emitOperandHelper(Register reg, Address addr) { - Register base = isLegal(addr.base) ? asRegister(addr.base) : Register.None; - Register index = isLegal(addr.index) ? asRegister(addr.index) : Register.None; - - Address.Scale scale = addr.scale; - int disp = addr.displacement; + Register base = isLegal(addr.getBase()) ? asRegister(addr.getBase()) : Register.None; + Register index = isLegal(addr.getIndex()) ? asRegister(addr.getIndex()) : Register.None; + + Address.Scale scale = addr.getScale(); + int disp = addr.getDisplacement(); if (base == Register.Frame) { assert frameRegister != null : "cannot use register " + Register.Frame + " in assembler with null register configuration"; @@ -2223,28 +2223,28 @@ private void prefix(Address adr) { - if (needsRex(adr.base)) { - if (needsRex(adr.index)) { + if (needsRex(adr.getBase())) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXXB); } else { emitByte(Prefix.REXB); } } else { - if (needsRex(adr.index)) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXX); } } } private void prefixq(Address adr) { - if (needsRex(adr.base)) { - if (needsRex(adr.index)) { + if (needsRex(adr.getBase())) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXWXB); } else { emitByte(Prefix.REXWB); } } else { - if (needsRex(adr.index)) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXWX); } else { emitByte(Prefix.REXW); @@ -2254,28 +2254,28 @@ private void prefix(Address adr, Register reg) { if (reg.encoding < 8) { - if (needsRex(adr.base)) { - if (needsRex(adr.index)) { + if (needsRex(adr.getBase())) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXXB); } else { emitByte(Prefix.REXB); } } else { - if (needsRex(adr.index)) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXX); } else if (reg.encoding >= 4) { emitByte(Prefix.REX); } } } else { - if (needsRex(adr.base)) { - if (needsRex(adr.index)) { + if (needsRex(adr.getBase())) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXRXB); } else { emitByte(Prefix.REXRB); } } else { - if (needsRex(adr.index)) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXRX); } else { emitByte(Prefix.REXR); @@ -2286,28 +2286,28 @@ private void prefixq(Address adr, Register src) { if (src.encoding < 8) { - if (needsRex(adr.base)) { - if (needsRex(adr.index)) { + if (needsRex(adr.getBase())) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXWXB); } else { emitByte(Prefix.REXWB); } } else { - if (needsRex(adr.index)) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXWX); } else { emitByte(Prefix.REXW); } } } else { - if (needsRex(adr.base)) { - if (needsRex(adr.index)) { + if (needsRex(adr.getBase())) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXWRXB); } else { emitByte(Prefix.REXWRB); } } else { - if (needsRex(adr.index)) { + if (needsRex(adr.getIndex())) { emitByte(Prefix.REXWRX); } else { emitByte(Prefix.REXWR); diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java --- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java Sat Jun 09 21:50:02 2012 +0200 @@ -305,7 +305,7 @@ * if the address might be a volatile field! */ public void movlong(Address dst, long src) { - Address high = new Address(dst.kind, dst.base, dst.index, dst.scale, dst.displacement + 4); + Address high = new Address(dst.kind, dst.getBase(), dst.getIndex(), dst.getScale(), dst.getDisplacement() + 4); movl(dst, (int) (src & 0xFFFFFFFF)); movl(high, (int) (src >> 32)); } diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.max.cri/src/com/oracle/max/cri/package-info.java --- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/package-info.java Sat Jun 09 20:40:54 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2010, 2011, 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. - */ -/** - * A virtual machine compiler-runtime interface (CRI). - *

- * Specifically, this package defines an interface between the compiler and the runtime system of a virtual machine for - * the instruction set defined in {@link com.oracle.graal.compiler.graphbuilder.Bytecodes}. The interface has three components: - *

    - *
  1. the {@link com.oracle.max.cri.ci compiler-provided interface} that must be used by the runtime. - *
  2. the {@link com.oracle.max.cri.ri runtime-provided interface} that must be used by the compiler. - *
  3. the {@link com.oracle.max.cri.xir XIR interface} for translating object operations. - *
- * - * The interface is independent of any particular compiler or runtime implementation. - *

- * For more details see Improving Compiler-Runtime Separation with XIR. - */ -package com.oracle.max.cri; diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.max.cri/src/com/oracle/max/cri/util/JavacBug.java --- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/util/JavacBug.java Sat Jun 09 20:40:54 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2011, 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.max.cri.util; - -/** - * Used to indicate that an otherwise strange looking code pattern is required to work around a bug in javac. - */ -public @interface JavacBug { - /** - * A description of the bug. Only really useful if there is no existing entry for the bug in the Bug Database. - */ - String value() default ""; - - /** - * An identifier in the Bug Database. - */ - int id() default 0; -} diff -r 883c11613de5 -r 69a8969dbf40 graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java --- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java Sat Jun 09 20:40:54 2012 +0200 +++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java Sat Jun 09 21:50:02 2012 +0200 @@ -129,7 +129,7 @@ BytecodePosition curCodePos = codePos; List virtualObjects = new ArrayList<>(); do { - sb.append(CodeUtil.toLocation(curCodePos.method, curCodePos.bci)); + sb.append(CodeUtil.toLocation(curCodePos.getMethod(), curCodePos.getBCI())); sb.append('\n'); if (curCodePos instanceof BytecodeFrame) { BytecodeFrame frame = (BytecodeFrame) curCodePos; @@ -154,7 +154,7 @@ } } - curCodePos = curCodePos.caller; + curCodePos = curCodePos.getCaller(); } while (curCodePos != null); for (int i = 0; i < virtualObjects.size(); i++) {