jdk.nashorn.internal.codegen.OptimisticTypesPersistence Java Examples

The following examples show how to use jdk.nashorn.internal.codegen.OptimisticTypesPersistence. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecompilableScriptFunctionData.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
        final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
        final int[] continuationEntryPoints) {
    final TypeMap typeMap = typeMap(actualCallSiteType);
    final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
    final Object typeInformationFile = OptimisticTypesPersistence.getLocationDescriptor(source, functionNodeId, paramTypes);
    final Context context = Context.getContextTrusted();
    return new Compiler(
            context,
            context.getEnv(),
            getInstallerForNewCode(),
            functionNode.getSource(),  // source
            context.getErrorManager(),
            isStrict() | functionNode.isStrict(), // is strict
            true,       // is on demand
            this,       // compiledFunction, i.e. this RecompilableScriptFunctionData
            typeMap,    // type map
            getEffectiveInvalidatedProgramPoints(invalidatedProgramPoints, typeInformationFile), // invalidated program points
            typeInformationFile,
            continuationEntryPoints, // continuation entry points
            runtimeScope); // runtime scope
}
 
Example #2
Source File: RecompilableScriptFunctionData.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
        final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
        final int[] continuationEntryPoints) {
    final TypeMap typeMap = typeMap(actualCallSiteType);
    final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
    final Object typeInformationFile = OptimisticTypesPersistence.getLocationDescriptor(source, functionNodeId, paramTypes);
    return Compiler.forOnDemandCompilation(
            getInstallerForNewCode(),
            functionNode.getSource(),  // source
            isStrict() | functionNode.isStrict(), // is strict
            this,       // compiledFunction, i.e. this RecompilableScriptFunctionData
            typeMap,    // type map
            getEffectiveInvalidatedProgramPoints(invalidatedProgramPoints, typeInformationFile), // invalidated program points
            typeInformationFile,
            continuationEntryPoints, // continuation entry points
            runtimeScope); // runtime scope
}
 
Example #3
Source File: RecompilableScriptFunctionData.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
        final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
        final int[] continuationEntryPoints) {
    final TypeMap typeMap = typeMap(actualCallSiteType);
    final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
    final Object typeInformationFile = OptimisticTypesPersistence.getLocationDescriptor(source, functionNodeId, paramTypes);
    return Compiler.forOnDemandCompilation(
            getInstallerForNewCode(),
            functionNode.getSource(),  // source
            isStrict() | functionNode.isStrict(), // is strict
            this,       // compiledFunction, i.e. this RecompilableScriptFunctionData
            typeMap,    // type map
            getEffectiveInvalidatedProgramPoints(invalidatedProgramPoints, typeInformationFile), // invalidated program points
            typeInformationFile,
            continuationEntryPoints, // continuation entry points
            runtimeScope); // runtime scope
}
 
Example #4
Source File: RecompilableScriptFunctionData.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
        final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
        final int[] continuationEntryPoints) {
    final TypeMap typeMap = typeMap(actualCallSiteType);
    final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
    final Object typeInformationFile = OptimisticTypesPersistence.getLocationDescriptor(source, functionNodeId, paramTypes);
    return Compiler.forOnDemandCompilation(
            getInstallerForNewCode(),
            functionNode.getSource(),  // source
            isStrict() | functionNode.isStrict(), // is strict
            this,       // compiledFunction, i.e. this RecompilableScriptFunctionData
            typeMap,    // type map
            getEffectiveInvalidatedProgramPoints(invalidatedProgramPoints, typeInformationFile), // invalidated program points
            typeInformationFile,
            continuationEntryPoints, // continuation entry points
            runtimeScope); // runtime scope
}
 
