Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/instrument/Instrument.java @ 21354:575032310b2c
Truffle/Instrumentation: runtime failures executing an AdvancedInstrument root are now reported automatically via a new mehtod onAdvancedInstrumentResultListener.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 12 May 2015 14:48:33 -0700 |
parents | 876e710523c5 |
children | 442b57a7f208 |
comparison
equal
deleted
inserted
replaced
21353:876e710523c5 | 21354:575032310b2c |
---|---|
434 adoptChildren(); | 434 adoptChildren(); |
435 AdvancedInstrument.this.probe.invalidateProbeUnchanged(); | 435 AdvancedInstrument.this.probe.invalidateProbeUnchanged(); |
436 } | 436 } |
437 } | 437 } |
438 if (instrumentRoot != null) { | 438 if (instrumentRoot != null) { |
439 // TODO (mlvdv) should report exception ; non-trivial architectural change | 439 final AdvancedInstrumentResultListener resultListener = AdvancedInstrument.this.rootFactory.resultListener(); |
440 instrumentRoot.executeRoot(node, vFrame); | 440 try { |
441 final Object result = instrumentRoot.executeRoot(node, vFrame); | |
442 if (resultListener != null) { | |
443 resultListener.notifyResult(node, vFrame, result); | |
444 } | |
445 } catch (RuntimeException ex) { | |
446 if (resultListener != null) { | |
447 resultListener.notifyFailure(node, vFrame, ex); | |
448 } | |
449 } | |
441 } | 450 } |
442 if (nextInstrumentNode != null) { | 451 if (nextInstrumentNode != null) { |
443 nextInstrumentNode.enter(node, vFrame); | 452 nextInstrumentNode.enter(node, vFrame); |
444 } | 453 } |
445 } | 454 } |