Mercurial > hg > truffle
changeset 22254:7ec5eef84ecf
Truffle/Instrumentation: RootNode implementations can now override a method to declare that there is no content that can be instrumented.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Fri, 25 Sep 2015 14:16:21 -0700 |
parents | ffb52d4126bb |
children | e7643754d982 |
files | truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java Fri Sep 25 12:10:32 2015 -0700 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java Fri Sep 25 14:16:21 2015 -0700 @@ -165,7 +165,7 @@ * stack) without prior knowledge of the language it has come from. * * Used for instance to determine the language of a <code>RootNode<code>: - * + * * <pre> * <code> * rootNode.getExecutionContext().getLanguageShortName(); @@ -191,7 +191,16 @@ } public final void applyInstrumentation() { - Node.ACCESSOR.probeAST(this); + if (isInstrumentable()) { + Node.ACCESSOR.probeAST(this); + } + } + + /** + * Does this contain AST content that it is possible to instrument. + */ + protected boolean isInstrumentable() { + return true; } /**