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

public abstract class InitializeInstanceElementsNode extends JavaScriptNode
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.
This node is also used to define static fields (executeStaticElements(Object, ClassElementDefinitionRecord[])).