Class JSShape
java.lang.Object
com.oracle.truffle.js.runtime.objects.JSShape
Static helper methods for JS-specific operations on shapes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMarks %Array.prototype% and prototype objects that have (or had) %Array.prototype% on their prototype chain.static final intIf this flag is set, the object has extra properties that are not included in the DynamicObject's shape.static final intstatic final intstatic final intMarks objects, setting an element on which invalidates the no-elements assumption.static final intstatic final intMarks %Object.prototype%.static final intstatic final intstatic final intMarks objects, [[GetOwnProperty]] of which is not implemented using OrdinaryGetOwnProperty. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.oracle.truffle.api.object.ShapecreatePrototypeShape(JSContext context, JSClass jsclass, JSDynamicObject prototype) static com.oracle.truffle.api.object.ShapecreateRootWithNullProto(JSContext context, JSClass jsclass) static intgetDefaultShapeFlags(JSClass jsclass) static UnmodifiableArrayList<com.oracle.truffle.api.strings.TruffleString> getEnumerablePropertyNames(com.oracle.truffle.api.object.Shape shape) static JSClassgetJSClass(com.oracle.truffle.api.object.Shape shape) static ObjectgetJSClassNoCast(com.oracle.truffle.api.object.Shape shape) static JSContextgetJSContext(com.oracle.truffle.api.object.Shape shape) static Class<? extends JSDynamicObject> static UnmodifiableArrayList<com.oracle.truffle.api.object.Property> getPropertiesIfHasEnumerablePropertyNames(com.oracle.truffle.api.object.Shape shape) static com.oracle.truffle.api.AssumptiongetPropertyAssumption(com.oracle.truffle.api.object.Shape shape, Object key) static com.oracle.truffle.api.AssumptiongetPropertyAssumption(com.oracle.truffle.api.object.Shape shape, Object key, boolean prototype) static <T> UnmodifiablePropertyKeyList<T> getPropertyKeyList(com.oracle.truffle.api.object.Shape shape, boolean strings, boolean symbols) static com.oracle.truffle.api.object.ShapegetProtoChildTree(JSDynamicObject prototype, JSClass jsclass) Get empty shape for all objects inheriting from the prototype this shape is describing.static com.oracle.truffle.api.AssumptiongetPrototypeAssumption(com.oracle.truffle.api.object.Shape shape) static com.oracle.truffle.api.object.PropertygetPrototypeProperty(com.oracle.truffle.api.object.Shape shape) static JSSharedDatagetSharedData(com.oracle.truffle.api.object.Shape shape) static booleanhasExternalProperties(int shapeFlags) If this flag is set, the object has extra properties that are not included in the DynamicObject's shape.static booleanhasNoElementsAssumption(com.oracle.truffle.api.object.Shape shape) Returns true if this object is not supposed to have elements and adding an element to it should invalidate the no-array-prototype-elements assumption, including Object.prototype, Array.prototype, and prototypes of Array subclasses, i.e.static booleanstatic voidinvalidatePrototypeAssumption(com.oracle.truffle.api.object.Shape shape) static booleanisArrayPrototypeOrDerivative(com.oracle.truffle.api.object.Shape shape) Returns true if this object is the Array.prototype or the prototype of an Array subclass.static booleanstatic booleanisExtensible(com.oracle.truffle.api.object.Shape shape) static booleanisObjectPrototype(com.oracle.truffle.api.object.Shape shape) static booleanisPrototypeInShape(com.oracle.truffle.api.object.Shape shape) static com.oracle.truffle.api.object.ShapemakeEmptyRoot(JSClass jsclass, JSContext context) static com.oracle.truffle.api.object.ShapemakeEmptyRootWithInstanceProto(JSContext context, JSClass jsclass) Empty shape constructor with prototype in field.static JSSharedDatamakeJSSharedData(JSContext context, JSDynamicObject proto) static com.oracle.truffle.api.object.ShapemakeStaticRoot(JSClass jsclass) Internal constructor for null and undefined shapes.static com.oracle.truffle.api.object.Shape.BuildernewBuilder(JSContext context, JSClass jsclass, JSDynamicObject proto) static com.oracle.truffle.api.object.Shape.BuildernewBuilder(JSContext context, JSClass jsclass, JSDynamicObject proto, int shapeFlags) static booleanusesOrdinaryGetOwnProperty(com.oracle.truffle.api.object.Shape shape) Returns true if the object's [[GetOwnProperty]] is implemented using OrdinaryGetOwnProperty.
-
Field Details
-
NOT_EXTENSIBLE_FLAG
public static final int NOT_EXTENSIBLE_FLAG- See Also:
-
SEALED_FLAG
public static final int SEALED_FLAG- See Also:
-
FROZEN_FLAG
public static final int FROZEN_FLAG- See Also:
-
SEALED_FLAGS
public static final int SEALED_FLAGS- See Also:
-
FROZEN_FLAGS
public static final int FROZEN_FLAGS- See Also:
-
EXTERNAL_PROPERTIES_FLAG
public static final int EXTERNAL_PROPERTIES_FLAGIf this flag is set, the object has extra properties that are not included in the DynamicObject's shape.- See Also:
-
ARRAY_PROTOTYPE_FLAG
public static final int ARRAY_PROTOTYPE_FLAGMarks %Array.prototype% and prototype objects that have (or had) %Array.prototype% on their prototype chain. Setting an element on such an object invalidates the no-elements assumption.- See Also:
-
OBJECT_PROTOTYPE_FLAG
public static final int OBJECT_PROTOTYPE_FLAGMarks %Object.prototype%. Setting an element on it invalidates the no-elements assumption.- See Also:
-
NO_ELEMENTS_ASSUMPTION_FLAGS
public static final int NO_ELEMENTS_ASSUMPTION_FLAGSMarks objects, setting an element on which invalidates the no-elements assumption.- See Also:
-
UNORDINARY_GETOWNPROPERTY_FLAG
public static final int UNORDINARY_GETOWNPROPERTY_FLAGMarks objects, [[GetOwnProperty]] of which is not implemented using OrdinaryGetOwnProperty.- See Also:
-
-
Method Details
-
createPrototypeShape
public static com.oracle.truffle.api.object.Shape createPrototypeShape(JSContext context, JSClass jsclass, JSDynamicObject prototype) -
getJSClass
-
getJSClassNoCast
-
getProtoChildTree
public static com.oracle.truffle.api.object.Shape getProtoChildTree(JSDynamicObject prototype, JSClass jsclass) Get empty shape for all objects inheriting from the prototype this shape is describing. -
isExtensible
public static boolean isExtensible(com.oracle.truffle.api.object.Shape shape) -
isArrayPrototypeOrDerivative
public static boolean isArrayPrototypeOrDerivative(com.oracle.truffle.api.object.Shape shape) Returns true if this object is the Array.prototype or the prototype of an Array subclass. -
isArrayPrototypeOrDerivative
-
hasNoElementsAssumption
public static boolean hasNoElementsAssumption(com.oracle.truffle.api.object.Shape shape) Returns true if this object is not supposed to have elements and adding an element to it should invalidate the no-array-prototype-elements assumption, including Object.prototype, Array.prototype, and prototypes of Array subclasses, i.e. all prototype objects that are expected on the prototype chain of an Array exotic object, while the assumption is valid. -
hasNoElementsAssumption
-
isPrototypeInShape
public static boolean isPrototypeInShape(com.oracle.truffle.api.object.Shape shape) -
getPrototypeProperty
public static com.oracle.truffle.api.object.Property getPrototypeProperty(com.oracle.truffle.api.object.Shape shape) -
getPropertyAssumption
public static com.oracle.truffle.api.Assumption getPropertyAssumption(com.oracle.truffle.api.object.Shape shape, Object key) -
getPropertyAssumption
public static com.oracle.truffle.api.Assumption getPropertyAssumption(com.oracle.truffle.api.object.Shape shape, Object key, boolean prototype) -
getJSContext
-
isObjectPrototype
public static boolean isObjectPrototype(com.oracle.truffle.api.object.Shape shape) -
getPrototypeAssumption
public static com.oracle.truffle.api.Assumption getPrototypeAssumption(com.oracle.truffle.api.object.Shape shape) -
invalidatePrototypeAssumption
public static void invalidatePrototypeAssumption(com.oracle.truffle.api.object.Shape shape) -
getPropertyKeyList
public static <T> UnmodifiablePropertyKeyList<T> getPropertyKeyList(com.oracle.truffle.api.object.Shape shape, boolean strings, boolean symbols) -
getEnumerablePropertyNames
public static UnmodifiableArrayList<com.oracle.truffle.api.strings.TruffleString> getEnumerablePropertyNames(com.oracle.truffle.api.object.Shape shape) -
getPropertiesIfHasEnumerablePropertyNames
public static UnmodifiableArrayList<com.oracle.truffle.api.object.Property> getPropertiesIfHasEnumerablePropertyNames(com.oracle.truffle.api.object.Shape shape) -
makeStaticRoot
Internal constructor for null and undefined shapes. -
makeEmptyRoot
-
createRootWithNullProto
-
makeEmptyRootWithInstanceProto
-
getLayout
-
newBuilder
public static com.oracle.truffle.api.object.Shape.Builder newBuilder(JSContext context, JSClass jsclass, JSDynamicObject proto) -
newBuilder
public static com.oracle.truffle.api.object.Shape.Builder newBuilder(JSContext context, JSClass jsclass, JSDynamicObject proto, int shapeFlags) -
getDefaultShapeFlags
-
hasExternalProperties
public static boolean hasExternalProperties(int shapeFlags) If this flag is set, the object has extra properties that are not included in the DynamicObject's shape. -
usesOrdinaryGetOwnProperty
public static boolean usesOrdinaryGetOwnProperty(com.oracle.truffle.api.object.Shape shape) Returns true if the object's [[GetOwnProperty]] is implemented using OrdinaryGetOwnProperty.
-