本文整理汇总了Java中jdk.nashorn.internal.runtime.CodeInstaller.getContext方法的典型用法代码示例。如果您正苦于以下问题:Java CodeInstaller.getContext方法的具体用法?Java CodeInstaller.getContext怎么用?Java CodeInstaller.getContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.runtime.CodeInstaller
的用法示例。
在下文中一共展示了CodeInstaller.getContext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: forOnDemandCompilation
import jdk.nashorn.internal.runtime.CodeInstaller; //导入方法依赖的package包/类
/**
* Creates a compiler for an on-demand compilation job.
*
* @param installer code installer
* @param source source to compile
* @param isStrict is this a strict compilation
* @param compiledFunction compiled function, if any
* @param types parameter and return value type information, if any is known
* @param invalidatedProgramPoints invalidated program points for recompilation
* @param typeInformationFile descriptor of the location where type information is persisted
* @param continuationEntryPoints continuation entry points for restof method
* @param runtimeScope runtime scope for recompilation type lookup in {@code TypeEvaluator}
* @return a new compiler
*/
public static Compiler forOnDemandCompilation(
final CodeInstaller installer,
final Source source,
final boolean isStrict,
final RecompilableScriptFunctionData compiledFunction,
final TypeMap types,
final Map<Integer, Type> invalidatedProgramPoints,
final Object typeInformationFile,
final int[] continuationEntryPoints,
final ScriptObject runtimeScope) {
final Context context = installer.getContext();
return new Compiler(context, installer, source, context.getErrorManager(), isStrict, true,
compiledFunction, types, invalidatedProgramPoints, typeInformationFile,
continuationEntryPoints, runtimeScope);
}
示例2: forInitialCompilation
import jdk.nashorn.internal.runtime.CodeInstaller; //导入方法依赖的package包/类
/**
* Creates a new compiler instance for initial compilation of a script.
*
* @param installer code installer
* @param source source to compile
* @param errors error manager
* @param isStrict is this a strict compilation
* @return a new compiler
*/
public static Compiler forInitialCompilation(
final CodeInstaller installer,
final Source source,
final ErrorManager errors,
final boolean isStrict) {
return new Compiler(installer.getContext(), installer, source, errors, isStrict);
}