comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameSlotImpl.java @ 9321:cd1a1d92b3e3

Frame API: Introduce FrameSlotKind.
author Andreas Woess <andreas.woess@jku.at>
date Thu, 25 Apr 2013 18:14:08 +0200
parents 07f8d136a05e
children 5d91b0b67cba
comparison
equal deleted inserted replaced
9320:3ef5689248b0 9321:cd1a1d92b3e3
25 public final class FrameSlotImpl implements FrameSlot { 25 public final class FrameSlotImpl implements FrameSlot {
26 26
27 private final FrameDescriptor descriptor; 27 private final FrameDescriptor descriptor;
28 private final Object identifier; 28 private final Object identifier;
29 private final int index; 29 private final int index;
30 private Class<?> type; 30 private FrameSlotKind kind;
31 31
32 protected FrameSlotImpl(FrameDescriptor descriptor, Object identifier, int index, Class<?> type) { 32 protected FrameSlotImpl(FrameDescriptor descriptor, Object identifier, int index, FrameSlotKind kind) {
33 this.descriptor = descriptor; 33 this.descriptor = descriptor;
34 this.identifier = identifier; 34 this.identifier = identifier;
35 this.index = index; 35 this.index = index;
36 this.type = type; 36 this.kind = kind;
37 } 37 }
38 38
39 public Object getIdentifier() { 39 public Object getIdentifier() {
40 return identifier; 40 return identifier;
41 } 41 }
42 42
43 public int getIndex() { 43 public int getIndex() {
44 return index; 44 return index;
45 } 45 }
46 46
47 public Class<?> getType() { 47 public FrameSlotKind getKind() {
48 return type; 48 return kind;
49 } 49 }
50 50
51 public void setType(final Class<?> type) { 51 public void setKind(final FrameSlotKind kind) {
52 assert this.type != type; 52 assert this.kind != kind;
53 this.type = type; 53 this.kind = kind;
54 this.descriptor.updateVersion(); 54 this.descriptor.updateVersion();
55 } 55 }
56 56
57 @Override 57 @Override
58 public String toString() { 58 public String toString() {
59 return "[" + index + "," + identifier + "," + type + "]"; 59 return "[" + index + "," + identifier + "," + kind + "]";
60 } 60 }
61 61
62 @Override 62 @Override
63 public FrameDescriptor getFrameDescriptor() { 63 public FrameDescriptor getFrameDescriptor() {
64 return this.descriptor; 64 return this.descriptor;