/** @since 0.8 or earlier */ @Override public void invalidate() { first.invalidate(); second.invalidate(); }
/** @since 0.17 or earlier */ @Override public final boolean isLeaf() { Assumption assumption = leafAssumption; return assumption == null || assumption.isValid(); }
/** * Invalidates the global single context assumption when creating an unbound Engine. */ static void invalidateStaticContextAssumption() { SingleContextState state = singleContextState; if (state.singleContextAssumption.isValid()) { synchronized (state) { if (state.singleContextAssumption.isValid()) { state.singleContextAssumption.invalidate(); state.singleContext = null; } } } }
@Override public Assumption apply(Assumption prev) { return prev == null ? null : runtime().createAssumption(prev.getName()); } });
void profileIndirectCall() { Assumption argumentTypesAssumption = profiledArgumentTypesAssumption; if (argumentTypesAssumption != null && argumentTypesAssumption.isValid()) { // Argument profiling is not possible for targets of indirect calls. CompilerDirectives.transferToInterpreter(); argumentTypesAssumption.invalidate(); profiledArgumentTypes = null; } }
void notifyEngineDisposed() { if (singleContext.isValid()) { // do not invalidate assumptions if engine is disposed anyway cachedSingleContext = UNSET_CONTEXT; } } }
/** @since 0.33 */ @Override public void invalidate(String message) { first.invalidate(message); second.invalidate(message); }
private void transitionToMultiThreaded() { assert singleThreaded.isValid(); assert Thread.holdsLock(this); for (PolyglotLanguageContext context : contexts) { if (!context.isInitialized()) { continue; } LANGUAGE.initializeMultiThreading(context.env); } singleThreaded.invalidate(); singleThreadedConstant.invalidate(); }
/** * 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; }
void notifyLanguageFreed() { if (singleContext.isValid()) { // do not invalidate assumptions if engine is disposed anyway cachedSingleContext = UNSET_CONTEXT; cachedSingleLanguageContext = UNSET_CONTEXT; } } }
/** * Invalidates this assumption. Performs no operation, if the assumption is already invalid. * * @param message a message stating the reason of the invalidation * @since 0.33 */ default void invalidate(String message) { invalidate(); }
private void transitionToMultiThreaded() { assert singleThreaded.isValid(); assert Thread.holdsLock(this); for (PolyglotLanguageContext context : contexts) { if (context.isInitialized()) { LANGUAGE.initializeMultiThreading(context.env); } } singleThreaded.invalidate(); singleThreadedConstant.invalidate(); }
/** @since 0.17 or earlier */ @Override public final boolean isLeaf() { Assumption assumption = leafAssumption; return assumption == null || assumption.isValid(); }
synchronized void invalidate() { Assumption localVersion = this.version; if (localVersion != null) { localVersion.invalidate(); } }
void notifyContextCreate(Env env) { if (singleContext.isValid()) { Object cachedSingle = this.cachedSingleContext; assert cachedSingle != LANGUAGE.getContext(env); if (cachedSingle == UNSET_CONTEXT) { if (singleContext.isValid()) { cachedSingleContext = LANGUAGE.getContext(env); } } else { singleContext.invalidate(); cachedSingleContext = UNSET_CONTEXT; } } }
@Override public final boolean isLeaf() { return leafAssumption == null || leafAssumption.isValid(); }
/** * Invalidates this assumption. Performs no operation, if the assumption is already invalid. * * @param message a message stating the reason of the invalidation * @since 0.33 */ default void invalidate(String message) { invalidate(); }