Class CommonJSRequireBuiltin
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.function.AbstractBodyNode
com.oracle.truffle.js.nodes.function.JSBuiltinNode
com.oracle.truffle.js.builtins.GlobalBuiltins.JSFileLoadingOperation
com.oracle.truffle.js.builtins.commonjs.CommonJSRequireBuiltin
- All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode, com.oracle.truffle.api.nodes.NodeInterface, Cloneable
-
Nested Class Summary
Nested classes/interfaces inherited from class JSBuiltinNode
JSBuiltinNode.Inlineable, JSBuiltinNode.InlinedNested 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 TypeFieldDescriptionstatic final com.oracle.truffle.api.object.HiddenKeyUsed to store theSourceof a CJS module in its module object.static final StringFields inherited from class JSBuiltinNode
ARGUMENTSFields inherited from class JavaScriptNode
INTERMEDIATE_VALUE -
Method Summary
Modifier and TypeMethodDescriptionprotected static ObjectbooleanIf true, this function needs the call source location.static voidprotected Objectrequire(JSDynamicObject currentRequire, com.oracle.truffle.api.strings.TruffleString moduleIdentifier) protected final com.oracle.truffle.api.strings.TruffleStringMethods inherited from class GlobalBuiltins.JSFileLoadingOperation
cannotLoadScript, sourceFromPath, sourceFromTruffleFileMethods inherited from class JSBuiltinNode
copyUninitialized, countsTowardsStackTraceLimit, createBuiltin, getArguments, getBuiltin, getContext, getNodeObject, hasTag, isInlineable, isSplitImmediately, tryCreateInlinedMethods inherited from class AbstractBodyNode
executeBoolean, executeDouble, executeInt, executeVoidMethods inherited from class JavaScriptNode
addCallTag, addExpressionTag, addRootBodyTag, addStatementTag, cloneUninitialized, cloneUninitialized, convertIncomingValue, copy, createWrapper, execute, expressionToString, findBlockScopeNode, getSourceSection, hasSourceSection, isInstrumentable, isResultAlwaysOfType, onReplace, setSourceSection, setSourceSection, toString, transferSourceSection, transferSourceSectionAddExpressionTag, transferSourceSectionAndTagsMethods inherited from class JavaScriptBaseNode
getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, reportLoopCount, reportLoopCountMethods 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, reportPolymorphicSpecialize, reportReplaceMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.truffle.api.instrumentation.InstrumentableNode
createProbe, findNearestNodeAt, findNearestNodeAt, findProbe, materializeInstrumentableNodes
-
Field Details
-
UNSUPPORTED_NODE_FILE
- See Also:
-
MODULE_SOURCE_KEY
public static final com.oracle.truffle.api.object.HiddenKey MODULE_SOURCE_KEYUsed to store theSourceof a CJS module in its module object.
-
-
Method Details
-
log
-
require
protected Object require(JSDynamicObject currentRequire, com.oracle.truffle.api.strings.TruffleString moduleIdentifier) -
fallback
-
isCallerSensitive
public boolean isCallerSensitive()Description copied from class:JSBuiltinNodeIf true, this function needs the call source location. The call node uses this hint to try and pass the call node via a thread-local field (in the case of a direct call) that the built-in can then use to avoid an expensive stack walk.- Overrides:
isCallerSensitivein classJSBuiltinNode
-
toString1
-