本文整理汇总了Java中jdk.nashorn.internal.scripts.JO类的典型用法代码示例。如果您正苦于以下问题:Java JO类的具体用法?Java JO怎么用?Java JO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JO类属于jdk.nashorn.internal.scripts包,在下文中一共展示了JO类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createObject
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
private Object createObject(final PropertyMap propertyMap, final List<Object> values, final ArrayData arrayData) {
final long[] primitiveSpill = dualFields ? new long[values.size()] : null;
final Object[] objectSpill = new Object[values.size()];
for (final Property property : propertyMap.getProperties()) {
if (!dualFields || property.getType() == Object.class) {
objectSpill[property.getSlot()] = values.get(property.getSlot());
} else {
primitiveSpill[property.getSlot()] = ObjectClassGenerator.pack((Number) values.get(property.getSlot()));
}
}
final ScriptObject object = dualFields ?
new JD(propertyMap, primitiveSpill, objectSpill) : new JO(propertyMap, null, objectSpill);
object.setInitialProto(global.getObjectPrototype());
object.setArray(arrayData);
return object;
}
示例2: copyInitialMaps
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
private void copyInitialMaps(final ScriptEnvironment env) {
this.accessorPropertyDescriptorMap = AccessorPropertyDescriptor.getInitialMap().duplicate();
this.dataPropertyDescriptorMap = DataPropertyDescriptor.getInitialMap().duplicate();
this.genericPropertyDescriptorMap = GenericPropertyDescriptor.getInitialMap().duplicate();
this.nativeArgumentsMap = NativeArguments.getInitialMap().duplicate();
this.nativeArrayMap = NativeArray.getInitialMap().duplicate();
this.nativeBooleanMap = NativeBoolean.getInitialMap().duplicate();
this.nativeDateMap = NativeDate.getInitialMap().duplicate();
this.nativeErrorMap = NativeError.getInitialMap().duplicate();
this.nativeEvalErrorMap = NativeEvalError.getInitialMap().duplicate();
this.nativeJSAdapterMap = NativeJSAdapter.getInitialMap().duplicate();
this.nativeNumberMap = NativeNumber.getInitialMap().duplicate();
this.nativeRangeErrorMap = NativeRangeError.getInitialMap().duplicate();
this.nativeReferenceErrorMap = NativeReferenceError.getInitialMap().duplicate();
this.nativeRegExpMap = NativeRegExp.getInitialMap().duplicate();
this.nativeRegExpExecResultMap = NativeRegExpExecResult.getInitialMap().duplicate();
this.nativeStrictArgumentsMap = NativeStrictArguments.getInitialMap().duplicate();
this.nativeStringMap = NativeString.getInitialMap().duplicate();
this.nativeSyntaxErrorMap = NativeSyntaxError.getInitialMap().duplicate();
this.nativeTypeErrorMap = NativeTypeError.getInitialMap().duplicate();
this.nativeURIErrorMap = NativeURIError.getInitialMap().duplicate();
this.prototypeObjectMap = PrototypeObject.getInitialMap().duplicate();
this.objectMap = JO.getInitialMap().duplicate();
this.functionMap = ScriptFunctionImpl.getInitialMap().duplicate();
this.anonymousFunctionMap = ScriptFunctionImpl.getInitialAnonymousMap().duplicate();
this.strictFunctionMap = ScriptFunctionImpl.getInitialStrictMap().duplicate();
this.boundFunctionMap = ScriptFunctionImpl.getInitialBoundMap().duplicate();
// java
if (! env._no_java) {
this.nativeJavaImporterMap = NativeJavaImporter.getInitialMap().duplicate();
}
// typed arrays
if (! env._no_typed_arrays) {
this.arrayBufferViewMap = ArrayBufferView.getInitialMap().duplicate();
this.nativeArrayBufferMap = NativeArrayBuffer.getInitialMap().duplicate();
}
}
示例3: wrapAdaptee
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
private static ScriptObject wrapAdaptee(final ScriptObject adaptee) {
return new JO(adaptee, JO.getInitialMap());
}
示例4: wrapAdaptee
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
private static ScriptObject wrapAdaptee(final ScriptObject adaptee) {
return new JO(adaptee);
}
示例5: getAllocatorClass
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
@Override
protected Class<? extends ScriptObject> getAllocatorClass() {
return codegen.useDualFields() ? JD.class : JO.class;
}
示例6: wrapAdaptee
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
private static ScriptObject wrapAdaptee(final ScriptObject adaptee) {
return new JO(adaptee, Global.instance().getObjectMap());
}
示例7: newObject
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
@Override
public ScriptObject newObject() {
return new JO(getObjectPrototype(), getObjectMap());
}
示例8: newObject
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
/**
* Create a new empty script object
*
* @return the new ScriptObject
*/
public ScriptObject newObject() {
return new JO(getObjectPrototype(), JO.getInitialMap());
}
示例9: newMap
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
/**
* Public property map allocator. Used by nasgen generated code.
*
* <p>It is the caller's responsibility to make sure that {@code properties} does not contain
* properties with keys that are valid array indices.</p>
*
* @param properties Collection of initial properties.
* @return New {@link PropertyMap}.
*/
public static PropertyMap newMap(final Collection<Property> properties) {
return properties == null || properties.isEmpty()? newMap() : newMap(properties, JO.class.getName(), 0, 0, 0);
}
示例10: newObject
import jdk.nashorn.internal.scripts.JO; //导入依赖的package包/类
/**
* Create a new empty script object
*
* @return the new ScriptObject
*/
public ScriptObject newObject() {
return useDualFields() ? new JD(getObjectPrototype()) : new JO(getObjectPrototype());
}