Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameDescriptor.java @ 16051:da9b9b625818
Truffle FrameDescriptor: add compiler asserts
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Fri, 06 Jun 2014 09:40:22 +0200 |
parents | 042a2d972174 |
children | 9d55732d0880 |
comparison
equal
deleted
inserted
replaced
16050:7b37f1b6d188 | 16051:da9b9b625818 |
---|---|
55 public FrameSlot addFrameSlot(Object identifier) { | 55 public FrameSlot addFrameSlot(Object identifier) { |
56 return addFrameSlot(identifier, FrameSlotKind.Illegal); | 56 return addFrameSlot(identifier, FrameSlotKind.Illegal); |
57 } | 57 } |
58 | 58 |
59 public FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind) { | 59 public FrameSlot addFrameSlot(Object identifier, FrameSlotKind kind) { |
60 CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); | |
60 assert !identifierToSlotMap.containsKey(identifier); | 61 assert !identifierToSlotMap.containsKey(identifier); |
61 FrameSlot slot = new FrameSlot(this, identifier, slots.size(), kind); | 62 FrameSlot slot = new FrameSlot(this, identifier, slots.size(), kind); |
62 slots.add(slot); | 63 slots.add(slot); |
63 identifierToSlotMap.put(identifier, slot); | 64 identifierToSlotMap.put(identifier, slot); |
64 updateVersion(); | 65 updateVersion(); |
85 } | 86 } |
86 return addFrameSlot(identifier, kind); | 87 return addFrameSlot(identifier, kind); |
87 } | 88 } |
88 | 89 |
89 public void removeFrameSlot(Object identifier) { | 90 public void removeFrameSlot(Object identifier) { |
91 CompilerAsserts.neverPartOfCompilation("interpreter-only. includes hashmap operations."); | |
90 assert identifierToSlotMap.containsKey(identifier); | 92 assert identifierToSlotMap.containsKey(identifier); |
91 slots.remove(identifierToSlotMap.get(identifier)); | 93 slots.remove(identifierToSlotMap.get(identifier)); |
92 identifierToSlotMap.remove(identifier); | 94 identifierToSlotMap.remove(identifier); |
93 updateVersion(); | 95 updateVersion(); |
94 getNotInFrameAssumption(identifier); | 96 getNotInFrameAssumption(identifier); |
102 return Collections.unmodifiableList(slots); | 104 return Collections.unmodifiableList(slots); |
103 } | 105 } |
104 | 106 |
105 /** | 107 /** |
106 * Retrieve the list of all the identifiers associated with this frame descriptor. | 108 * Retrieve the list of all the identifiers associated with this frame descriptor. |
107 * | 109 * |
108 * @return the list of all the identifiers in this frame descriptor | 110 * @return the list of all the identifiers in this frame descriptor |
109 */ | 111 */ |
110 public Set<Object> getIdentifiers() { | 112 public Set<Object> getIdentifiers() { |
111 return Collections.unmodifiableSet(identifierToSlotMap.keySet()); | 113 return Collections.unmodifiableSet(identifierToSlotMap.keySet()); |
112 } | 114 } |