Example #5
Source File: RecompilableScriptFunctionData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
        final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
        final int[] continuationEntryPoints) {
    final TypeMap typeMap = typeMap(actualCallSiteType);
    final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
    final Object typeInformationFile = OptimisticTypesPersistence.getLocationDescriptor(source, functionNodeId, paramTypes);
    return Compiler.forOnDemandCompilation(
            getInstallerForNewCode(),
            functionNode.getSource(),  // source
            isStrict() | functionNode.isStrict(), // is strict
            this,       // compiledFunction, i.e. this RecompilableScriptFunctionData
            typeMap,    // type map
            getEffectiveInvalidatedProgramPoints(invalidatedProgramPoints, typeInformationFile), // invalidated program points
            typeInformationFile,
            continuationEntryPoints, // continuation entry points
            runtimeScope); // runtime scope
}
 
Example #6
Source File: RecompilableScriptFunctionData.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
        final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
        final int[] continuationEntryPoints) {
    final TypeMap typeMap = typeMap(actualCallSiteType);
    final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
    final Object typeInformationFile = OptimisticTypesPersistence.getLocationDescriptor(source, functionNodeId, paramTypes);
    return Compiler.forOnDemandCompilation(
            getInstallerForNewCode(),
            functionNode.getSource(),  // source
            isStrict() | functionNode.isStrict(), // is strict
            this,       // compiledFunction, i.e. this RecompilableScriptFunctionData
            typeMap,    // type map
            getEffectiveInvalidatedProgramPoints(invalidatedProgramPoints, typeInformationFile), // invalidated program points
            typeInformationFile,
            continuationEntryPoints, // continuation entry points
            runtimeScope); // runtime scope
}
 
Example #7
Source File: RecompilableScriptFunctionData.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
Compiler getCompiler(final FunctionNode functionNode, final MethodType actualCallSiteType,
        final ScriptObject runtimeScope, final Map<Integer, Type> invalidatedProgramPoints,
        final int[] continuationEntryPoints) {
    final TypeMap typeMap = typeMap(actualCallSiteType);
    final Type[] paramTypes = typeMap == null ? null : typeMap.getParameterTypes(functionNodeId);
    final Object typeInformationFile = OptimisticTypesPersistence.getLocationDescriptor(source, functionNodeId, paramTypes);
    return Compiler.forOnDemandCompilation(
            getInstallerForNewCode(),
            functionNode.getSource(),  // source
            isStrict() | functionNode.isStrict(), // is strict
            this,       // compiledFunction, i.e. this RecompilableScriptFunctionData
            typeMap,    // type map
            getEffectiveInvalidatedProgramPoints(invalidatedProgramPoints, typeInformationFile), // invalidated program points
            typeInformationFile,
            continuationEntryPoints, // continuation entry points
            runtimeScope); // runtime scope
}
 
Example #8
Source File: RecompilableScriptFunctionData.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the function being compiled already has its own invalidated program points map, use it. Otherwise, attempt to
 * load invalidated program points map from the persistent type info cache.
 * @param invalidatedProgramPoints the function's current invalidated program points map. Null if the function
 * doesn't have it.
 * @param typeInformationFile the object describing the location of the persisted type information.
 * @return either the existing map, or a loaded map from the persistent type info cache, or a new empty map if
 * neither an existing map or a persistent cached type info is available.
 */
@SuppressWarnings("unused")
private static Map<Integer, Type> getEffectiveInvalidatedProgramPoints(
        final Map<Integer, Type> invalidatedProgramPoints, final Object typeInformationFile) {
    if(invalidatedProgramPoints != null) {
        return invalidatedProgramPoints;
    }
    final Map<Integer, Type> loadedProgramPoints = OptimisticTypesPersistence.load(typeInformationFile);
    return loadedProgramPoints != null ? loadedProgramPoints : new TreeMap<Integer, Type>();
}
 
Example #9
Source File: CodeStore.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
private static String getVersionDir(final ScriptEnvironment env) throws IOException {
    try {
        final String versionDir = OptimisticTypesPersistence.getVersionDirName();
        return env._optimistic_types ? versionDir + "_opt" : versionDir;
    } catch (final Exception e) {
        throw new IOException(e);
    }
}
 
