本文整理汇总了Java中jdk.nashorn.internal.runtime.FunctionInitializer类的典型用法代码示例。如果您正苦于以下问题:Java FunctionInitializer类的具体用法?Java FunctionInitializer怎么用?Java FunctionInitializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FunctionInitializer类属于jdk.nashorn.internal.runtime包,在下文中一共展示了FunctionInitializer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: persistClassInfo
import jdk.nashorn.internal.runtime.FunctionInitializer; //导入依赖的package包/类
/**
* Persist current compilation with the given {@code cacheKey}.
* @param cacheKey cache key
* @param functionNode function node
*/
public void persistClassInfo(final String cacheKey, final FunctionNode functionNode) {
if (cacheKey != null && env._persistent_cache) {
Map<Integer, FunctionInitializer> initializers;
// If this is an on-demand compilation create a function initializer for the function being compiled.
// Otherwise use function initializer map generated by codegen.
if (functionInitializers == null) {
initializers = new HashMap<>();
final FunctionInitializer initializer = new FunctionInitializer(functionNode, getInvalidatedProgramPoints());
initializers.put(functionNode.getId(), initializer);
} else {
initializers = functionInitializers;
}
final String mainClassName = getFirstCompileUnit().getUnitClassName();
installer.storeScript(cacheKey, source, mainClassName, bytecode, initializers, constantData.toArray(), compilationId);
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:Compiler.java
示例2: persistClassInfo
import jdk.nashorn.internal.runtime.FunctionInitializer; //导入依赖的package包/类
/**
* Persist current compilation with the given {@code cacheKey}.
* @param cacheKey cache key
* @param functionNode function node
*/
public void persistClassInfo(final String cacheKey, final FunctionNode functionNode) {
if (cacheKey != null && env._persistent_cache) {
// If this is an on-demand compilation create a function initializer for the function being compiled.
// Otherwise use function initializer map generated by codegen.
final Map<Integer, FunctionInitializer> initializers = new HashMap<>();
if (isOnDemandCompilation()) {
initializers.put(functionNode.getId(), new FunctionInitializer(functionNode, getInvalidatedProgramPoints()));
} else {
for (final CompileUnit compileUnit : getCompileUnits()) {
for (final FunctionNode fn : compileUnit.getFunctionNodes()) {
initializers.put(fn.getId(), new FunctionInitializer(fn));
}
}
}
final String mainClassName = getFirstCompileUnit().getUnitClassName();
installer.storeScript(cacheKey, source, mainClassName, bytecode, initializers, constantData.toArray(), compilationId);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:Compiler.java
示例3: persistClassInfo
import jdk.nashorn.internal.runtime.FunctionInitializer; //导入依赖的package包/类
/**
* Persist current compilation with the given {@code cacheKey}.
* @param cacheKey cache key
* @param functionNode function node
*/
public void persistClassInfo(final String cacheKey, final FunctionNode functionNode) {
if (cacheKey != null && env._persistent_cache) {
// If this is an on-demand compilation create a function initializer for the function being compiled.
// Otherwise use function initializer map generated by codegen.
Map<Integer, FunctionInitializer> initializers = new HashMap<>();
if (isOnDemandCompilation()) {
initializers.put(functionNode.getId(), new FunctionInitializer(functionNode, getInvalidatedProgramPoints()));
} else {
for (final CompileUnit compileUnit : getCompileUnits()) {
for (final FunctionNode fn : compileUnit.getFunctionNodes()) {
initializers.put(fn.getId(), new FunctionInitializer(fn));
}
}
}
final String mainClassName = getFirstCompileUnit().getUnitClassName();
installer.storeScript(cacheKey, source, mainClassName, bytecode, initializers, constantData.toArray(), compilationId);
}
}
开发者ID:malaporte,项目名称:kaziranga,代码行数:24,代码来源:Compiler.java
示例4: addFunctionInitializer
import jdk.nashorn.internal.runtime.FunctionInitializer; //导入依赖的package包/类
void addFunctionInitializer(final RecompilableScriptFunctionData functionData, final FunctionNode functionNode) {
if (functionInitializers == null) {
functionInitializers = new HashMap<>();
}
if (!functionInitializers.containsKey(functionData)) {
functionInitializers.put(functionData.getFunctionNodeId(), new FunctionInitializer(functionNode));
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:Compiler.java
示例5: getFunctionInitializers
import jdk.nashorn.internal.runtime.FunctionInitializer; //导入依赖的package包/类
Map<Integer, FunctionInitializer> getFunctionInitializers() {
return functionInitializers;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:Compiler.java
注:本文中的jdk.nashorn.internal.runtime.FunctionInitializer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论