public interface AllocationListener
AllocationReporter.
Use
Instrumenter.attachAllocationListener(com.oracle.truffle.api.instrumentation.AllocationEventFilter, com.oracle.truffle.api.instrumentation.AllocationListener)
to register an implementation of this listener. Use EventBinding.dispose() to unregister.
The listener gets called before the actual allocation and right
after it. The
calls to these methods are always in pairs, unless the programs crashes in between. Nested
allocations are supported, several calls to onEnter prior every sub-value allocation
can be followed by the appropriate number of onReturnValue calls after the
sub-values are allocated, in the opposite order.
| Modifier and Type | Method and Description |
|---|---|
void |
onEnter(AllocationEvent event)
Notifies about an intent to allocate or re-allocate a guest language value.
|
void |
onReturnValue(AllocationEvent event)
Notifies about an allocated guest language value.
|
void onEnter(AllocationEvent event)
AllocationListener.onReturnValue(com.oracle.truffle.api.instrumentation.AllocationEvent) after the
successful allocation.event - the event describing the intended allocationvoid onReturnValue(AllocationEvent event)
AllocationListener.onEnter(com.oracle.truffle.api.instrumentation.AllocationEvent) call and right after
the allocation is performed. When
onEnter provided a
non-null value in the event, it was re-allocated and the same value instance is
in this event.event - the event describing the finished allocation