Mercurial > hg > truffle
diff 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 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ReplaceObserver.java Wed Apr 29 17:16:53 2015 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/ReplaceObserver.java Mon May 04 11:24:13 2015 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,5 +31,10 @@ */ public interface ReplaceObserver { - void nodeReplaced(Node oldNode, Node newNode, CharSequence reason); + /** + * Returns <code>true</code> if the event is consumed and no parent nodes should be notified by + * for replaces. Returns <code>false</code> if the parent {@link Node} or {@link CallTarget} + * should get notified. + */ + boolean nodeReplaced(Node oldNode, Node newNode, CharSequence reason); }