/** * 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); } }
/** * 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); } }
/** * 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); } }
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)); } }
Map<Integer, FunctionInitializer> getFunctionInitializers() { return functionInitializers; }