Package com.oracle.truffle.api.instrumentation
package com.oracle.truffle.api.instrumentation
The instrumentation API provides a way to introspect and inject behavior into interpreters
written using the Truffle framework.
To adopt instrumentation support for a guest language implementation you need to subclass syntax
nodes of your language with
InstrumentableNode
.
For details please refer to InstrumentableNode
.
To use the instrumentation framework implementors must implement the
TruffleInstrument
interface. Please refer to
TruffleInstrument
for further details.
Guest languages that want to use the capabilities of the instrumentation framework can access
Instrumenter
for their
TruffleLanguage
by calling
TruffleLanguage.Env.lookup(Class)
.
SourceSectionFilter
created using guest languages
may be used to implement guest language features that require meta-programming capabilities.- Since:
- 0.8 or older
- See Also:
-
ClassDescriptionAn event representing an allocation of a guest language value.An instrumentation filter of allocations of guest language values.Listener to be notified about guest language value allocations.Reporter of guest language value allocations.Listener to be notified about changes of contexts in guest language application.EventBinding<T>An instrumentation handle for a subscription to a filtered stream of execution event notifications.Represents the context of an execution event.Represents a source execute event from a
ExecuteSourceListener
.A listener attached by anInstrumenter
to specific sources of a guest language program to listen to execute source events.A listener attached by anInstrumenter
to specific locations of a guest language program to listen to execution events.An event node created by anExecutionEventNodeFactory
for a specific locations of a guest language program to listen to instrumentation events.Event node factories are factories of event nodes for aprogram location
.Generates a default wrapper subclass of an annotatedInstrumentableNode
subclass.Annotates a method which should not be instrumented in the generated wrapper subclass.Annotates a method to be used as incoming value converter.Annotates a method to be used as outgoing value converter.An interface to be implemented byyield exceptions
.Interface implemented by ASTnodes
that may be instrumentable: an AST location where Truffle instruments are permitted to listen to before and after using execution event listeners.Nodes that the instrumentation framework inserts into guest language ASTs (betweeninstrumentable
guest language nodes and their parents) for the purpose of interposing on execution events and reporting them via the instrumentation framework.Provides capabilities to attach listeners for execution, load, output and allocation events.Represents a source load event from aLoadSourceListener
.A listener attached by anInstrumenter
to specific locations of a guest language program to listen to load source events.Represents a source section load event from aLoadSourceSectionListener
.A listener attached by anInstrumenter
to specific locations of a guest language program to listen to sources section load events.Add a filter for source sections that are nearest to the given source position, according to the guest language control flow.Builder to configureNearestSectionFilter
before creating its instance.Represents an event sink for instrumentation events that is embedded in the AST using wrappers if needed.Specifies a set of tags that are provided by alanguage
implementation.A source filter represents an expression for a subset of guest language sources that are used in an Truffle interpreter.A source section filter represents an expression for a subset of tagged source sections that are used in an Truffle interpreter.Represents a range between two indices within asource section filter
.Represents a predicate for source objects.Set of standard tags usable by language agnostic tools.Marks program locations that represent a call to other guest language functions, methods or closures.Marks program locations as to be considered expressions of the languages.Marks program locations to be considered as reads of variables of the languages.Marks program locations as bodies of a function, method or closure.Marks program locations as root of a function, method or closure.Marks program locations that represent a statement of a language.Marks program locations to be considered as try blocks, that are followed by catch.Marks program locations to be considered as writes of variables of the languages.Base class for tags used in the Truffle instrumentation framework.Annotation applied toTag
subclasses to specify the tag identifier.Listener that allows to be notified when threads become active and deactivated.Listener to be notified about changes of threads in guest language application.The service provider interface (SPI) for Truffle instruments: clients of Truffle instrumentation that may observe and inject behavior into interpreters written using the Truffle framework.Context local factory for Truffle instruments.Provider for creating context local and context thread local references.Context local factory for Truffle instruments.Access to instrumentation services as well as input, output, and error streams.Annotation that registers aninstrument
implementations for automatic discovery.