Class InitializeInstanceElementsNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.JavaScriptNode
com.oracle.truffle.js.nodes.access.InitializeInstanceElementsNode
- All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode,com.oracle.truffle.api.nodes.NodeInterface,Cloneable
InitializeInstanceElements (O, constructor).
Defines class instance fields using the provided field records from the constructor. For fields
with an initializer, the initializer function is called to obtain the initial value and, if it's
an anonymous function definition, its function name is set to the (computed) field name. Also
performs PrivateBrandAdd(O, constructor.[[PrivateBrand]]) if the brand is not undefined.
Relies on the following per-class invariants:
- The number of instance fields is constant.
- For each field index, the key will either always or never be a private name.
- For each field index, an initializer will either always or never be present.
- For each field index, [[IsAnonymousFunctionDefinition]] will never change.
- The [[Fields]] slot will either always or never be present.
- The [[PrivateBrand]] slot will either always or never be present.
executeStaticElements(java.lang.Object, com.oracle.truffle.js.nodes.function.ClassElementDefinitionRecord[])).-
Nested Class Summary
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.ChildrenNested classes/interfaces inherited from interface com.oracle.truffle.api.instrumentation.InstrumentableNode
com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JSTargetableNodeprotected JavaScriptNodeprotected final JSContextprotected JSTargetableNodeprotected JSTargetableNodeprotected JavaScriptNodeFields inherited from class com.oracle.truffle.js.nodes.JavaScriptNode
INTERMEDIATE_VALUE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInitializeInstanceElementsNode(JSContext context, JavaScriptNode targetNode, JavaScriptNode constructorNode) -
Method Summary
Modifier and TypeMethodDescriptionprotected JavaScriptNodecopyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) static JavaScriptNodecreate(JSContext context, JavaScriptNode targetNode, JavaScriptNode constructorNode) protected abstract ObjectexecuteEvaluated(Object target, Object constructor, ClassElementDefinitionRecord[] fields, Object[] initializers, Object brand) final ObjectexecuteStaticElements(Object targetConstructor, ClassElementDefinitionRecord[] staticElements) protected static ObjectprivateBrandAdd(Object target, Object constructor, Object fields, Object initializers, Object brand, PrivateFieldAddNode privateBrandAddNode) protected static ObjectwithFields(Object target, Object constructor, ClassElementDefinitionRecord[] fields, Object[] initializers, Object brand, PrivateFieldAddNode privateBrandAddNode, com.oracle.truffle.js.nodes.access.InitializeInstanceElementsNode.InitializeFieldOrAccessorNode[] fieldNodes, JSFunctionCallNode callInit) Methods inherited from class com.oracle.truffle.js.nodes.JavaScriptNode
addCallTag, addExpressionTag, addRootBodyTag, addStatementTag, cloneUninitialized, cloneUninitialized, copy, createWrapper, execute, executeBoolean, executeDouble, executeInt, executeVoid, expressionToString, findBlockScopeNode, getSourceSection, hasSourceSection, hasTag, isInstrumentable, isResultAlwaysOfType, onReplace, setSourceSection, setSourceSection, toString, transferSourceSection, transferSourceSectionAddExpressionTag, transferSourceSectionAndTagsMethods inherited from class com.oracle.truffle.js.nodes.JavaScriptBaseNode
getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperatorsMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, replace, replace, reportPolymorphicSpecializeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.truffle.api.instrumentation.InstrumentableNode
findNearestNodeAt, findNearestNodeAt, getNodeObject, materializeInstrumentableNodes
-
Field Details
-
targetNode
-
constructorNode
-
fieldsNode
-
initializersNode
-
brandNode
-
context
-
-
Constructor Details
-
InitializeInstanceElementsNode
protected InitializeInstanceElementsNode(JSContext context, JavaScriptNode targetNode, JavaScriptNode constructorNode)
-
-
Method Details
-
create
public static JavaScriptNode create(JSContext context, JavaScriptNode targetNode, JavaScriptNode constructorNode) -
create
-
executeStaticElements
public final Object executeStaticElements(Object targetConstructor, ClassElementDefinitionRecord[] staticElements) -
executeEvaluated
-
withFields
protected static Object withFields(Object target, Object constructor, ClassElementDefinitionRecord[] fields, Object[] initializers, Object brand, PrivateFieldAddNode privateBrandAddNode, com.oracle.truffle.js.nodes.access.InitializeInstanceElementsNode.InitializeFieldOrAccessorNode[] fieldNodes, JSFunctionCallNode callInit) -
privateBrandAdd
-
copyUninitialized
protected JavaScriptNode copyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) - Overrides:
copyUninitializedin classJavaScriptNode
-