Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java @ 10862:8c570011b86f
Truffle: when a node is replaced, notify optimized call target and delay compilation.
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Tue, 23 Jul 2013 19:05:08 +0200 |
parents | e87d56a51047 |
children | 494b818b527c |
comparison
equal
deleted
inserted
replaced
10861:6872c61c1d3e | 10862:8c570011b86f |
---|---|
209 * | 209 * |
210 * @param newNode the replacement node | 210 * @param newNode the replacement node |
211 * @param reason the reason the replace supplied | 211 * @param reason the reason the replace supplied |
212 */ | 212 */ |
213 protected void onReplace(Node newNode, String reason) { | 213 protected void onReplace(Node newNode, String reason) { |
214 RootNode rootNode = NodeUtil.findParent(this, RootNode.class); | |
215 if (rootNode != null) { | |
216 if (rootNode.getCallTarget() instanceof ReplaceObserver) { | |
217 ((ReplaceObserver) rootNode.getCallTarget()).nodeReplaced(); | |
218 } | |
219 } | |
214 if (TruffleOptions.TraceRewrites) { | 220 if (TruffleOptions.TraceRewrites) { |
215 Class<? extends Node> from = getClass(); | 221 Class<? extends Node> from = getClass(); |
216 Class<? extends Node> to = newNode.getClass(); | 222 Class<? extends Node> to = newNode.getClass(); |
217 | 223 |
218 if (TruffleOptions.TraceRewritesFilterFromKind != null) { | 224 if (TruffleOptions.TraceRewritesFilterFromKind != null) { |