Example #10
Source File: RecompilableScriptFunctionData.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the function being compiled already has its own invalidated program points map, use it. Otherwise, attempt to
 * load invalidated program points map from the persistent type info cache.
 * @param invalidatedProgramPoints the function's current invalidated program points map. Null if the function
 * doesn't have it.
 * @param typeInformationFile the object describing the location of the persisted type information.
 * @return either the existing map, or a loaded map from the persistent type info cache, or a new empty map if
 * neither an existing map or a persistent cached type info is available.
 */
@SuppressWarnings("unused")
private static Map<Integer, Type> getEffectiveInvalidatedProgramPoints(
        final Map<Integer, Type> invalidatedProgramPoints, final Object typeInformationFile) {
    if(invalidatedProgramPoints != null) {
        return invalidatedProgramPoints;
    }
    final Map<Integer, Type> loadedProgramPoints = OptimisticTypesPersistence.load(typeInformationFile);
    return loadedProgramPoints != null ? loadedProgramPoints : new TreeMap<Integer, Type>();
}
 
Example #11
Source File: CodeStore.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static String getVersionDir(final ScriptEnvironment env) throws IOException {
    try {
        final String versionDir = OptimisticTypesPersistence.getVersionDirName();
        return env._optimistic_types ? versionDir + "_opt" : versionDir;
    } catch (final Exception e) {
        throw new IOException(e);
    }
}
 
Example #12
Source File: RecompilableScriptFunctionData.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the function being compiled already has its own invalidated program points map, use it. Otherwise, attempt to
 * load invalidated program points map from the persistent type info cache.
 * @param invalidatedProgramPoints the function's current invalidated program points map. Null if the function
 * doesn't have it.
 * @param typeInformationFile the object describing the location of the persisted type information.
 * @return either the existing map, or a loaded map from the persistent type info cache, or a new empty map if
 * neither an existing map or a persistent cached type info is available.
 */
@SuppressWarnings("unused")
private static Map<Integer, Type> getEffectiveInvalidatedProgramPoints(
        final Map<Integer, Type> invalidatedProgramPoints, final Object typeInformationFile) {
    if(invalidatedProgramPoints != null) {
        return invalidatedProgramPoints;
    }
    final Map<Integer, Type> loadedProgramPoints = OptimisticTypesPersistence.load(typeInformationFile);
    return loadedProgramPoints != null ? loadedProgramPoints : new TreeMap<Integer, Type>();
}
 
Example #13
Source File: CodeStore.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static String getVersionDir(final ScriptEnvironment env) throws IOException {
    try {
        final String versionDir = OptimisticTypesPersistence.getVersionDirName();
        return env._optimistic_types ? versionDir + "_opt" : versionDir;
    } catch (final Exception e) {
        throw new IOException(e);
    }
}
 
Example #14
Source File: RecompilableScriptFunctionData.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the function being compiled already has its own invalidated program points map, use it. Otherwise, attempt to
 * load invalidated program points map from the persistent type info cache.
 * @param invalidatedProgramPoints the function's current invalidated program points map. Null if the function
 * doesn't have it.
 * @param typeInformationFile the object describing the location of the persisted type information.
 * @return either the existing map, or a loaded map from the persistent type info cache, or a new empty map if
 * neither an existing map or a persistent cached type info is available.
 */
@SuppressWarnings("unused")
private static Map<Integer, Type> getEffectiveInvalidatedProgramPoints(
        final Map<Integer, Type> invalidatedProgramPoints, final Object typeInformationFile) {
    if(invalidatedProgramPoints != null) {
        return invalidatedProgramPoints;
    }
    final Map<Integer, Type> loadedProgramPoints = OptimisticTypesPersistence.load(typeInformationFile);
    return loadedProgramPoints != null ? loadedProgramPoints : new TreeMap<Integer, Type>();
}
 
Example #15
Source File: CodeStore.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static String getVersionDir(final ScriptEnvironment env) throws IOException {
    try {
        final String versionDir = OptimisticTypesPersistence.getVersionDirName();
        return env._optimistic_types ? versionDir + "_opt" : versionDir;
    } catch (final Exception e) {
        throw new IOException(e);
    }
}
 
