Class JSFunction
java.lang.Object
com.oracle.truffle.js.runtime.builtins.JSClass
com.oracle.truffle.js.runtime.builtins.JSNonProxy
com.oracle.truffle.js.runtime.builtins.JSFunction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classV8 compatibility mode: retrieves the function's arguments from the stack.static enumstatic final classV8 compatibility mode: retrieves the function's caller from the stack.static final classstatic final classstatic final classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.oracle.truffle.api.strings.TruffleStringstatic final PropertyProxystatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final Stringstatic final com.oracle.truffle.api.source.SourceSectionstatic final com.oracle.truffle.api.strings.TruffleStringstatic final PropertyProxystatic final com.oracle.truffle.api.object.HiddenKeystatic final com.oracle.truffle.api.object.HiddenKeystatic final com.oracle.truffle.api.strings.TruffleStringstatic final ObjectPlaceholder for lazy initialization of the prototype property.static final JSDynamicObjectConstruct token.static final com.oracle.truffle.api.object.HiddenKeySlot for scope object passed to inline parsed scripts.static final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.object.HiddenKeystatic final JSFunctionstatic final com.oracle.truffle.api.strings.TruffleStringstatic final PropertyProxystatic final com.oracle.truffle.api.strings.TruffleStringstatic final PropertyProxystatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.object.HiddenKeystatic final Stringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final PropertyProxystatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringFields inherited from class JSNonProxy
GET_SYMBOL_SPECIES_NAME -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddRestrictedFunctionProperties(JSRealm realm, JSDynamicObject obj) static JSFunctionObjectbind(JSRealm realm, JSFunctionObject thisFnObj, Object thisArg, Object[] boundArguments) static JSFunctionObjectboundFunctionCreate(JSContext context, JSFunctionObject boundTargetFunction, Object boundThis, Object[] boundArguments, JSDynamicObject proto, com.oracle.truffle.api.profiles.InlinedConditionProfile isConstructorProfile, com.oracle.truffle.api.profiles.InlinedConditionProfile isAsyncProfile, com.oracle.truffle.api.profiles.InlinedConditionProfile setProtoProfile, com.oracle.truffle.api.nodes.Node node) static Objectcall(JSFunctionObject functionObject, Object thisObject, Object[] argumentValues) static Objectstatic Objectconstruct(JSFunctionObject functionObject, Object[] argumentValues) static JSFunctionObjectcreate(JSRealm realm, JSFunctionData functionData) static JSFunctionObjectcreate(JSRealm realm, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame) static JSObjectCreates the %AsyncFromSyncIteratorPrototype% object (ES2018 11.1.3.2).static JSConstructorstatic JSObjectcreateAsyncFunctionPrototype(JSRealm realm, JSDynamicObject constructor) static JSConstructorstatic JSObjectcreateAsyncGeneratorFunctionPrototype(JSRealm realm, JSDynamicObject constructor) static JSObjectCreates the %AsyncIteratorPrototype% object (ES2018 11.1.2).static JSFunctionObjectcreateBound(JSContext context, JSRealm realm, JSFunctionData functionData, Object boundTargetFunction, Object boundThis, Object[] boundArguments) static com.oracle.truffle.api.nodes.RootNodecreateBoundRootNode(JSContext context, boolean construct, boolean newTarget) static com.oracle.truffle.api.source.SourceSectionstatic JSFunctionObjectcreateEmptyFunction(JSRealm realm) static JSFunctionDatacreateEmptyFunctionData(JSContext context) static JSDynamicObjectstatic JSDynamicObjectstatic JSFunctionObjectcreateFunctionConstructor(JSRealm realm) static JSFunctionObjectcreateFunctionPrototype(JSRealm realm, JSDynamicObject objectPrototype) static JSConstructorstatic JSObjectcreateGeneratorFunctionPrototype(JSRealm realm, JSDynamicObject constructor) static JSFunctionObjectcreateLexicalThis(JSRealm realm, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame, Object lexicalThis) static JSFunctionObjectcreateNamedEmptyFunction(JSRealm realm, com.oracle.truffle.api.strings.TruffleString name) static JSFunctionDatacreateNamedEmptyFunctionData(JSContext context, com.oracle.truffle.api.strings.TruffleString name) static JSDynamicObjectstatic JSFunctionObjectcreateWithPrototype(JSFunctionFactory factory, JSRealm realm, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame, JSDynamicObject prototype) static JSFunctionObjectcreateWithPrototype(JSRealm realm, JSFunctionData functionData, JSDynamicObject prototype) static JSFunctionObjectcreateWrapped(JSContext context, JSRealm realm, JSFunctionData functionData, Object wrappedTargetFunction) static voidfillFunctionPrototype(JSRealm realm) static com.oracle.truffle.api.source.Sourcestatic com.oracle.truffle.api.CallTargetstatic ObjectgetClassPrototype(JSFunctionObject thisObj) static Objectstatic com.oracle.truffle.api.CallTargetstatic com.oracle.truffle.api.CallTargetstatic com.oracle.truffle.api.frame.MaterializedFramestatic com.oracle.truffle.api.nodes.RootNodegetFrameRootNode(com.oracle.truffle.api.frame.FrameInstance frameInstance) static JSFunctionDatastatic intstatic ObjectgetLexicalThis(JSFunctionObject thisObj) static com.oracle.truffle.api.strings.TruffleStringgetName(JSFunctionObject obj) static JSRealmgetRealm(JSFunctionObject obj) static JSRealmgetRealm(JSFunctionObject functionObj, JSContext context, com.oracle.truffle.api.nodes.Node node) Version optimized for a single Realm.booleanIf true,JSClass.ownPropertyKeys(JSDynamicObject)andJSShape.getPropertyKeyList(Shape, boolean, boolean)enumerate the same keys.static booleanisAsyncFunction(JSFunctionObject function) static booleanisBoundFunction(Object function) static booleanstatic booleanisBuiltinSourceSection(com.oracle.truffle.api.source.SourceSection sourceSection) static booleanisBuiltinThatShouldNotAppearInStackTrace(JSRealm realm, JSDynamicObject function) static booleanstatic booleanstatic booleanisConstructor(Object obj) static booleanstatic booleanisJSFunction(Object obj) static booleanisStrict(JSFunctionObject obj) static booleanisStrictBuiltin(JSFunctionObject function, JSRealm realm) static com.oracle.truffle.api.object.ShapemakeFunctionShape(JSContext context, JSDynamicObject prototype, boolean isGenerator, boolean isAsync) static com.oracle.truffle.api.object.ShapemakeInitialEnumerateIteratorShape(JSContext context, JSDynamicObject enumerateIteratorPrototype) static booleanstatic voidsetBoundFunctionName(JSDynamicObject boundFunction, com.oracle.truffle.api.strings.TruffleString targetName) static voidsetClassPrototype(JSFunctionObject thisObj, Object value) static voidsetFunctionLength(JSDynamicObject functionObj, Number length) static voidsetFunctionName(JSDynamicObject functionObj, com.oracle.truffle.api.strings.TruffleString name) Methods inherited from class JSNonProxy
checkProtoCycle, createSymbolSpeciesGetterFunction, defineOwnProperty, delete, delete, deletePropertyDefault, getHelper, getHelper, getMethodHelper, getOwnHelper, getOwnHelper, getOwnProperty, getOwnPropertyKeys, getPrototypeOf, hasOwnProperty, hasOwnProperty, hasProperty, hasProperty, invokeAccessorPropertySetter, isExtensible, ordinaryGetOwnProperty, ordinaryGetOwnPropertyIntl, ordinaryIsExtensible, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeys, ordinaryOwnPropertyKeysSlow, ordinaryPreventExtensions, ordinarySet, ordinarySetIndex, ordinarySetWithReceiver, performOrdinarySetWithOwnDescriptor, preventExtensions, putConstructorSpeciesGetter, set, set, setIntegrityLevelFast, setPropertySlow, setPrototypeOf, testIntegrityLevelFast, usesOrdinaryGetOwnProperty, usesOrdinaryIsExtensibleMethods inherited from class JSClass
filterOwnPropertyKeys, get, get, getIntrinsicDefaultProto, isInstance, isInstance, isInstance, isInstance, makeInitialShape, ownPropertyKeys, toString
-
Field Details
-
TYPE_NAME
public static final com.oracle.truffle.api.strings.TruffleString TYPE_NAME -
CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString CLASS_NAME -
PROTOTYPE_NAME
public static final com.oracle.truffle.api.strings.TruffleString PROTOTYPE_NAME -
GENERATOR_FUNCTION_NAME
public static final com.oracle.truffle.api.strings.TruffleString GENERATOR_FUNCTION_NAME -
GENERATOR_NAME
public static final com.oracle.truffle.api.strings.TruffleString GENERATOR_NAME -
ASYNC_FUNCTION_NAME
public static final com.oracle.truffle.api.strings.TruffleString ASYNC_FUNCTION_NAME -
ASYNC_GENERATOR_FUNCTION_NAME
public static final com.oracle.truffle.api.strings.TruffleString ASYNC_GENERATOR_FUNCTION_NAME -
ASYNC_GENERATOR_NAME
public static final com.oracle.truffle.api.strings.TruffleString ASYNC_GENERATOR_NAME -
ENUMERATE_ITERATOR_PROTOTYPE_NAME
public static final com.oracle.truffle.api.strings.TruffleString ENUMERATE_ITERATOR_PROTOTYPE_NAME -
CALLER
public static final com.oracle.truffle.api.strings.TruffleString CALLER -
ARGUMENTS
public static final com.oracle.truffle.api.strings.TruffleString ARGUMENTS -
LENGTH
public static final com.oracle.truffle.api.strings.TruffleString LENGTH -
NAME
public static final com.oracle.truffle.api.strings.TruffleString NAME -
ORDINARY_HAS_INSTANCE
public static final com.oracle.truffle.api.strings.TruffleString ORDINARY_HAS_INSTANCE -
PROGRAM_FUNCTION_NAME
- See Also:
-
BUILTIN_SOURCE_NAME
- See Also:
-
TS_BUILTIN_SOURCE_NAME
public static final com.oracle.truffle.api.strings.TruffleString TS_BUILTIN_SOURCE_NAME -
BUILTIN_SOURCE_SECTION
public static final com.oracle.truffle.api.source.SourceSection BUILTIN_SOURCE_SECTION -
ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_NAME
public static final com.oracle.truffle.api.strings.TruffleString ASYNC_FROM_SYNC_ITERATOR_PROTOTYPE_NAME -
PROTOTYPE_PROXY
-
LENGTH_PROXY
-
NAME_PROXY
-
ARGUMENTS_PROXY
-
CALLER_PROXY
-
CLASS_PROTOTYPE_PLACEHOLDER
Placeholder for lazy initialization of the prototype property. -
INSTANCE
-
HOME_OBJECT_ID
public static final com.oracle.truffle.api.object.HiddenKey HOME_OBJECT_ID -
CLASS_ELEMENTS_ID
public static final com.oracle.truffle.api.object.HiddenKey CLASS_ELEMENTS_ID -
CLASS_INITIALIZERS_ID
public static final com.oracle.truffle.api.object.HiddenKey CLASS_INITIALIZERS_ID -
PRIVATE_BRAND_ID
public static final com.oracle.truffle.api.object.HiddenKey PRIVATE_BRAND_ID -
DEBUG_SCOPE_ID
public static final com.oracle.truffle.api.object.HiddenKey DEBUG_SCOPE_IDSlot for scope object passed to inline parsed scripts. -
CONSTRUCT
Construct token. Passed from thenewnode asthisargument to built-in functions to differentiate between a constructor and a normal call (i.e., [[Construct]] and [[Call]] internal methods, see ES5 13.2.1 and 13.2.2). Must not be passed anywhere else.
-
-
Method Details
-
getCallTarget
-
getEnclosingFrame
public static com.oracle.truffle.api.frame.MaterializedFrame getEnclosingFrame(JSFunctionObject obj) -
getFunctionData
-
getRealm
-
getRealm
public static JSRealm getRealm(JSFunctionObject functionObj, JSContext context, com.oracle.truffle.api.nodes.Node node) Version optimized for a single Realm. -
create
-
create
public static JSFunctionObject create(JSRealm realm, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame) -
createWithPrototype
public static JSFunctionObject createWithPrototype(JSRealm realm, JSFunctionData functionData, JSDynamicObject prototype) -
createWithPrototype
public static JSFunctionObject createWithPrototype(JSFunctionFactory factory, JSRealm realm, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame, JSDynamicObject prototype) -
createLexicalThis
public static JSFunctionObject createLexicalThis(JSRealm realm, JSFunctionData functionData, com.oracle.truffle.api.frame.MaterializedFrame enclosingFrame, Object lexicalThis) -
createBound
public static JSFunctionObject createBound(JSContext context, JSRealm realm, JSFunctionData functionData, Object boundTargetFunction, Object boundThis, Object[] boundArguments) -
createWrapped
public static JSFunctionObject createWrapped(JSContext context, JSRealm realm, JSFunctionData functionData, Object wrappedTargetFunction) -
getName
-
call
public static Object call(JSFunctionObject functionObject, Object thisObject, Object[] argumentValues) -
call
-
construct
-
bind
public static JSFunctionObject bind(JSRealm realm, JSFunctionObject thisFnObj, Object thisArg, Object[] boundArguments) -
boundFunctionCreate
public static JSFunctionObject boundFunctionCreate(JSContext context, JSFunctionObject boundTargetFunction, Object boundThis, Object[] boundArguments, JSDynamicObject proto, com.oracle.truffle.api.profiles.InlinedConditionProfile isConstructorProfile, com.oracle.truffle.api.profiles.InlinedConditionProfile isAsyncProfile, com.oracle.truffle.api.profiles.InlinedConditionProfile setProtoProfile, com.oracle.truffle.api.nodes.Node node) -
setFunctionLength
-
setFunctionName
public static void setFunctionName(JSDynamicObject functionObj, com.oracle.truffle.api.strings.TruffleString name) -
setBoundFunctionName
public static void setBoundFunctionName(JSDynamicObject boundFunction, com.oracle.truffle.api.strings.TruffleString targetName) -
isStrict
-
isBuiltin
-
isConstructor
-
isConstructor
-
isGenerator
-
needsParentFrame
-
getLength
-
isClassPrototypeInitialized
-
isBoundFunction
-
isAsyncFunction
-
getLexicalThis
-
getClassPrototypeInitialized
-
getClassPrototype
-
setClassPrototype
-
createBoundRootNode
public static com.oracle.truffle.api.nodes.RootNode createBoundRootNode(JSContext context, boolean construct, boolean newTarget) -
createFunctionPrototype
public static JSFunctionObject createFunctionPrototype(JSRealm realm, JSDynamicObject objectPrototype) -
addRestrictedFunctionProperties
-
createNamedEmptyFunctionData
public static JSFunctionData createNamedEmptyFunctionData(JSContext context, com.oracle.truffle.api.strings.TruffleString name) -
createEmptyFunctionData
-
createNamedEmptyFunction
public static JSFunctionObject createNamedEmptyFunction(JSRealm realm, com.oracle.truffle.api.strings.TruffleString name) -
createEmptyFunction
-
fillFunctionPrototype
-
makeFunctionShape
public static com.oracle.truffle.api.object.Shape makeFunctionShape(JSContext context, JSDynamicObject prototype, boolean isGenerator, boolean isAsync) -
createFunctionConstructor
-
hasOnlyShapeProperties
Description copied from class:JSClassIf true,JSClass.ownPropertyKeys(JSDynamicObject)andJSShape.getPropertyKeyList(Shape, boolean, boolean)enumerate the same keys.- Overrides:
hasOnlyShapePropertiesin classJSNonProxy
-
getConstructTarget
-
getConstructNewTarget
-
isJSFunction
-
createGeneratorFunctionPrototype
-
createGeneratorFunctionConstructor
-
createAsyncFunctionPrototype
-
createAsyncFunctionConstructor
-
createAsyncIteratorPrototype
-
createAsyncFromSyncIteratorPrototype
-
createAsyncGeneratorFunctionPrototype
public static JSObject createAsyncGeneratorFunctionPrototype(JSRealm realm, JSDynamicObject constructor) -
createAsyncGeneratorFunctionConstructor
-
createEnumerateIteratorPrototype
-
makeInitialEnumerateIteratorShape
public static com.oracle.truffle.api.object.Shape makeInitialEnumerateIteratorShape(JSContext context, JSDynamicObject enumerateIteratorPrototype) -
createForInIteratorPrototype
-
createOrdinaryHasInstanceFunction
-
getFrameRootNode
public static com.oracle.truffle.api.nodes.RootNode getFrameRootNode(com.oracle.truffle.api.frame.FrameInstance frameInstance) -
createBuiltinSourceSection
-
isBuiltinSourceSection
public static boolean isBuiltinSourceSection(com.oracle.truffle.api.source.SourceSection sourceSection) -
isBuiltinThatShouldNotAppearInStackTrace
public static boolean isBuiltinThatShouldNotAppearInStackTrace(JSRealm realm, JSDynamicObject function) -
isStrictBuiltin
-
getCallerSource
public static com.oracle.truffle.api.source.Source getCallerSource()
-