Class JSRealm
java.lang.Object
com.oracle.truffle.js.runtime.JSRealm
Container for JavaScript globals (i.e. an ECMAScript 6 Realm object).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final com.oracle.truffle.api.strings.TruffleStringstatic final longstatic final longstatic 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 com.oracle.truffle.api.strings.TruffleString -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd optional global properties.static JSFunctionObjectcreateObjectConstructor(JSRealm realm, JSDynamicObject objectPrototype) longfinal voiddispose()enterRealm(com.oracle.truffle.api.nodes.Node node, JSRealm childRealm) static JSRealmget(com.oracle.truffle.api.nodes.Node node) final JSAgentgetAgent()final Objectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectgetCachedCompiledRegex(com.oracle.truffle.api.source.Source regexSource) final Objectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal Map<com.oracle.truffle.api.TruffleFile, JSDynamicObject> final Objectfinal JSContextfinal JSContextOptionscom.oracle.truffle.api.strings.TruffleStringgetCustomEsmPathMapping(com.oracle.truffle.api.strings.TruffleString refPath, com.oracle.truffle.api.strings.TruffleString specifier) final JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectorg.graalvm.shadowed.com.ibm.icu.text.DateFormatfinal Map<Object, JSArrayObject> final JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal Objectfinal JSDynamicObjectfinal com.oracle.truffle.api.TruffleLanguage.EnvgetEnv()final JSFunctionObjectfinal JSDynamicObjectgetErrorPrototype(JSErrorType type) final PrintWriterReturns the environment's error stream as a PrintWriter.final Objectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSDynamicObjectgetFromRealmList(int idx) final JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSDynamicObjectintfinal com.oracle.truffle.api.object.Shapefinal JSFunctionObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectorg.graalvm.shadowed.com.ibm.icu.text.DateFormatgetJSDateISOFormat(double time) org.graalvm.shadowed.com.ibm.icu.text.DateFormatfinal Objectorg.graalvm.shadowed.com.ibm.icu.text.DateFormatorg.graalvm.shadowed.com.ibm.icu.text.DateFormatorg.graalvm.shadowed.com.ibm.icu.text.DateFormatorg.graalvm.shadowed.com.ibm.icu.text.DateFormatfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectorg.graalvm.shadowed.com.ibm.icu.util.TimeZonestatic JSRealmgetMain(com.oracle.truffle.api.nodes.Node node) final JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectintorg.graalvm.options.OptionValuesfinal JSDynamicObjectfinal PrintWriterReturns the environment's output stream as a PrintWriter.final JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSFunctionObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal SplittableRandomfinal JSDynamicObjectfinal Objectfinal Objectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectgetStaticRegexResult(JSContext ctx, com.oracle.truffle.api.nodes.Node node, TRegexUtil.InvokeExecMethodNode invokeExec) com.oracle.truffle.api.strings.TruffleStringcom.oracle.truffle.api.strings.TruffleStringfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal Map<Object, JSArrayObject> final JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal Accessorfinal JSFunctionObjectfinal com.oracle.truffle.api.TruffleContextfinal JSFunctionObjectfinal JSDynamicObjectfinal Objectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectfinal JSFunctionObjectfinal JSDynamicObjectvoidvoidvoidvoidbooleanIs Java interop enabled in this Context.booleanbooleanbooleanvoidbooleanjoinStackPush(Object o, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.profiles.InlinedBranchProfile growProfile) voidleaveRealm(com.oracle.truffle.api.nodes.Node node, JSRealm prevRealm) final AccessorlookupAccessor(JSBuiltinsContainer container, Object key) final JSFunctionObjectlookupFunction(JSBuiltinsContainer container, Object key) final JSFunctionObjectlookupFunctionWithPrototype(JSBuiltinsContainer container, Object key, JSDynamicObject prototype) longnanoTime()The current time in nanoseconds precision (with fuzzed resolution for security reasons).longThe current time in nanoseconds precision (with fuzzed resolution for security reasons).longbooleanpatchContext(com.oracle.truffle.api.TruffleLanguage.Env newEnv) voidputCachedCompiledRegex(com.oracle.truffle.api.source.Source regexSource, Object compiledRegex) voidregisterCustomEsmPathMappingCallback(Object callback) voidremoveFromRealmList(int idx) voidvoidsetArguments(com.oracle.truffle.api.strings.TruffleString[] arguments) voidsetCallNode(JavaScriptBaseNode callNode) voidsetCurrentV8Realm(JSRealm realm) final voidsetEmbedderData(Object embedderData) final voidsetGlobalObject(JSDynamicObject global) voidsetInRealmList(int idx, JSRealm realm) voidsetLocalTimeZone(String tzId) voidsetPreparingStackTrace(boolean preparingStackTrace) voidsetRealmBuiltinObject(JSDynamicObject realmBuiltinObject) voidsetStaticRegexResult(JSContext ctx, Object compiledRegex, com.oracle.truffle.api.strings.TruffleString input, long fromIndex, Object result) To allow virtualization of TRegex RegexResults, we want to avoid storing the last result globally.voidsetStaticRegexResultInputString(com.oracle.truffle.api.strings.TruffleString inputString) voidvoidstoreParentPromise(JSDynamicObject promise)
-
Field Details
-
POLYGLOT_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString POLYGLOT_CLASS_NAME -
REFLECT_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString REFLECT_CLASS_NAME -
ATOMICS_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString ATOMICS_CLASS_NAME -
REALM_BUILTIN_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString REALM_BUILTIN_CLASS_NAME -
ARGUMENTS_NAME
public static final com.oracle.truffle.api.strings.TruffleString ARGUMENTS_NAME -
JAVA_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString JAVA_CLASS_NAME -
JAVA_CLASS_NAME_NASHORN_COMPAT
public static final com.oracle.truffle.api.strings.TruffleString JAVA_CLASS_NAME_NASHORN_COMPAT -
PERFORMANCE_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString PERFORMANCE_CLASS_NAME -
DEBUG_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString DEBUG_CLASS_NAME -
CONSOLE_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString CONSOLE_CLASS_NAME -
SYMBOL_ITERATOR_NAME
public static final com.oracle.truffle.api.strings.TruffleString SYMBOL_ITERATOR_NAME -
MLE_CLASS_NAME
public static final com.oracle.truffle.api.strings.TruffleString MLE_CLASS_NAME -
NANOSECONDS_PER_MILLISECOND
public static final long NANOSECONDS_PER_MILLISECOND- See Also:
-
NANOSECONDS_PER_SECOND
public static final long NANOSECONDS_PER_SECOND- See Also:
-
-
Constructor Details
-
JSRealm
-
-
Method Details
-
getContext
-
getMain
-
get
-
enterRealm
-
leaveRealm
-
lookupFunction
-
lookupFunctionWithPrototype
public final JSFunctionObject lookupFunctionWithPrototype(JSBuiltinsContainer container, Object key, JSDynamicObject prototype) -
lookupAccessor
-
createObjectConstructor
public static JSFunctionObject createObjectConstructor(JSRealm realm, JSDynamicObject objectPrototype) -
getErrorConstructor
-
getErrorPrototype
-
getGlobalObject
-
setGlobalObject
-
dispose
public final void dispose() -
getObjectConstructor
-
getObjectPrototype
-
getFunctionConstructor
-
getFunctionPrototype
-
getArrayConstructor
-
getArrayPrototype
-
getBooleanConstructor
-
getBooleanPrototype
-
getNumberConstructor
-
getNumberPrototype
-
getBigIntConstructor
-
getBigIntPrototype
-
getStringConstructor
-
getStringPrototype
-
getRegExpConstructor
-
getRegExpPrototype
-
getCollatorConstructor
-
getCollatorPrototype
-
getNumberFormatConstructor
-
getNumberFormatPrototype
-
getPluralRulesConstructor
-
getPluralRulesPrototype
-
getListFormatConstructor
-
getListFormatPrototype
-
getRelativeTimeFormatConstructor
-
getRelativeTimeFormatPrototype
-
getDateTimeFormatConstructor
-
getDateTimeFormatPrototype
-
getDateConstructor
-
getDatePrototype
-
getSegmenterConstructor
-
getSegmenterPrototype
-
getDisplayNamesConstructor
-
getDisplayNamesPrototype
-
getLocaleConstructor
-
getLocalePrototype
-
getDurationFormatConstructor
-
getDurationFormatPrototype
-
getSymbolConstructor
-
getSymbolPrototype
-
getMapConstructor
-
getMapPrototype
-
getSetConstructor
-
getSetPrototype
-
getWeakRefConstructor
-
getWeakRefPrototype
-
getFinalizationRegistryConstructor
-
getFinalizationRegistryPrototype
-
getWeakMapConstructor
-
getWeakMapPrototype
-
getWeakSetConstructor
-
getWeakSetPrototype
-
getInitialRegExpPrototypeShape
public final com.oracle.truffle.api.object.Shape getInitialRegExpPrototypeShape() -
getArrayBufferConstructor
-
getArrayBufferPrototype
-
getArrayBufferViewConstructor
-
getArrayBufferViewPrototype
-
getDataViewConstructor
-
getDataViewPrototype
-
getTypedArrayConstructor
-
getTypedArrayPrototype
-
getRealmBuiltinObject
-
getProxyConstructor
-
getProxyPrototype
-
getGeneratorFunctionConstructor
-
getGeneratorFunctionPrototype
-
getAsyncFunctionConstructor
-
getAsyncFunctionPrototype
-
getAsyncGeneratorFunctionConstructor
-
getAsyncGeneratorFunctionPrototype
-
getEnumerateIteratorPrototype
-
getForInIteratorPrototype
-
getGeneratorObjectPrototype
-
getAsyncGeneratorObjectPrototype
-
getJavaImporterConstructor
-
getJavaImporterPrototype
-
getJavaPackageToPrimitiveFunction
-
getTemporalPlainTimeConstructor
-
getTemporalPlainTimePrototype
-
getTemporalPlainDateConstructor
-
getTemporalPlainDatePrototype
-
getTemporalPlainDateTimeConstructor
-
getTemporalPlainDateTimePrototype
-
getTemporalDurationConstructor
-
getTemporalDurationPrototype
-
getTemporalPlainYearMonthConstructor
-
getTemporalPlainYearMonthPrototype
-
getTemporalPlainMonthDayConstructor
-
getTemporalPlainMonthDayPrototype
-
getTemporalInstantConstructor
-
getTemporalInstantPrototype
-
getTemporalZonedDateTimeConstructor
-
getTemporalZonedDateTimePrototype
-
getForeignArrayPrototype
-
getForeignDatePrototype
-
getForeignMapPrototype
-
getForeignStringPrototype
-
getForeignNumberPrototype
-
getForeignBooleanPrototype
-
getForeignErrorPrototype
-
getForeignFunctionPrototype
-
getForeignObjectPrototype
-
getTemplateRegistry
-
getDedentMap
-
getEvalFunctionObject
-
getApplyFunctionObject
-
getCallFunctionObject
-
getReflectApplyFunctionObject
-
getReflectConstructFunctionObject
-
getCommonJSRequireFunctionObject
-
getJsonParseFunctionObject
-
getPromiseAllFunctionObject
-
getPromiseResolveFunctionObject
-
getUnhandledPromiseRejectionHandler
-
getThrowTypeErrorFunction
-
getThrowerAccessor
-
getIteratorConstructor
-
getAsyncIteratorConstructor
-
getIteratorPrototype
-
getWrapForIteratorPrototype
-
getWrapForAsyncIteratorPrototype
-
getAsyncIteratorPrototype
-
getAsyncFromSyncIteratorPrototype
-
getArrayIteratorPrototype
-
getSetIteratorPrototype
-
getMapIteratorPrototype
-
getIteratorHelperPrototype
-
getAsyncIteratorHelperPrototype
-
getStringIteratorPrototype
-
getRegExpStringIteratorPrototype
-
getSegmentsPrototype
-
getSegmentIteratorPrototype
-
getPromiseConstructor
-
getPromisePrototype
-
getObjectFactories
-
getShadowRealmConstructor
-
getShadowRealmPrototype
-
getWorkerConstructor
-
getWorkerPrototype
-
getAsyncContextSnapshotConstructor
-
getAsyncContextSnapshotPrototype
-
getAsyncContexVariableConstructor
-
getAsyncContextVariablePrototype
-
getContextOptions
-
setupGlobals
public void setupGlobals() -
addOptionalGlobals
public void addOptionalGlobals()Add optional global properties. Used by initializeContext and patchContext. -
isJavaInteropEnabled
public boolean isJavaInteropEnabled()Is Java interop enabled in this Context. -
getAbstractModuleSourceConstructor
-
getAbstractModuleSourcePrototype
-
getArrayProtoValuesIterator
-
getCallSiteConstructor
-
getCallSitePrototype
-
getGlobalScope
-
getScriptEngineImportScope
-
getTopScopeObject
-
setRealmBuiltinObject
-
initRealmBuiltinObject
public void initRealmBuiltinObject() -
setArguments
public void setArguments(com.oracle.truffle.api.strings.TruffleString[] arguments) -
getOrdinaryHasInstanceFunction
-
getJSAdapterConstructor
-
getJSAdapterPrototype
-
getEnv
public final com.oracle.truffle.api.TruffleLanguage.Env getEnv() -
patchContext
public boolean patchContext(com.oracle.truffle.api.TruffleLanguage.Env newEnv) -
initialize
public void initialize() -
createChildRealm
-
isPreparingStackTrace
public boolean isPreparingStackTrace() -
setPreparingStackTrace
public void setPreparingStackTrace(boolean preparingStackTrace) -
getTruffleContext
public final com.oracle.truffle.api.TruffleContext getTruffleContext() -
getEmbedderData
-
setEmbedderData
-
getStaticRegexResult
public Object getStaticRegexResult(JSContext ctx, com.oracle.truffle.api.nodes.Node node, TRegexUtil.InvokeExecMethodNode invokeExec) -
setStaticRegexResult
public void setStaticRegexResult(JSContext ctx, Object compiledRegex, com.oracle.truffle.api.strings.TruffleString input, long fromIndex, Object result) To allow virtualization of TRegex RegexResults, we want to avoid storing the last result globally. Instead, we store the values needed to calculate the result on demand, under the assumption that this non-standard feature is often not used at all. -
invalidateStaticRegexResult
public void invalidateStaticRegexResult() -
isRegexResultInvalidated
public boolean isRegexResultInvalidated() -
getStaticRegexResultCompiledRegex
-
getStaticRegexResultInputString
public com.oracle.truffle.api.strings.TruffleString getStaticRegexResultInputString() -
setStaticRegexResultInputString
public void setStaticRegexResultInputString(com.oracle.truffle.api.strings.TruffleString inputString) -
getStaticRegexResultOriginalInputString
public com.oracle.truffle.api.strings.TruffleString getStaticRegexResultOriginalInputString() -
getOptions
public org.graalvm.options.OptionValues getOptions() -
getOutputWriter
Returns the environment's output stream as a PrintWriter. -
getErrorWriter
Returns the environment's error stream as a PrintWriter. -
nanoTime
public long nanoTime()The current time in nanoseconds precision (with fuzzed resolution for security reasons). Counted from the start of the application, as required by Node.js' `performance.now()`. -
nanoTimeWallClock
public long nanoTimeWallClock()The current time in nanoseconds precision (with fuzzed resolution for security reasons). Wall clock time, to be in the same range as ECMAScript's `Date.now()`. -
currentTimeMillis
public long currentTimeMillis() -
getConsoleUtil
-
getModuleLoader
-
getAgent
-
setAgent
-
getLocalTimeZone
public org.graalvm.shadowed.com.ibm.icu.util.TimeZone getLocalTimeZone() -
getLocalTimeZoneId
-
getRandom
-
getParent
-
isMainRealm
public boolean isMainRealm() -
getCallNode
-
setCallNode
-
getFromRealmList
-
setInRealmList
-
getIndexFromRealmList
-
removeFromRealmList
public void removeFromRealmList(int idx) -
getCurrentV8Realm
-
setCurrentV8Realm
-
registerCustomEsmPathMappingCallback
-
getCustomEsmPathMapping
public com.oracle.truffle.api.strings.TruffleString getCustomEsmPathMapping(com.oracle.truffle.api.strings.TruffleString refPath, com.oracle.truffle.api.strings.TruffleString specifier) -
joinStackPush
public boolean joinStackPush(Object o, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.profiles.InlinedBranchProfile growProfile) -
joinStackPop
public void joinStackPop() -
getCommonJSRequireCache
-
getWASMModuleInstantiate
-
getWASMModuleExports
-
getWASMModuleImports
-
getWASMCustomSections
-
getWASMTableAlloc
-
getWASMTableGrow
-
getWASMTableRead
-
getWASMTableWrite
-
getWASMTableLength
-
getWASMFuncType
-
getWASMIsFunc
-
getWASMMemAlloc
-
getWASMMemGrow
-
getWASMGlobalAlloc
-
getWASMGlobalRead
-
getWASMGlobalWrite
-
getWASMInstanceExport
-
getWASMEmbedderDataGet
-
getWASMEmbedderDataSet
-
getWASMMemAsByteBuffer
-
getWasmRefNull
-
getWebAssemblyModuleConstructor
-
getWebAssemblyModulePrototype
-
getWebAssemblyInstancePrototype
-
getWebAssemblyMemoryPrototype
-
getWebAssemblyTablePrototype
-
getWebAssemblyGlobalPrototype
-
getTextDecoderPrototype
-
getTextEncoderPrototype
-
getForeignIterablePrototype
-
getForeignIteratorPrototype
-
getJSDateISOFormat
public org.graalvm.shadowed.com.ibm.icu.text.DateFormat getJSDateISOFormat(double time) -
getJSDateUTCFormat
public org.graalvm.shadowed.com.ibm.icu.text.DateFormat getJSDateUTCFormat() -
getJSShortDateFormat
public org.graalvm.shadowed.com.ibm.icu.text.DateFormat getJSShortDateFormat() -
getJSShortDateLocalFormat
public org.graalvm.shadowed.com.ibm.icu.text.DateFormat getJSShortDateLocalFormat() -
getJSShortTimeFormat
public org.graalvm.shadowed.com.ibm.icu.text.DateFormat getJSShortTimeFormat() -
getJSShortTimeLocalFormat
public org.graalvm.shadowed.com.ibm.icu.text.DateFormat getJSShortTimeLocalFormat() -
getDateToStringFormat
public org.graalvm.shadowed.com.ibm.icu.text.DateFormat getDateToStringFormat() -
setLocalTimeZone
-
getCharset
-
nextAsyncEvaluationOrder
public long nextAsyncEvaluationOrder() -
putCachedCompiledRegex
public void putCachedCompiledRegex(com.oracle.truffle.api.source.Source regexSource, Object compiledRegex) -
getCachedCompiledRegex
-
storeParentPromise
-
fetchParentPromise
-
getOperatorCounter
public int getOperatorCounter() -
incOperatorCounter
public void incOperatorCounter()
-