Java Code Examples for jdk.nashorn.internal.objects.Global#instance()

The following examples show how to use jdk.nashorn.internal.objects.Global#instance() . 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: ScriptFunction.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
Bound(final ScriptFunctionData boundData, final ScriptFunction target) {
    super(boundData, boundfunctionmap$, null, Global.instance());
    setPrototype(ScriptRuntime.UNDEFINED);
    this.target = target;
}
 
Example 2
Source File: ScriptFunction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
Bound(final ScriptFunctionData boundData, final ScriptFunction target) {
    super(boundData, boundfunctionmap$, null, Global.instance());
    setPrototype(ScriptRuntime.UNDEFINED);
    this.target = target;
}
 
Example 3
Source File: PrototypeObject.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Prototype constructor
 */
protected PrototypeObject() {
    this(Global.instance(), map$);
}
 
Example 4
Source File: ScriptFunction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Constructor
 *
 * @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
 */
private ScriptFunction(
        final String name,
        final MethodHandle methodHandle,
        final ScriptObject scope,
        final Specialization[] specs,
        final int flags) {
    this(name, methodHandle, getMap(isStrict(flags)), scope, specs, flags, Global.instance());
}
 
Example 5
Source File: ScriptFunction.java    From TencentKona-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Constructor
 *
 * @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
 */
private ScriptFunction(
        final String name,
        final MethodHandle methodHandle,
        final ScriptObject scope,
        final Specialization[] specs,
        final int flags) {
    this(name, methodHandle, getMap(isStrict(flags)), scope, specs, flags, Global.instance());
}
 
Example 6
Source File: ScriptFunction.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Constructor
 *
 * @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
 */
private ScriptFunction(
        final String name,
        final MethodHandle methodHandle,
        final ScriptObject scope,
        final Specialization[] specs,
        final int flags) {
    this(name, methodHandle, getMap(isStrict(flags)), scope, specs, flags, Global.instance());
}
 
Example 7
Source File: ScriptFunction.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, non zero member count, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final PropertyMap map, final Specialization[] specs) {
    this(name, invokeHandle, map.addAll(map$), null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 8
Source File: ScriptFunction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Factory method called by compiler generated code for functions that need
 * parent scope.
 *
 * @param constants the generated class' constant array
 * @param index the index of the {@code RecompilableScriptFunctionData}
 * object in the constants array.
 * @param scope the parent scope object
 * @return a newly created function object
 */
public static ScriptFunction create(final Object[] constants, final int index, final ScriptObject scope) {
    final RecompilableScriptFunctionData data = (RecompilableScriptFunctionData) constants[index];
    return new ScriptFunction(data, getMap(data.isStrict()), scope, Global.instance());
}
 
Example 9
Source File: ScriptFunction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, non zero member count, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final PropertyMap map, final Specialization[] specs) {
    this(name, invokeHandle, map.addAll(map$), null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 10
Source File: ScriptFunction.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, zero added members, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final Specialization[] specs) {
    this(name, invokeHandle, map$, null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 11
Source File: PrototypeObject.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * PropertyObject constructor
 *
 * @param func constructor function
 */
protected PrototypeObject(final ScriptFunction func) {
    this(Global.instance(), map$);
    this.constructor = func;
}
 
Example 12
Source File: ScriptFunction.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Factory method called by compiler generated code for functions that need
 * parent scope.
 *
 * @param constants the generated class' constant array
 * @param index the index of the {@code RecompilableScriptFunctionData}
 * object in the constants array.
 * @param scope the parent scope object
 * @return a newly created function object
 */
public static ScriptFunction create(final Object[] constants, final int index, final ScriptObject scope) {
    final RecompilableScriptFunctionData data = (RecompilableScriptFunctionData) constants[index];
    return new ScriptFunction(data, getMap(data.isStrict()), scope, Global.instance());
}
 
Example 13
Source File: ScriptFunction.java    From jdk8u_nashorn with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, zero added members, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final Specialization[] specs) {
    this(name, invokeHandle, map$, null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 14
Source File: ScriptFunction.java    From openjdk-jdk8u with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, zero added members, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final Specialization[] specs) {
    this(name, invokeHandle, map$, null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 15
Source File: ScriptFunction.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, non zero member count, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final PropertyMap map, final Specialization[] specs) {
    this(name, invokeHandle, map.addAll(map$), null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 16
Source File: PrototypeObject.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * PropertyObject constructor
 *
 * @param func constructor function
 */
protected PrototypeObject(final ScriptFunction func) {
    this(Global.instance(), map$);
    this.constructor = func;
}
 
Example 17
Source File: ScriptFunction.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, zero added members, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final Specialization[] specs) {
    this(name, invokeHandle, map$, null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 18
Source File: ScriptFunction.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Factory method called by compiler generated code for functions that need
 * parent scope.
 *
 * @param constants the generated class' constant array
 * @param index the index of the {@code RecompilableScriptFunctionData}
 * object in the constants array.
 * @param scope the parent scope object
 * @return a newly created function object
 */
public static ScriptFunction create(final Object[] constants, final int index, final ScriptObject scope) {
    final RecompilableScriptFunctionData data = (RecompilableScriptFunctionData) constants[index];
    return new ScriptFunction(data, getMap(data.isStrict()), scope, Global.instance());
}
 
Example 19
Source File: ScriptFunction.java    From TencentKona-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, non zero member count, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final PropertyMap map, final Specialization[] specs) {
    this(name, invokeHandle, map.addAll(map$), null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}
 
Example 20
Source File: ScriptFunction.java    From hottub with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Constructor called by Nasgen generated code, zero added members, 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
 */
protected ScriptFunction(final String name, final MethodHandle invokeHandle, final Specialization[] specs) {
    this(name, invokeHandle, map$, null, specs, ScriptFunctionData.IS_BUILTIN_CONSTRUCTOR, Global.instance());
}