Java 类jdk.nashorn.internal.runtime.FunctionInitializer 实例源码

项目:OpenJSharp    文件:Compiler.java   
/**
 * 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);
    }
}
项目:openjdk-jdk10    文件:Compiler.java   
/**
 * 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);
    }
}
项目:openjdk9    文件:Compiler.java   
/**
 * 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);
    }
}
项目:kaziranga    文件:Compiler.java   
/**
 * 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);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Compiler.java   
/**
 * 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);
    }
}
项目:jdk8u_nashorn    文件:Compiler.java   
/**
 * 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);
    }
}
项目:infobip-open-jdk-8    文件:Compiler.java   
/**
 * 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);
    }
}
项目:OpenJSharp    文件:Compiler.java   
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));
    }
}
项目:infobip-open-jdk-8    文件:Compiler.java   
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));
    }
}
项目:OpenJSharp    文件:Compiler.java   
Map<Integer, FunctionInitializer> getFunctionInitializers() {
    return functionInitializers;
}
项目:infobip-open-jdk-8    文件:Compiler.java   
Map<Integer, FunctionInitializer> getFunctionInitializers() {
    return functionInitializers;
}