Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ReplaceObserver.java @ 21204:4a5df5570b7f
Truffle: make ReplaceObserver return a boolean in order to consume replace events. It can be useful for nodes to consume all replace events if they are always executed behind a @TruffleBoundary.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 04 May 2015 11:24:13 +0200 |
parents | 6189c1983cd3 |
children |
comparison
equal
deleted
inserted
replaced
21203:9f45587ad8f5 | 21204:4a5df5570b7f |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this | 7 * published by the Free Software Foundation. Oracle designates this |
29 /** | 29 /** |
30 * An observer that is notified whenever a child node is replaced. | 30 * An observer that is notified whenever a child node is replaced. |
31 */ | 31 */ |
32 public interface ReplaceObserver { | 32 public interface ReplaceObserver { |
33 | 33 |
34 void nodeReplaced(Node oldNode, Node newNode, CharSequence reason); | 34 /** |
35 * Returns <code>true</code> if the event is consumed and no parent nodes should be notified by | |
36 * for replaces. Returns <code>false</code> if the parent {@link Node} or {@link CallTarget} | |
37 * should get notified. | |
38 */ | |
39 boolean nodeReplaced(Node oldNode, Node newNode, CharSequence reason); | |
35 } | 40 } |