Class PropertyCacheNode<T extends PropertyCacheNode.CacheNode<T>>
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.access.PropertyCacheNode<T>
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface,Cloneable
- Direct Known Subclasses:
HasPropertyCacheNode,PropertyGetNode,PropertySetNode
public abstract class PropertyCacheNode<T extends PropertyCacheNode.CacheNode<T>>
extends JavaScriptBaseNode
Common base class for property cache nodes. Unifies the cache handling and receiver checks.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classChecks theShapeof aJSDynamicObject.protected static classstatic classprotected static classChecks whether the receiver is compatible with one of the two shapes.protected static final classCheck that the given shape is valid and the property is unchanged using assumptions only.protected static final classChecks that the given shape and all prototype shapes up to depth are valid, that the property is unchanged in these shapes, and that all prototypes are stable, all using assumptions only.protected static final classprotected static final classprotected static final classprotected static final classChecks the top shape by identity and the shapes of the prototype chain up to the given depth using assumptions only (valid and property unchanged).protected static final classCheck the shape of the object by identity and the shape of its immediate prototype by assumption (valid and unchanged).protected static classChecks whether the receiver can be handled by the corresponding specialization.protected static final classCheck the object shape by identity comparison.protected static final classCheck the shapes of the prototype chain up to the given depth.protected static final classCheck the shapes of the object and its immediate prototype.protected static final classCheck the shapes of the prototype chain up to the given depth.protected static final classChecks the shapes of the prototype chain up to the given depth using assumptions only (valid and property unchanged).Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanalwaysUseStore(JSDynamicObject store, Object key) protected abstract booleancanCombineShapeCheck(com.oracle.truffle.api.object.Shape parentShape, com.oracle.truffle.api.object.Shape cacheShape, Object thisObj, int depth, Object value, com.oracle.truffle.api.object.Property property) protected static JSDynamicObjectcastDynamicObject(Object obj, com.oracle.truffle.api.object.Shape shape) Casts the obj to the shape's layout class in compiled code and toJSDynamicObjectin the interpreter.protected voidcheckForUnstableAssumption(T head, Object thisObj) protected abstract TcreateCachedPropertyNode(com.oracle.truffle.api.object.Property entry, Object thisObj, JSDynamicObject proto, int depth, Object value, T currentHead) protected abstract TcreateCombinedIcPropertyNode(com.oracle.truffle.api.object.Shape parentShape, com.oracle.truffle.api.object.Shape cacheShape, Object thisObj, int depth, Object value, com.oracle.truffle.api.object.Property property) protected abstract Tprotected abstract TcreateJavaPropertyNodeMaybe(Object thisObj, JSDynamicObject proto, int depth) protected final PropertyCacheNode.ReceiverCheckNodecreateJSClassCheck(Object thisObj, JSDynamicObject proto, int depth) protected final PropertyCacheNode.ReceiverCheckNodecreatePrimitiveReceiverCheck(Object thisObj, JSDynamicObject protoAtDepth, int depth) protected final PropertyCacheNode.AbstractShapeCheckNodecreateShapeCheckNode(com.oracle.truffle.api.object.Shape shape, JSDynamicObject thisObj, JSDynamicObject proto, int depth, boolean isConstantObjectFinal, boolean isDefine) protected TcreateSpecialization(Object thisObj, T currentHead, int cachedCount, Object value) protected abstract Tprotected abstract TcreateUndefinedPropertyNode(Object thisObj, Object store, JSDynamicObject proto, int depth, Object value) protected final voiddeoptimize(PropertyCacheNode.CacheNode<?> stop) protected TfilterValid(T cache) protected com.oracle.truffle.api.strings.TruffleStringgetAccessorKey(com.oracle.truffle.api.strings.TruffleString getset) protected static com.oracle.truffle.api.strings.TruffleStringgetAccessorKey(com.oracle.truffle.api.strings.TruffleString getset, com.oracle.truffle.api.strings.TruffleString key) protected abstract Tfinal JSContextfinal ObjectgetKey()protected static JSDynamicObjectgetPrototypeAtDepth(JSDynamicObject thisObj, int depth) protected TinsertCached(T specialized, T currentHead, int cachedCount) protected voidprotected static booleanisArrayLengthProperty(com.oracle.truffle.api.object.Property property) protected static booleanisClassPrototypeProperty(com.oracle.truffle.api.object.Property property) protected static booleanisDynamicObject(Object obj, com.oracle.truffle.api.object.Shape shape) Checks if the obj is an instance of the shape's layout class in compiled code andobj instanceofin the interpreter.JSDynamicObjectprotected static booleanisFunctionLengthProperty(com.oracle.truffle.api.object.Property property) protected static booleanisFunctionNameProperty(com.oracle.truffle.api.object.Property property) protected abstract booleanisGlobal()protected static booleanisLazyNamedCaptureGroupProperty(com.oracle.truffle.api.object.Property property) protected static booleanisLazyRegexResultIndexProperty(com.oracle.truffle.api.object.Property property) protected abstract booleanprotected abstract booleanprotected static booleanisStringLengthProperty(com.oracle.truffle.api.object.Property property) protected final booleanpropertyAssumptionsValid(JSDynamicObject thisObj, int depth, boolean checkDepth0) protected static booleanprototypesInShape(JSDynamicObject thisObj, int start, int end) protected Tprotected TrewriteCached(T currentHead, T newHead) protected TrewriteToGeneric(T currentHead, int cachedCount, String reason) protected abstract voidsetCacheNode(T cache) protected abstract voidsetPropertyAssumptionCheckEnabled(boolean value) protected final booleanshapesHaveCommonLayoutForKey(com.oracle.truffle.api.object.Shape shape1, com.oracle.truffle.api.object.Shape shape2) protected Tspecialize(Object thisObj) protected Tspecialize(Object thisObj, Object value) protected voidtraceRewriteEvictFinal(com.oracle.truffle.api.nodes.Node evicted) protected static <T extends PropertyCacheNode.CacheNode<T>>
booleantryMergeShapes(com.oracle.truffle.api.object.Shape cacheShape, T head) Does the given map relate to any of the cached maps by upcasting? If so, obsolete the downcast map.protected static final JSDynamicObjectwrapPrimitive(Object thisObject) Methods inherited from class com.oracle.truffle.js.nodes.JavaScriptBaseNode
copy, getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, onReplace, reportLoopCount, reportLoopCountMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, replace, replace, reportPolymorphicSpecialize, reportReplace, toString
-
Field Details
-
key
-
context
-
-
Constructor Details
-
PropertyCacheNode
-
-
Method Details
-
isDynamicObject
Checks if the obj is an instance of the shape's layout class in compiled code andobj instanceofin the interpreter.JSDynamicObject -
castDynamicObject
protected static JSDynamicObject castDynamicObject(Object obj, com.oracle.truffle.api.object.Shape shape) Casts the obj to the shape's layout class in compiled code and toJSDynamicObjectin the interpreter. -
getKey
-
getCacheNode
-
setCacheNode
-
createGenericPropertyNode
-
createCachedPropertyNode
protected abstract T createCachedPropertyNode(com.oracle.truffle.api.object.Property entry, Object thisObj, JSDynamicObject proto, int depth, Object value, T currentHead) -
createUndefinedPropertyNode
protected abstract T createUndefinedPropertyNode(Object thisObj, Object store, JSDynamicObject proto, int depth, Object value) -
createJavaPropertyNodeMaybe
-
createTruffleObjectPropertyNode
-
canCombineShapeCheck
-
createCombinedIcPropertyNode
-
specialize
-
specialize
-
createSpecialization
-
shapesHaveCommonLayoutForKey
protected final boolean shapesHaveCommonLayoutForKey(com.oracle.truffle.api.object.Shape shape1, com.oracle.truffle.api.object.Shape shape2) -
alwaysUseStore
-
deoptimize
-
retryCache
-
invalidateCache
protected void invalidateCache() -
insertCached
-
rewriteToGeneric
-
rewriteCached
-
tryMergeShapes
protected static <T extends PropertyCacheNode.CacheNode<T>> boolean tryMergeShapes(com.oracle.truffle.api.object.Shape cacheShape, T head) Does the given map relate to any of the cached maps by upcasting? If so, obsolete the downcast map.- Parameters:
cacheShape- The new map to check against- Returns:
- true if a map was obsoleted
-
checkForUnstableAssumption
-
filterValid
-
wrapPrimitive
-
createShapeCheckNode
protected final PropertyCacheNode.AbstractShapeCheckNode createShapeCheckNode(com.oracle.truffle.api.object.Shape shape, JSDynamicObject thisObj, JSDynamicObject proto, int depth, boolean isConstantObjectFinal, boolean isDefine) -
prototypesInShape
-
getPrototypeAtDepth
-
propertyAssumptionsValid
protected final boolean propertyAssumptionsValid(JSDynamicObject thisObj, int depth, boolean checkDepth0) -
createPrimitiveReceiverCheck
protected final PropertyCacheNode.ReceiverCheckNode createPrimitiveReceiverCheck(Object thisObj, JSDynamicObject protoAtDepth, int depth) -
createJSClassCheck
protected final PropertyCacheNode.ReceiverCheckNode createJSClassCheck(Object thisObj, JSDynamicObject proto, int depth) -
isGlobal
protected abstract boolean isGlobal() -
isOwnProperty
protected abstract boolean isOwnProperty() -
getContext
-
isPropertyAssumptionCheckEnabled
protected abstract boolean isPropertyAssumptionCheckEnabled() -
setPropertyAssumptionCheckEnabled
protected abstract void setPropertyAssumptionCheckEnabled(boolean value) -
isArrayLengthProperty
protected static boolean isArrayLengthProperty(com.oracle.truffle.api.object.Property property) -
isFunctionLengthProperty
protected static boolean isFunctionLengthProperty(com.oracle.truffle.api.object.Property property) -
isFunctionNameProperty
protected static boolean isFunctionNameProperty(com.oracle.truffle.api.object.Property property) -
isClassPrototypeProperty
protected static boolean isClassPrototypeProperty(com.oracle.truffle.api.object.Property property) -
isStringLengthProperty
protected static boolean isStringLengthProperty(com.oracle.truffle.api.object.Property property) -
isLazyRegexResultIndexProperty
protected static boolean isLazyRegexResultIndexProperty(com.oracle.truffle.api.object.Property property) -
isLazyNamedCaptureGroupProperty
protected static boolean isLazyNamedCaptureGroupProperty(com.oracle.truffle.api.object.Property property) -
traceRewriteEvictFinal
protected void traceRewriteEvictFinal(com.oracle.truffle.api.nodes.Node evicted) -
getAccessorKey
protected com.oracle.truffle.api.strings.TruffleString getAccessorKey(com.oracle.truffle.api.strings.TruffleString getset) -
getAccessorKey
protected static com.oracle.truffle.api.strings.TruffleString getAccessorKey(com.oracle.truffle.api.strings.TruffleString getset, com.oracle.truffle.api.strings.TruffleString key)
-