comparison truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/instrument/InstrumentationTest.java @ 22226:c896a8e70777

Truffle/Instrumentation: Redesign instrumentation node classes to reduce the public API exposure. - ProbeNode is no longer public - Public interface InstrumentationNode.TruffleEvents is now abstract class EventHandlerNode with package private constructor - Interface ProbeNode.WrapperNode is no longer inside ProbeNode and has been expanded slightly so ProbeNode can be package private
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Sun, 20 Sep 2015 15:51:39 -0700
parents a0fa69e3e60e
children 3f2052afcb6d
comparison
equal deleted inserted replaced
22225:a0fa69e3e60e 22226:c896a8e70777
35 import com.oracle.truffle.api.instrument.ASTProber; 35 import com.oracle.truffle.api.instrument.ASTProber;
36 import com.oracle.truffle.api.instrument.Instrument; 36 import com.oracle.truffle.api.instrument.Instrument;
37 import com.oracle.truffle.api.instrument.Instrumenter; 37 import com.oracle.truffle.api.instrument.Instrumenter;
38 import com.oracle.truffle.api.instrument.Probe; 38 import com.oracle.truffle.api.instrument.Probe;
39 import com.oracle.truffle.api.instrument.ProbeListener; 39 import com.oracle.truffle.api.instrument.ProbeListener;
40 import com.oracle.truffle.api.instrument.ProbeNode; 40 import com.oracle.truffle.api.instrument.WrapperNode;
41 import com.oracle.truffle.api.instrument.ProbeNode.WrapperNode;
42 import com.oracle.truffle.api.instrument.SimpleInstrumentListener; 41 import com.oracle.truffle.api.instrument.SimpleInstrumentListener;
43 import com.oracle.truffle.api.instrument.StandardInstrumentListener; 42 import com.oracle.truffle.api.instrument.StandardInstrumentListener;
44 import com.oracle.truffle.api.instrument.SyntaxTag; 43 import com.oracle.truffle.api.instrument.SyntaxTag;
45 import com.oracle.truffle.api.instrument.impl.DefaultProbeListener; 44 import com.oracle.truffle.api.instrument.impl.DefaultProbeListener;
46 import com.oracle.truffle.api.instrument.impl.DefaultSimpleInstrumentListener; 45 import com.oracle.truffle.api.instrument.impl.DefaultSimpleInstrumentListener;
58 * <h3>AST Instrumentation</h3> 57 * <h3>AST Instrumentation</h3>
59 * 58 *
60 * Instrumentation allows the insertion into Truffle ASTs language-specific instances of 59 * Instrumentation allows the insertion into Truffle ASTs language-specific instances of
61 * {@link WrapperNode} that propagate execution events through a {@link Probe} to any instances of 60 * {@link WrapperNode} that propagate execution events through a {@link Probe} to any instances of
62 * {@link Instrument} that might be attached to the particular probe by tools. 61 * {@link Instrument} that might be attached to the particular probe by tools.
63 * <ol>
64 * <li>Creates a simple add AST</li>
65 * <li>Verifies its structure</li>
66 * <li>"Probes" the add node by adding a {@link WrapperNode} and associated {@link Probe}</li>
67 * <li>Attaches a simple {@link Instrument} to the node via the Probe's {@link ProbeNode}</li>
68 * <li>Verifies the structure of the probed AST</li>
69 * <li>Verifies the execution of the probed AST</li>
70 * <li>Verifies the results observed by the instrument.</li>
71 * </ol>
72 * To do these tests, several required classes have been implemented in their most basic form, only
73 * implementing the methods necessary for the tests to pass, with stubs elsewhere.
74 */ 62 */
75 public class InstrumentationTest { 63 public class InstrumentationTest {
76 64
77 @Test 65 @Test
78 public void testProbing() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, IOException { 66 public void testProbing() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, IOException {