jdk.nashorn.internal.runtime.Specialization Java Examples

The following examples show how to use jdk.nashorn.internal.runtime.Specialization. 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: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static ScriptFunction makeFunction(final String name, final MethodHandle methodHandle, final Specialization[] specs, final int flags) {
    final ScriptFunctionImpl func = new ScriptFunctionImpl(name, methodHandle, null, specs, flags);
    func.setPrototype(UNDEFINED);
    // Non-constructor built-in functions do not have "prototype" property
    func.deleteOwnProperty(func.getMap().findProperty("prototype"));

    return func;
}
 
Example #2
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final Specialization[] specs, final Global global) {
    super(name, invokeHandle, map$, null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR);
    init(global);
}
 
Example #3
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final PropertyMap map, final Specialization[] specs, final Global global) {
    super(name, invokeHandle, map.addAll(map$), null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR);
    init(global);
}
 
Example #4
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private ScriptFunctionImpl(final String name, final MethodHandle methodHandle, final ScriptObject scope, final Specialization[] specs, final int flags, final Global global) {
    super(name, methodHandle, getMap(isStrict(flags)), scope, specs, flags);
    init(global);
}
 
Example #5
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, no membercount, use the default map.
 * Creates builtin functions only.
 *
 * @param name name of function
 * @param invokeHandle handle for invocation
 * @param specs specialized versions of this method, if available, null otherwise
 */
ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final Specialization[] specs) {
    this(name, invokeHandle, specs, Global.instance());
}
 
Example #6
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, no membercount, use the map passed as argument.
 * Creates builtin functions only.
 *
 * @param name name of function
 * @param invokeHandle handle for invocation
 * @param map initial property map
 * @param specs specialized versions of this method, if available, null otherwise
 */
ScriptFunctionImpl(final String name, final MethodHandle invokeHandle, final PropertyMap map, final Specialization[] specs) {
    this(name, invokeHandle, map, specs, Global.instance());
}
 
Example #7
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Global.newScriptFunction (runtime).
 *
 * @param name name of function
 * @param methodHandle handle for invocation
 * @param scope scope object
 * @param specs specialized versions of this method, if available, null otherwise
 * @param flags {@link ScriptFunctionData} flags
 */
ScriptFunctionImpl(final String name, final MethodHandle methodHandle, final ScriptObject scope, final Specialization[] specs, final int flags) {
    this(name, methodHandle, scope, specs, flags, Global.instance());
}
 
Example #8
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Factory method for non-constructor built-in functions
 *
 * @param name   function name
 * @param methodHandle handle for invocation
 * @param specs  specialized versions of function if available, null otherwise
 * @return new ScriptFunction
 */
static ScriptFunction makeFunction(final String name, final MethodHandle methodHandle, final Specialization[] specs) {
    return makeFunction(name, methodHandle, specs, ScriptFunctionData.IS_BUILTIN);
}