jdk.nashorn.internal.runtime.ScriptFunctionData Java Examples

The following examples show how to use jdk.nashorn.internal.runtime.ScriptFunctionData. 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 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 #2
Source File: BoundScriptFunctionImpl.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
BoundScriptFunctionImpl(ScriptFunctionData data, ScriptFunction targetFunction) {
    super(data, Global.instance());
    setPrototype(ScriptRuntime.UNDEFINED);
    this.targetFunction = targetFunction;
}
 
Example #3
Source File: BoundScriptFunctionImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
BoundScriptFunctionImpl(ScriptFunctionData data, ScriptFunction targetFunction) {
    super(data, Global.instance());
    setPrototype(ScriptRuntime.UNDEFINED);
    this.targetFunction = targetFunction;
}
 
Example #4
Source File: BoundScriptFunctionImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
BoundScriptFunctionImpl(ScriptFunctionData data, ScriptFunction targetFunction) {
    super(data, Global.instance());
    setPrototype(ScriptRuntime.UNDEFINED);
    this.targetFunction = targetFunction;
}
 
Example #5
Source File: BoundScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
BoundScriptFunctionImpl(final ScriptFunctionData data, final ScriptFunction targetFunction) {
    super(data, Global.instance());
    setPrototype(ScriptRuntime.UNDEFINED);
    this.targetFunction = targetFunction;
}
 
Example #6
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private static boolean isStrict(final int flags) {
    return (flags & ScriptFunctionData.IS_STRICT) != 0;
}
 
Example #7
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 #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, strict functions
 *
 * @param name   function name
 * @param methodHandle handle for invocation
 * @return new ScriptFunction
 */
static ScriptFunction makeStrictFunction(final String name, final MethodHandle methodHandle) {
    return makeFunction(name, methodHandle, null, ScriptFunctionData.IS_BUILTIN | ScriptFunctionData.IS_STRICT );
}
 
Example #9
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * This method is used to create a bound function based on this function.
 *
 * @param data the {@code ScriptFunctionData} specifying the functions immutable portion.
 * @return a function initialized from the specified data. Its parent scope will be set to null, therefore the
 * passed in data should not expect a callee.
 */
@Override
protected ScriptFunction makeBoundFunction(final ScriptFunctionData data) {
    return new BoundScriptFunctionImpl(data, getTargetFunction());
}
 
Example #10
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);
}
 
Example #11
Source File: ScriptFunctionImpl.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Only invoked internally from {@link BoundScriptFunctionImpl} constructor.
 * @param data the script function data for the bound function.
 * @param global the global object
 */
ScriptFunctionImpl(final ScriptFunctionData data, final Global global) {
    super(data, global.getBoundFunctionMap(), null);
    init(global);
}
 
Example #12
Source File: ScriptFunctionImpl.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * This method is used to create a bound function based on this function.
 *
 * @param data the {@code ScriptFunctionData} specifying the functions immutable portion.
 * @return a function initialized from the specified data. Its parent scope will be set to null, therefore the
 * passed in data should not expect a callee.
 */
@Override
protected ScriptFunction makeBoundFunction(final ScriptFunctionData data) {
    return new BoundScriptFunctionImpl(data, getTargetFunction());
}
 
Example #13
Source File: ScriptFunctionImpl.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Only invoked internally from {@link BoundScriptFunctionImpl} constructor.
 * @param data the script function data for the bound function.
 * @param global the global object
 */
ScriptFunctionImpl(final ScriptFunctionData data, final Global global) {
    super(data, global.getBoundFunctionMap(), null);
    init(global);
}
 
Example #14
Source File: ScriptFunctionImpl.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * This method is used to create a bound function based on this function.
 *
 * @param data the {@code ScriptFunctionData} specifying the functions immutable portion.
 * @return a function initialized from the specified data. Its parent scope will be set to null, therefore the
 * passed in data should not expect a callee.
 */
@Override
protected ScriptFunction makeBoundFunction(final ScriptFunctionData data) {
    return new BoundScriptFunctionImpl(data, getTargetFunction());
}
 
Example #15
Source File: ScriptFunctionImpl.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Only invoked internally from {@link BoundScriptFunctionImpl} constructor.
 * @param data the script function data for the bound function.
 * @param global the global object
 */
ScriptFunctionImpl(final ScriptFunctionData data, final Global global) {
    super(data, boundfunctionmap$, null);
    init(global);
}
 
Example #16
Source File: ScriptFunctionImpl.java    From nashorn with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Only invoked internally from {@link BoundScriptFunctionImpl} constructor.
 * @param data the script function data for the bound function.
 * @param global the global object
 */
ScriptFunctionImpl(final ScriptFunctionData data, final Global global) {
    super(data, global.getBoundFunctionMap(), null);
    init(global);
}
 
Example #17
Source File: ScriptFunctionImpl.java    From nashorn with GNU General Public License v2.0 2 votes vote down vote up
/**
 * This method is used to create a bound function based on this function.
 *
 * @param data the {@code ScriptFunctionData} specifying the functions immutable portion.
 * @return a function initialized from the specified data. Its parent scope will be set to null, therefore the
 * passed in data should not expect a callee.
 */
@Override
protected ScriptFunction makeBoundFunction(final ScriptFunctionData data) {
    return new BoundScriptFunctionImpl(data, getTargetFunction());
}