@Override public Object createEnvContext(Env env) { Object context = env.getSpi().createContext(env); env.context = context; Assumption contextUnchanged = env.contextUnchangedAssumption; env.contextUnchangedAssumption = Truffle.getRuntime().createAssumption("Language context unchanged"); contextUnchanged.invalidate(); return context; }
private void outListChanged() { Assumption changed = outListUnchanged; outListUnchanged = Truffle.getRuntime().createAssumption("Unchanged list"); changed.invalidate(); }
/** * Directive for the compiler to discontinue compilation at this code position and instead * insert a transfer to the interpreter. */ public static void transferToInterpreter() { if (inInterpreter()) { Truffle.getRuntime().notifyTransferToInterpreter(); } }
/** * Set a new value, which will be picked up the next time {@link #get} is called. */ public void set(T newValue) { CompilerDirectives.transferToInterpreter(); value = newValue; final Assumption oldAssumption = assumption; assumption = Truffle.getRuntime().createAssumption(name); oldAssumption.invalidate(); }
private boolean setLevelNum(final int value) { if (this.levelNum != value) { this.levelNum = value; final Assumption currentAssumtion = levelNumStable; levelNumStable = Truffle.getRuntime().createAssumption("Log Level Value stable for: " + getName()); currentAssumtion.invalidate(); return true; } return false; }
@Override public CallTarget accessUnbox() { return Truffle.getRuntime().createCallTarget(new RootNode(null) { @Override public Object execute(VirtualFrame frame) { BoxedValue boxed = (BoxedValue) ForeignAccess.getReceiver(frame); return boxed.value; } }); }
private synchronized Assumption getConditionUnchanged() { if (conditionUnchanged == null) { conditionUnchanged = Truffle.getRuntime().createAssumption("Breakpoint condition unchanged."); } return conditionUnchanged; }
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; } }
OutputStreamList getOutList() { if (outListUnchanged.isValid()) { return outList; } else { CompilerDirectives.transferToInterpreterAndInvalidate(); return outList; } }
/** * Assertion that the corresponding value is reduced to a constant during compilation. * * @param value the value that must be constant during compilation */ public static <T> void compilationConstant(Object value) { if (!CompilerDirectives.isCompilationConstant(value)) { neverPartOfCompilation("Value is not compilation constant"); } }
@Option.Group(PolyglotImpl.OPTION_GROUP_ENGINE) final class PolyglotEngineOptions { static final String PREINITIALIZE_CONTEXT_NAME = "PreinitializeContexts"; @Option(name = PREINITIALIZE_CONTEXT_NAME, category = OptionCategory.EXPERT, help = "Preinitialize language contexts for given languages.") static final OptionKey<String> PreinitializeContexts = new OptionKey<>( null, OptionType.defaultType(String.class)); }
/** * Directive for the compiler to discontinue compilation at this code position and instead * insert a transfer to the interpreter, invalidating the currently executing machine code. * * @since 0.8 or earlier */ public static void transferToInterpreterAndInvalidate() { if (inInterpreter()) { Truffle.getRuntime().notifyTransferToInterpreter(); } }
private void outListChanged() { Assumption changed = outListUnchanged; outListUnchanged = Truffle.getRuntime().createAssumption("Unchanged list"); changed.invalidate(); }
@Override public Object createEnvContext(Env env) { Object context = env.getSpi().createContext(env); env.context = context; Assumption contextUnchanged = env.contextUnchangedAssumption; env.contextUnchangedAssumption = Truffle.getRuntime().createAssumption("Language context unchanged"); contextUnchanged.invalidate(); return context; }
private synchronized Assumption getConditionExistsUnchanged() { if (conditionExistsUnchanged == null) { conditionExistsUnchanged = Truffle.getRuntime().createAssumption("Breakpoint condition existence unchanged."); } return conditionExistsUnchanged; }
/** * Directive for the compiler to discontinue compilation at this code position and instead * insert a transfer to the interpreter, invalidating the currently executing machine code. * * @since 0.8 or earlier */ public static void transferToInterpreterAndInvalidate() { if (inInterpreter()) { Truffle.getRuntime().notifyTransferToInterpreter(); } }
void set(boolean value) { if (this.value != value) { this.value = value; Assumption old = this.unchanged; unchanged = Truffle.getRuntime().createAssumption("Unchanged boolean"); old.invalidate(); } }
private synchronized Assumption getConditionExistsUnchanged() { if (conditionExistsUnchanged == null) { conditionExistsUnchanged = Truffle.getRuntime().createAssumption("Breakpoint condition existence unchanged."); } return conditionExistsUnchanged; }
/** * Directive for the compiler to discontinue compilation at this code position and instead * insert a transfer to the interpreter, invalidating the currently executing machine code. */ public static void transferToInterpreterAndInvalidate() { if (inInterpreter()) { Truffle.getRuntime().notifyTransferToInterpreter(); } }
void set(boolean value) { if (this.value != value) { this.value = value; Assumption old = this.unchanged; unchanged = Truffle.getRuntime().createAssumption("Unchanged boolean"); old.invalidate(); } }