jdk.nashorn.internal.runtime.FunctionScope Java Examples

The following examples show how to use jdk.nashorn.internal.runtime.FunctionScope. 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: ObjectClassGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String       className    = getClassName(fieldCount, paramCount, dualFields);
    final String       superName    = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithSpillArrays = newInitWithSpillArraysMethod(classEmitter, FunctionScope.class);
    initializeToUndefined(initWithSpillArrays, className, initFields);
    initWithSpillArrays.returnVoid();
    initWithSpillArrays.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(className, classEmitter);
}
 
Example #2
Source File: ObjectClassGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String className          = getClassName(fieldCount, paramCount);
    final String superName          = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(classEmitter);
}
 
Example #3
Source File: ObjectClassGenerator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String       className    = getClassName(fieldCount, paramCount, dualFields);
    final String       superName    = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithSpillArrays = newInitWithSpillArraysMethod(classEmitter, FunctionScope.class);
    initializeToUndefined(initWithSpillArrays, className, initFields);
    initWithSpillArrays.returnVoid();
    initWithSpillArrays.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(className, classEmitter);
}
 
Example #4
Source File: ObjectClassGenerator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String className          = getClassName(fieldCount, paramCount);
    final String superName          = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(classEmitter);
}
 
Example #5
Source File: ObjectClassGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String       className    = getClassName(fieldCount, paramCount, dualFields);
    final String       superName    = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithSpillArrays = newInitWithSpillArraysMethod(classEmitter, FunctionScope.class);
    initializeToUndefined(initWithSpillArrays, className, initFields);
    initWithSpillArrays.returnVoid();
    initWithSpillArrays.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(className, classEmitter);
}
 
Example #6
Source File: ObjectClassGenerator.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String       className    = getClassName(fieldCount, paramCount, dualFields);
    final String       superName    = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithSpillArrays = newInitWithSpillArraysMethod(classEmitter, FunctionScope.class);
    initializeToUndefined(initWithSpillArrays, className, initFields);
    initWithSpillArrays.returnVoid();
    initWithSpillArrays.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(className, classEmitter);
}
 
Example #7
Source File: ObjectClassGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String       className    = getClassName(fieldCount, paramCount, dualFields);
    final String       superName    = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithSpillArrays = newInitWithSpillArraysMethod(classEmitter, FunctionScope.class);
    initializeToUndefined(initWithSpillArrays, className, initFields);
    initWithSpillArrays.returnVoid();
    initWithSpillArrays.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(className, classEmitter);
}
 
Example #8
Source File: ObjectClassGenerator.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String className          = getClassName(fieldCount, paramCount);
    final String superName          = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(classEmitter);
}
 
Example #9
Source File: ObjectClassGenerator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String       className    = getClassName(fieldCount, paramCount, dualFields);
    final String       superName    = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithSpillArrays = newInitWithSpillArraysMethod(classEmitter, FunctionScope.class);
    initializeToUndefined(initWithSpillArrays, className, initFields);
    initWithSpillArrays.returnVoid();
    initWithSpillArrays.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(className, classEmitter);
}
 
Example #10
Source File: ObjectClassGenerator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the byte codes for a JavaScript scope class with fieldCount fields
 * and paramCount parameters.
 *
 * @param fieldCount Number of fields in the JavaScript scope.
 * @param paramCount Number of parameters in the JavaScript scope
 * .
 * @return Byte codes for generated class.
 */
public byte[] generate(final int fieldCount, final int paramCount) {
    final String       className    = getClassName(fieldCount, paramCount, dualFields);
    final String       superName    = className(FunctionScope.class);
    final ClassEmitter classEmitter = newClassEmitter(className, superName);
    final List<String> initFields   = addFields(classEmitter, fieldCount);

    final MethodEmitter init = newInitScopeMethod(classEmitter);
    initializeToUndefined(init, className, initFields);
    init.returnVoid();
    init.end();

    final MethodEmitter initWithSpillArrays = newInitWithSpillArraysMethod(classEmitter, FunctionScope.class);
    initializeToUndefined(initWithSpillArrays, className, initFields);
    initWithSpillArrays.returnVoid();
    initWithSpillArrays.end();

    final MethodEmitter initWithArguments = newInitScopeWithArgumentsMethod(classEmitter);
    initializeToUndefined(initWithArguments, className, initFields);
    initWithArguments.returnVoid();
    initWithArguments.end();

    return toByteArray(className, classEmitter);
}
 
Example #11
Source File: ObjectClassGenerator.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #12
Source File: ObjectClassGenerator.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #13
Source File: ObjectClassGenerator.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #14
Source File: ObjectClassGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #15
Source File: ObjectClassGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #16
Source File: ObjectClassGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #17
Source File: ObjectClassGenerator.java    From nashorn with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #18
Source File: ObjectClassGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #19
Source File: ObjectClassGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #20
Source File: ObjectClassGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #21
Source File: ObjectClassGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #22
Source File: ObjectClassGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #23
Source File: ObjectClassGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #24
Source File: ObjectClassGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #25
Source File: ObjectClassGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #26
Source File: ObjectClassGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #27
Source File: ObjectClassGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #28
Source File: ObjectClassGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}
 
Example #29
Source File: ObjectClassGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes with arguments.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeWithArgumentsMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.load(Type.OBJECT, INIT_ARGUMENTS.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class, ScriptObject.class));

    return init;
}
 
Example #30
Source File: ObjectClassGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Allocate and initialize a new <init> method for scopes.
 * @param classEmitter  Open class emitter.
 * @return Open method emitter.
 */
private static MethodEmitter newInitScopeMethod(final ClassEmitter classEmitter) {
    final MethodEmitter init = classEmitter.init(PropertyMap.class, ScriptObject.class);
    init.begin();
    init.load(Type.OBJECT, JAVA_THIS.slot());
    init.load(Type.OBJECT, INIT_MAP.slot());
    init.load(Type.OBJECT, INIT_SCOPE.slot());
    init.invoke(constructorNoLookup(FunctionScope.class, PropertyMap.class, ScriptObject.class));

    return init;
}