Example #16
Source File: CodeStore.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static String getVersionDir(final ScriptEnvironment env) throws IOException {
    try {
        final String versionDir = OptimisticTypesPersistence.getVersionDirName();
        return env._optimistic_types ? versionDir + "_opt" : versionDir;
    } catch (final Exception e) {
        throw new IOException(e);
    }
}
 
Example #17
Source File: RecompilableScriptFunctionData.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the function being compiled already has its own invalidated program points map, use it. Otherwise, attempt to
 * load invalidated program points map from the persistent type info cache.
 * @param invalidatedProgramPoints the function's current invalidated program points map. Null if the function
 * doesn't have it.
 * @param typeInformationFile the object describing the location of the persisted type information.
 * @return either the existing map, or a loaded map from the persistent type info cache, or a new empty map if
 * neither an existing map or a persistent cached type info is available.
 */
@SuppressWarnings("unused")
private static Map<Integer, Type> getEffectiveInvalidatedProgramPoints(
        final Map<Integer, Type> invalidatedProgramPoints, final Object typeInformationFile) {
    if(invalidatedProgramPoints != null) {
        return invalidatedProgramPoints;
    }
    final Map<Integer, Type> loadedProgramPoints = OptimisticTypesPersistence.load(typeInformationFile);
    return loadedProgramPoints != null ? loadedProgramPoints : new TreeMap<Integer, Type>();
}
 
Example #18
Source File: CodeStore.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static String getVersionDir(final ScriptEnvironment env) throws IOException {
    try {
        final String versionDir = OptimisticTypesPersistence.getVersionDirName();
        return env._optimistic_types ? versionDir + "_opt" : versionDir;
    } catch (final Exception e) {
        throw new IOException(e);
    }
}
 
Example #19
Source File: RecompilableScriptFunctionData.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the function being compiled already has its own invalidated program points map, use it. Otherwise, attempt to
 * load invalidated program points map from the persistent type info cache.
 * @param invalidatedProgramPoints the function's current invalidated program points map. Null if the function
 * doesn't have it.
 * @param typeInformationFile the object describing the location of the persisted type information.
 * @return either the existing map, or a loaded map from the persistent type info cache, or a new empty map if
 * neither an existing map or a persistent cached type info is available.
 */
@SuppressWarnings("unused")
private static Map<Integer, Type> getEffectiveInvalidatedProgramPoints(
        final Map<Integer, Type> invalidatedProgramPoints, final Object typeInformationFile) {
    if(invalidatedProgramPoints != null) {
        return invalidatedProgramPoints;
    }
    final Map<Integer, Type> loadedProgramPoints = OptimisticTypesPersistence.load(typeInformationFile);
    return loadedProgramPoints != null ? loadedProgramPoints : new TreeMap<Integer, Type>();
}
 
Example #20
Source File: CodeStore.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static String getVersionDir(final ScriptEnvironment env) throws IOException {
    try {
        final String versionDir = OptimisticTypesPersistence.getVersionDirName();
        return env._optimistic_types ? versionDir + "_opt" : versionDir;
    } catch (final Exception e) {
        throw new IOException(e);
    }
}
 
Example #21
Source File: RecompilableScriptFunctionData.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * If the function being compiled already has its own invalidated program points map, use it. Otherwise, attempt to
 * load invalidated program points map from the persistent type info cache.
 * @param invalidatedProgramPoints the function's current invalidated program points map. Null if the function
 * doesn't have it.
 * @param typeInformationFile the object describing the location of the persisted type information.
 * @return either the existing map, or a loaded map from the persistent type info cache, or a new empty map if
 * neither an existing map or a persistent cached type info is available.
 */
@SuppressWarnings("unused")
private static Map<Integer, Type> getEffectiveInvalidatedProgramPoints(
        final Map<Integer, Type> invalidatedProgramPoints, final Object typeInformationFile) {
    if(invalidatedProgramPoints != null) {
        return invalidatedProgramPoints;
    }
    final Map<Integer, Type> loadedProgramPoints = OptimisticTypesPersistence.load(typeInformationFile);
    return loadedProgramPoints != null ? loadedProgramPoints : new TreeMap<Integer, Type>();
}