Mercurial > hg > graal-compiler
changeset 7723:fad3f591580c
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 05 Feb 2013 17:19:52 +0100 |
parents | f07cafa29db1 (diff) c1f63bbdf7b1 (current diff) |
children | 926635ea20ce 8b7996916df6 |
files | graal/com.oracle.graal.api.test/src/com/oracle/graal/api/test/GraalTest.java |
diffstat | 8 files changed, 41 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Tue Feb 05 17:19:52 2013 +0100 @@ -123,7 +123,6 @@ for (Node n : workList) { processNode(n, graph); - Debug.dump(graph, "After processing %s", n); } graph.stopTrackingInputChange();
--- a/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameTest.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameTest.java Tue Feb 05 17:19:52 2013 +0100 @@ -35,7 +35,7 @@ * The frame is the preferred data structure for passing values between nodes. It can in particular * be used for storing the values of local variables of the guest language. The * {@link FrameDescriptor} represents the current structure of the frame. The method - * {@link FrameDescriptor#addFrameSlot(String, Class)} can be used to create predefined frame slots. + * {@link FrameDescriptor#addFrameSlot(Object, Class)} can be used to create predefined frame slots. * The setter and getter methods in the {@link Frame} class can be used to access the current value * of a particular frame slot. * </p>
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/Frame.java Tue Feb 05 17:19:52 2013 +0100 @@ -31,6 +31,11 @@ public interface Frame { /** + * @return the object describing the layout of this frame + */ + FrameDescriptor getFrameDescriptor(); + + /** * @return the arguments used when calling this method */ Arguments getArguments();
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java Tue Feb 05 17:19:52 2013 +0100 @@ -33,7 +33,7 @@ protected final TypeConversion typeConversion; private final ArrayList<FrameSlotImpl> slots; private FrameVersionImpl lastVersion; - private final HashMap<String, FrameSlotImpl> nameToSlotMap; + private final HashMap<Object, FrameSlotImpl> identifierToSlotMap; public FrameDescriptor() { this(DefaultTypeConversion.getInstance()); @@ -42,32 +42,32 @@ public FrameDescriptor(TypeConversion typeConversion) { this.typeConversion = typeConversion; slots = new ArrayList<>(); - nameToSlotMap = new HashMap<>(); + identifierToSlotMap = new HashMap<>(); lastVersion = new FrameVersionImpl(); } - public FrameSlot addFrameSlot(String name) { - return addFrameSlot(name, typeConversion.getTopType()); + public FrameSlot addFrameSlot(Object identifier) { + return addFrameSlot(identifier, typeConversion.getTopType()); } - public FrameSlot addFrameSlot(String name, Class<?> type) { - assert !nameToSlotMap.containsKey(name); - FrameSlotImpl slot = new FrameSlotImpl(this, name, slots.size(), type); + public FrameSlot addFrameSlot(Object identifier, Class<?> type) { + assert !identifierToSlotMap.containsKey(identifier); + FrameSlotImpl slot = new FrameSlotImpl(this, identifier, slots.size(), type); slots.add(slot); - nameToSlotMap.put(name, slot); + identifierToSlotMap.put(identifier, slot); return slot; } - public FrameSlot findFrameSlot(String name) { - return nameToSlotMap.get(name); + public FrameSlot findFrameSlot(Object identifier) { + return identifierToSlotMap.get(identifier); } - public FrameSlot findOrAddFrameSlot(String name) { - FrameSlot result = findFrameSlot(name); + public FrameSlot findOrAddFrameSlot(Object identifier) { + FrameSlot result = findFrameSlot(identifier); if (result != null) { return result; } - return addFrameSlot(name); + return addFrameSlot(identifier); } public FrameVersion getCurrentVersion() { @@ -120,21 +120,21 @@ class FrameSlotImpl implements FrameSlot { private final FrameDescriptor descriptor; - private final String name; + private final Object identifier; private final int index; private Class<?> type; private ArrayList<FrameSlotTypeListener> listeners; - protected FrameSlotImpl(FrameDescriptor descriptor, String name, int index, Class<?> type) { + protected FrameSlotImpl(FrameDescriptor descriptor, Object identifier, int index, Class<?> type) { this.descriptor = descriptor; - this.name = name; + this.identifier = identifier; this.index = index; this.type = type; assert type != null; } - public String getName() { - return name; + public Object getIdentifier() { + return identifier; } public int getIndex() { @@ -189,7 +189,7 @@ @Override public String toString() { - return "[" + index + "," + name + "]"; + return "[" + index + "," + identifier + "]"; } @Override
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameSlot.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameSlot.java Tue Feb 05 17:19:52 2013 +0100 @@ -27,7 +27,7 @@ */ public interface FrameSlot { - String getName(); + Object getIdentifier(); int getIndex();
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/NativeFrame.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/NativeFrame.java Tue Feb 05 17:19:52 2013 +0100 @@ -126,4 +126,9 @@ @Override public void updateToLatestVersion() { } + + @Override + public FrameDescriptor getFrameDescriptor() { + throw new UnsupportedOperationException("native frame"); + } }
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultMaterializedFrame.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultMaterializedFrame.java Tue Feb 05 17:19:52 2013 +0100 @@ -117,4 +117,9 @@ public Frame unpack() { return this; } + + @Override + public FrameDescriptor getFrameDescriptor() { + return wrapped.getFrameDescriptor(); + } }
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultVirtualFrame.java Tue Feb 05 16:21:14 2013 +0100 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultVirtualFrame.java Tue Feb 05 17:19:52 2013 +0100 @@ -192,4 +192,9 @@ } currentVersion = version; } + + @Override + public FrameDescriptor getFrameDescriptor() { + return this.descriptor; + } }