private EventChainNode lazyUpdatedImpl(VirtualFrame frame) { EventChainNode oldChain; EventChainNode nextChain; Lock lock = getLock(); lock.lock(); try { Assumption localVersion = this.version; if (localVersion != null && localVersion.isValid()) { return this.chain; } nextChain = handler.createBindings(frame, ProbeNode.this); if (nextChain == null) { // chain is null -> remove wrapper; // Note: never set child nodes to null, can cause races InstrumentationHandler.removeWrapper(ProbeNode.this); return null; } oldChain = this.chain; this.chain = insert(nextChain); this.version = Truffle.getRuntime().createAssumption("Instruments unchanged"); } finally { lock.unlock(); } if (oldChain != null) { oldChain.onDispose(context, frame); } return nextChain; }
private EventChainNode lazyUpdatedImpl(VirtualFrame frame) { EventChainNode oldChain; EventChainNode nextChain; Lock lock = getLock(); lock.lock(); try { Assumption localVersion = this.version; if (localVersion != null && localVersion.isValid()) { return this.chain; } nextChain = handler.createBindings(frame, ProbeNode.this); if (nextChain == null) { // chain is null -> remove wrapper; // Note: never set child nodes to null, can cause races InstrumentationHandler.removeWrapper(ProbeNode.this); return null; } oldChain = this.chain; this.chain = insert(nextChain); this.version = Truffle.getRuntime().createAssumption("Instruments unchanged"); } finally { lock.unlock(); } if (oldChain != null) { oldChain.onDispose(context, frame); } return nextChain; }
final void onDispose(EventContext context, VirtualFrame frame) { try { innerOnDispose(context, frame); } catch (Throwable t) { if (!isSeenException()) { CompilerDirectives.transferToInterpreterAndInvalidate(); setSeenException(); } if (binding.isLanguageBinding()) { throw t; } else { exceptionEventForClientInstrument(binding, "onEnter", t); } } if (next != null) { next.onDispose(context, frame); } }
final void onDispose(EventContext context, VirtualFrame frame) { try { innerOnDispose(context, frame); } catch (Throwable t) { if (!isSeenException()) { CompilerDirectives.transferToInterpreterAndInvalidate(); setSeenException(); } if (binding.isLanguageBinding()) { throw t; } else { exceptionEventForClientInstrument(binding, "onEnter", t); } } if (next != null) { next.onDispose(context, frame); } }