Mercurial > hg > truffle
diff graal/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/instrument/SLInstrumentTestRunner.java @ 19818:907128d02b31
Truffle/Instrumentation: For clients of Instrumentation, replace the TruffleEventListener interface with two: InstrumentListener, and ASTInstrumentListener. The former is simple, completely Truffle-safe (can't affect Truffle execution), and designed for simple tools. The latter is similar to the previous interface.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Thu, 12 Mar 2015 18:03:05 -0700 |
parents | 128586040207 |
children | 73b1844b5b14 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/instrument/SLInstrumentTestRunner.java Thu Mar 12 15:02:01 2015 -0700 +++ b/graal/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/instrument/SLInstrumentTestRunner.java Thu Mar 12 18:03:05 2015 -0700 @@ -36,10 +36,8 @@ import org.junit.runners.*; import org.junit.runners.model.*; -import com.oracle.truffle.api.frame.*; import com.oracle.truffle.api.instrument.*; import com.oracle.truffle.api.instrument.impl.*; -import com.oracle.truffle.api.nodes.*; import com.oracle.truffle.api.source.*; import com.oracle.truffle.sl.factory.*; import com.oracle.truffle.sl.nodes.instrument.*; @@ -271,12 +269,12 @@ } /** - * This sample instrument listener provides prints the value of an assignment (after the - * assignment is complete) to the {@link PrintStream} specified in the constructor. This - * instrument can only be attached to a wrapped {@link SLWriteLocalVariableNode}, but provides - * no guards to protect it from being attached elsewhere. + * This sample listener provides prints the value of an assignment (after the assignment is + * complete) to the {@link PrintStream} specified in the constructor. This listener can only be + * attached at {@link SLWriteLocalVariableNode}, but provides no guards to protect it from being + * attached elsewhere. */ - public final class SLPrintAssigmentValueListener extends DefaultEventListener { + public final class SLPrintAssigmentValueListener extends DefaultInstrumentListener { private PrintStream output; @@ -285,7 +283,7 @@ } @Override - public void returnValue(Node node, VirtualFrame frame, Object result) { + public void returnValue(Probe probe, Object result) { output.println(result); } }