protected static void check(Assumption assumption) throws InvalidAssumptionException { if (assumption != null) { assumption.check(); } }
/** * Get the current value, updating it if it has been {@link #set}. The compiler may be able to * make this method return a constant value, but still accommodate mutation. */ public T get() { try { assumption.check(); } catch (InvalidAssumptionException e) { // No need to rewrite anything - just pick up the new values } return value; }
/** * Get the current value, updating it if it has been {@link #set}. The compiler may be able to * make this method return a constant value, but still accommodate mutation. * * @since 0.8 or earlier */ public T get() { try { assumption.check(); } catch (InvalidAssumptionException e) { // No need to rewrite anything - just pick up the new values } return value; }
/** * Get the current value, updating it if it has been {@link #set}. The compiler may be able to * make this method return a constant value, but still accommodate mutation. * * @since 0.8 or earlier */ public T get() { try { assumption.check(); } catch (InvalidAssumptionException e) { // No need to rewrite anything - just pick up the new values } return value; }
/** * To be called wherever in the Probe/Instrument chain there are dependencies on the probe * state's @CompilatonFinal fields. */ void checkProbeUnchanged() { try { probeStateUnchangedAssumption.check(); } catch (InvalidAssumptionException ex) { // Failure creates an implicit deoptimization // Get the assumption associated with the new probe state this.probeStateUnchangedAssumption = probeStateUnchangedCyclic.getAssumption(); } }
@Override protected Object executeDispatch(VirtualFrame frame, LuaFunction function, Object[] arguments) { if (this.cachedMethod == function) { try { cachedTargetStable.check(); return callCachedTargetNode.call(frame, arguments); } catch (InvalidAssumptionException ex) { replace(nextNode); } } return nextNode.executeDispatch(frame, function, arguments); } }