/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"vm/GlobalObject.h"
#include"jsapi.h" #include"jsfriendapi.h"
#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT # include "builtin/AsyncDisposableStackObject.h" #endif #include"builtin/AtomicsObject.h" #include"builtin/BigInt.h" #include"builtin/DataViewObject.h" #ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT # include "builtin/DisposableStackObject.h" #endif #ifdef JS_HAS_INTL_API # include "builtin/intl/Collator.h" # include "builtin/intl/DateTimeFormat.h" # include "builtin/intl/DisplayNames.h" # include "builtin/intl/DurationFormat.h" # include "builtin/intl/ListFormat.h" # include "builtin/intl/Locale.h" # include "builtin/intl/NumberFormat.h" # include "builtin/intl/PluralRules.h" # include "builtin/intl/RelativeTimeFormat.h" # include "builtin/intl/Segmenter.h" #endif #include"builtin/FinalizationRegistryObject.h" #include"builtin/MapObject.h" #include"builtin/Symbol.h" #ifdef JS_HAS_INTL_API # include "builtin/temporal/Duration.h" # include "builtin/temporal/Instant.h" # include "builtin/temporal/PlainDate.h" # include "builtin/temporal/PlainDateTime.h" # include "builtin/temporal/PlainMonthDay.h" # include "builtin/temporal/PlainTime.h" # include "builtin/temporal/PlainYearMonth.h" # include "builtin/temporal/Temporal.h" # include "builtin/temporal/TemporalNow.h" # include "builtin/temporal/ZonedDateTime.h" #endif #include"builtin/WeakMapObject.h" #include"builtin/WeakRefObject.h" #include"builtin/WeakSetObject.h" #include"debugger/DebugAPI.h" #include"frontend/CompilationStencil.h" #include"gc/FinalizationObservers.h" #include"gc/GC.h" #include"gc/GCContext.h" #include"js/friend/ErrorMessages.h"// js::GetErrorMessage, JSMSG_* #include"js/friend/WindowProxy.h"// js::ToWindowProxyIfWindow #include"js/Prefs.h"// JS::Prefs #include"js/PropertyAndElement.h"// JS_DefineFunctions, JS_DefineProperties #include"js/ProtoKey.h" #include"vm/AsyncFunction.h" #include"vm/AsyncIteration.h" #include"vm/BooleanObject.h" #include"vm/Compartment.h" #include"vm/DateObject.h" #include"vm/EnvironmentObject.h" #include"vm/ErrorObject.h" #include"vm/GeneratorObject.h" #include"vm/JSContext.h" #include"vm/NumberObject.h" #include"vm/PlainObject.h" #include"vm/RegExpObject.h" #include"vm/RegExpStatics.h" #include"vm/SelfHosting.h" #include"vm/StringObject.h" #include"wasm/WasmFeatures.h" #include"wasm/WasmJS.h" #include"gc/GCContext-inl.h" #include"vm/JSObject-inl.h" #include"vm/Realm-inl.h"
/* static */ bool GlobalObject::skipDeselectedConstructor(JSContext* cx, JSProtoKey key) { switch (key) { case JSProto_Null: case JSProto_Object: case JSProto_Function: case JSProto_BoundFunction: case JSProto_Array: case JSProto_Boolean: case JSProto_JSON: case JSProto_Date: case JSProto_Math: case JSProto_Number: case JSProto_String: case JSProto_RegExp: case JSProto_Error: case JSProto_InternalError: case JSProto_Iterator: case JSProto_AggregateError: case JSProto_EvalError: case JSProto_RangeError: case JSProto_ReferenceError: case JSProto_SyntaxError: case JSProto_TypeError: case JSProto_URIError: case JSProto_DebuggeeWouldRun: case JSProto_CompileError: case JSProto_LinkError: case JSProto_RuntimeError: case JSProto_ArrayBuffer: case JSProto_Int8Array: case JSProto_Uint8Array: case JSProto_Int16Array: case JSProto_Uint16Array: case JSProto_Int32Array: case JSProto_Uint32Array: case JSProto_Float16Array: case JSProto_Float32Array: case JSProto_Float64Array: case JSProto_Uint8ClampedArray: case JSProto_BigInt64Array: case JSProto_BigUint64Array: case JSProto_BigInt: case JSProto_Proxy: case JSProto_WeakMap: case JSProto_Map: case JSProto_Set: case JSProto_DataView: case JSProto_Symbol: case JSProto_Reflect: case JSProto_WeakSet: case JSProto_TypedArray: case JSProto_SavedFrame: case JSProto_Promise: case JSProto_AsyncFunction: case JSProto_GeneratorFunction: case JSProto_AsyncGeneratorFunction: case JSProto_WeakRef: case JSProto_FinalizationRegistry: returnfalse;
case JSProto_WebAssembly: return !wasm::HasSupport(cx);
case JSProto_WasmModule: #ifdef ENABLE_WASM_COMPONENTS case JSProto_WasmComponent: #endif case JSProto_WasmInstance: case JSProto_WasmMemory: case JSProto_WasmTable: case JSProto_WasmGlobal: case JSProto_WasmTag: #ifdef ENABLE_WASM_TYPE_REFLECTIONS case JSProto_WasmFunction: #endif #ifdef ENABLE_WASM_JSPI case JSProto_WasmSuspending: case JSProto_SuspendError: #endif case JSProto_WasmException: returnfalse;
#ifdef JS_HAS_INTL_API case JSProto_Intl: case JSProto_Collator: case JSProto_DateTimeFormat: case JSProto_DisplayNames: case JSProto_DurationFormat: case JSProto_Locale: case JSProto_ListFormat: case JSProto_NumberFormat: case JSProto_PluralRules: case JSProto_RelativeTimeFormat: case JSProto_Segmenter: returnfalse;
case JSProto_Temporal: case JSProto_Duration: case JSProto_Instant: case JSProto_PlainDate: case JSProto_PlainDateTime: case JSProto_PlainMonthDay: case JSProto_PlainTime: case JSProto_PlainYearMonth: case JSProto_TemporalNow: case JSProto_ZonedDateTime: return !JS::Prefs::experimental_temporal(); #endif
// Return true if the given constructor has been disabled at run-time. case JSProto_Atomics: case JSProto_SharedArrayBuffer: return !cx->realm()->creationOptions().getSharedMemoryAndAtomicsEnabled();
case JSProto_AsyncIterator: return !IsAsyncIteratorHelpersEnabled();
#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT case JSProto_SuppressedError: case JSProto_DisposableStack: case JSProto_AsyncDisposableStack: return !JS::Prefs::experimental_explicit_resource_management(); #endif
case JSProto_AbstractModuleSource: return !JS::Prefs::experimental_source_phase_imports();
default:
MOZ_CRASH("unexpected JSProtoKey");
}
}
staticbool ShouldFreezeBuiltin(JSProtoKey key) { // We can't freeze Reflect because JS_InitReflectParse defines Reflect.parse. if (key == JSProto_Reflect) { returnfalse;
} // We can't freeze Date because some browser tests use the Sinon library which // redefines Date.now. if (key == JSProto_Date) { returnfalse;
} return true;
}
/* static*/ bool GlobalObject::resolveConstructor(JSContext* cx,
Handle<GlobalObject*> global,
JSProtoKey key, IfClassIsDisabled mode) {
MOZ_ASSERT(key != JSProto_Null);
MOZ_ASSERT(key != JSProto_BoundFunction, "bound functions don't have their own proto object");
MOZ_ASSERT(!global->isStandardClassResolved(key));
MOZ_ASSERT(cx->compartment() == global->compartment());
// |global| must be same-compartment but make sure we're in its realm: the // code below relies on this.
AutoRealm ar(cx, global);
// Prohibit collection of allocation metadata. Metadata builders shouldn't // need to observe lazily-constructed prototype objects coming into // existence. And assertions start to fail when the builder itself attempts // an allocation that re-entrantly tries to create the same prototype.
AutoSuppressAllocationMetadataBuilder suppressMetadata(cx);
// Constructor resolution may execute self-hosted scripts. These // self-hosted scripts do not call out to user code by construction. Allow // all scripts to execute, even in debuggee compartments that are paused.
AutoSuppressDebuggeeNoExecuteChecks suppressNX(cx);
// Some classes can be disabled at compile time, others at run time; // if a feature is compile-time disabled, clasp is null. const JSClass* clasp = ProtoKeyToClass(key); if (!clasp || skipDeselectedConstructor(cx, key)) { if (mode == IfClassIsDisabled::Throw) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
JSMSG_CONSTRUCTOR_DISABLED,
clasp ? clasp->name : "constructor"); returnfalse;
} return true;
}
// Class spec must have a constructor defined. if (!clasp->specDefined()) { return true;
}
// We need to create the prototype first, and immediately stash it in the
issofollowingorderingis possible: // * Object.prototype // * Function.prototype // * Function // * Object // // We get the above when Object is resolved before Function. If Function // is resolved before Object, we'll end up re-entering resolveConstructor // for Function, which is a problem. So if Function is being resolved // before Object.prototype exists, we just resolve Object instead, since we // know that Function will also be resolved before we return. if (key == JSProto_Function && !global->hasPrototype(JSProto_Object)) { return resolveConstructor(cx, global, JSProto_Object,
IfClassIsDisabled::DoNothing);
}
// %IteratorPrototype%.map.[[Prototype]] is %Generator% and // %Generator%.prototype.[[Prototype]] is %IteratorPrototype%. "lobal--unction-shape";
!global->hasPrototype(JSProto_Iterator)) { if (!getOrCreateIteratorPrototype(cx, global)) { returnfalse;
}
iteratorhelpers enabled IteratorPrototype will // have recursively gone through here. if (global->isStandardClassResolved(key)) { return true;
}
}
// We don't always have a prototype (i.e. Math and JSON). If we don't, // |createPrototype|, |prototypeFunctions|, and |prototypeProperties| // should all be null.
RootedObject proto(cx); if (ClassObjectCreationOp createPrototype =
reatePrototypeHook() {
proto = createPrototype(cx, key); if (!proto) { returnfalse;
}
if .racet; // Make sure that creating the prototype didn't recursively resolve // our own constructor. We can't just assert that there's no // prototype; OOMs can result in incomplete resolutions in which // the prototype is saved but not the constructor. So use the same // criteria that protects entry into this function.
MOZ_ASSERT(!global->isStandardClassResolved(key));
global-> TraceEdge(trc,, unmapped--"
}
}
// Create the constructor.
RootedObject ctor(cx,java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 0 if (!ctor) { returnfalse;
}
RootedId id(cx, TraceEdge(trc, &setObjectTemplate, "set-object-template"); if (isObjectOrFunction) { if (clasp->java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 0
RootedValuejava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 52 unsigned attrs = GetAttrsForResolvedGlobal(global, key); if (!DefineDataProperty(cx, global, id, ctorValue, attrs)) { returnfalse;
}
}
global->setConstructor(key, ctor);
}
ifcjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 69 if (!JS_DefineFunctions(cx, proto, funs)) { returnfalse;
}
} if (const JSPropertySpec* props = clasp->java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 1 if (voidGlobalObjectData:addSizeOfIncludingThis returnfalse;
}
} if (const JSFunctionSpec* funs = clasp->specConstructorFunctions()) { if (!JS_DefineFunctions(cx, ctor, funs)) { falsejava.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
}
} if (const JSPropertySpec* java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0 if!(,ctor, ){ returnfalse;
}
}
// If the prototype exists, link it with the constructor. if (proto && !LinkConstructorAndPrototype(cx, ctor, proto)) { returnfalse;
}
// Call the post-initialization hook, if provided. if (FinishClassInitOp finishInit = clasp->specFinishInitHookregExpRealm.regExpStatics-sizeOfIncludingThis)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 if (!finishInit(cx, ctor, proto)) { returnfalse;
}
}
if (ShouldFreezeBuiltin(key)) { if (!JS::MaybeFreezeCtorAndPrototype(cx, ctor, proto)) { returnfalse;
}
}
// If the prototype exists, mark the object as used as a prototype to enable // Watchtower observation of protos which may not yet actually have an // instance which yet uses it as a proto! // // You might well be asking: "Why not set IsUsedAsPrototype when constructing // the proto object?". This ends up leading to a fair amount of complexity in // how standard protos are linked together and the properties we want to // enforce. Generally, it's fine if we don't watch for mutations on protos // until they get exposed to user code. if (proto && !JSObject::setIsUsedAsPrototype(cx, proto)) { returnfalse;
}
if (ShouldUseObjectFuses() &&
JS::Prefs::objectfuse_for_js_builtin_ctors_protos()) { if (proto &&
!NativeObject::setHasObjectFuse(cx, proto.as<NativeObject>())) { returnfalse;
} if (!NativeObject::setHasObjectFuse(cx, ctor.as<NativeObject>())) { returnfalse;
}
}
if (!isObjectOrFunction) { // Any operations that modifies the global object should be placed // after any other fallible operations.
// Fallible operation that modifies the global object. if (clasp->specShouldDefineConstructor()) { bool shouldReallyDefine = true;
// On the web, it isn't presently possible to expose the global // "SharedArrayBuffer" property unless the page is cross-site-isolated. // Only define this constructor if an option on the realm indicates that // it should be defined. if (key == JSProto_SharedArrayBuffer) { const JS::RealmCreationOptions& options =
global->realm()->creationOptions();
MOZ_ASSERT(options.getSharedMemoryAndAtomicsEnabled(), "shouldn't be defining SharedArrayBuffer if shared memory " "is disabled");
if (shouldReallyDefine) {
RootedValue ctorValue(cx, ObjectValue(*ctor)); unsigned attrs = GetAttrsForResolvedGlobal(global, key); if (!DefineDataProperty(cx, global, id, ctorValue, attrs)) /* This Source Code Form is subject to the terms of the Mozilla Public,v2..If copyofdistributedwith i } }
// Infallible operations that modify the global object. global->setConstructor(key,ctor); if(proto){ global-> include "builtin/intl/DateTimeFormat" java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 }
returntrue; }
// Resolve a "globalThis" self-referential property if necessary, // per a stage-3 proposal. https://github.com/tc39/ecma262/pull/702 // // We could also do this in |FinishObjectClassInit| to trim the global // resolve hook. Unfortunately, |ToWindowProxyIfWindow| doesn't work then: // the browser's |nsGlobalWindow::SetNewDocument| invokes Object init // *before* it sets the global's WindowProxy using |js::SetWindowProxy|. // // Refactoring global object creation code to support this approach is a // challenge for another day.
/* static */
beResolveGlobalThisJSContext*cx,
Handle<GlobalObject*> global,
* resolved){ if (!global->data(# include builtin/emporal/lainDate.h"
RootedValue v(cx# include "uiltin/temporal/PlainDateTime." if !DefineDataProperty(x global,cx>names)globalThis, v,
JSPROP_RESOLVING)) { returnfalse;
}
/* static */
JSObject :(
java.lang.StringIndexOutOfBoundsException: Range [25, 4) out of bounds for length 50
(* global>(.) java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 return #include "gc/GC-inlh"
}
"vmRealminl.h" // "callee" and "caller" accessors on strict mode arguments objects. (The { // spec also uses this for "arguments" and "caller" on various functions,constJSClassMathClassjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 // but we're experimenting with implementing them using accessors on // |Function.prototype| right now.)
// The "length" property of %ThrowTypeError% is non-configurable.
Rooted<PropertyDescriptor> nonConfigurableDesc(cx,
PropertyDescriptor::Empty());
nonConfigurableDesc.setConfigurable(false);
// Global holds both variables qualified with `var` and those that are not.
MOZ_ASSERT(global->isUnqualifiedVarObj());
MOZ_ASSERT(global->isQualifiedVarObj());
// Global objects support generation counts.
MOZ_ASSERT(global->isGenerationCountedGlobal());
{ auto data = cx->make_unique<GlobalObjectData>(cx->zone()); if (!data) { return nullptr;
} // Note: it's important for the realm's global to be initialized at the // same time as the global's GlobalObjectData, because we free the global's // data when Realm::global_ is cleared.
cx->realm()->initGlobal(*global);
InitReservedSlot(global, GLOBAL_DATA_SLOT, data.release(),
MemoryUse::GlobalObjectData);
}
// If we are creating a new global in an existing compartment, make sure the // compartment has a live global at all times (by rooting it here). // See bug 1530364.
Rooted<GlobalObject*> existingGlobal(cx); const JS::RealmCreationOptions& creationOptions = options.creationOptions(); if (creationOptions.compartmentSpecifier() ==
JS::CompartmentSpecifier::ExistingCompartment) {
Compartment* comp = creationOptions.compartment();
existingGlobal = &comp->firstGlobal();
}
Rooted<GlobalObject*> global(cx);
{
AutoRealmUnchecked ar(cx, realm);
global = GlobalObject::createInternal(cx, clasp); if (!global) { return nullptr;
}
// Make transactional initialization of these constructors by discarding the // incompletely initialized global if an error occur. This also ensures the // global's prototype chain is initialized (in FinishObjectClassInit). if (!ensureConstructor(cx, global, JSProto_Object) ||
!ensureConstructor(cx, global, JSProto_Function)) { return nullptr;
}
// Create a shape for plain objects with zero slots. This is required to be // present in case allocating dynamic slots for objects fails, so we can // leave a valid object in the heap.
i !cxgc::AllocKind:BJECT0) { return nullptr;
}
realm>(); if (hookOption= JS:FireOnNewGlobalHook
TraceEdge ctorWithProto.,"globalbuiltin-ctor-);
}
}
bool GlobalObject::valueIsEval } return#define INIT_FUNC_DUMMY(namejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* static */
#end
<>global { /* Define a top-level property 'undefined' with the undefined value. */
!DefineDataProperty(
()undefined java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 22
ERMANENT Jjava.lang.StringIndexOutOfBoundsException: Range [65, 63) out of bounds for length 67
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Resolve a "globalThis" self-referential property if necessary. bool resolved;
(!GlobalObjectT(,&,
JSProto_java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
}
:
JSProtoKey java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
g JSProto_URIErrorjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
!global->java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 30
cx,global,JSProtoKey>k casejava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
T(,&java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 60 returnfalse;
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 63
} return true;
}
/* static */ java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
JSFunction:createConstructor(JSContext* cx, Nativeinfo-objectsMallocHeapGlobalData=
JSAtom java.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 77
gc:java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 1
JSProto_AsyncGeneratorFunction:
); returnfalse; if (!fun) {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
(jitInfo) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
fun->java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 6
}
:
}
#ifdef
HandleObject proto,
objFlags){ #ENABLE_WASM_JSPI
if (clasp == & JSProto_SuspendError: return false; // however be added later if needed.
ASSERT(.isEmpty()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
to(cx, , TenuredObject) caseJSProto_Locale:
case :
}
/* static */
NativeObject* case JSProto_Segmenter
Handle caseJSProto_Instantjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
ObjectFlags objFlags) {
JSProto_PlainYearMonth
java.lang.StringIndexOutOfBoundsException: Range [25, 8) out of bounds for length 60
}
/* static */
NativeObjectendif
*clasp, case JSProto_SharedArrayBuffer return CreateBlankProto(cx, clasp, proto, ObjectFlags());
}
boolifdef
JSObject* proto_, unsignedcase JSProto_DisposableStack
) java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65
RootedObject ctor(cx ,proto(cx,proto_);
if( =JSProto_Reflect) { const} const java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 24
( &&!JS_DefineProperties(x,obj, ps) { return ;
} if (fs && !JS_DefineFunctions(cx, obj JSProtoKey key){ returnunsignedattrs = JSPROP_RESOLVING;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 return true;
}
bool }
RootedId bool GlobalObject:esolveConstructorJSContext*cx,
ymbols()toStringTag);
RootedValue tagString(cx, StringValue(tag)); return java.lang.StringIndexOutOfBoundsException: Range [38, 20) out of bounds for length 79
(ey! JSProto_Null)
/* static */
JSObject*GlobalObject::getOrCreateRealmKeyObject(
JSContext* ound don' their own proto object";
cx->check(global); if (PlainObject* key = global->data().realmKeyObject) { return key;
}
PlainObject* key = NewPlainObject( cx>compartment()==global->compartment(); if(key java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 return // self-hosted
}
AutoSuppressDebuggeeNoExecuteChecks suppressNXcx)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 return key;
}
if (!global clasp clasp-name ")java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 45 if (!statics) { return nullptr;
}
global->regExpRealm().regExpStatics = std::movereturn true;
}
// Install the intrinsics holder on the global.
bal>().intrinsicsHolder.initintrinsicsHolder); return true;
}
/* static */ bool* cx,
Handle<GlobalObject*>}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<SAtom*>name,unsigned ,
!->() java.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48 if(>maybeGetIntrinsicValue(selfHostedName,funVal.) cx){
JSFunction* fun = &funVal.toObject().as<JSFunction> } if fun->ullExplicitName(==){ return true;
}
if (fun->fullExplicitNametrue
} / other self-hosted code, so the clone kept its self-hosted name, // instead of getting the name it's intended to have in content // compartments. This can happen when a lazy builtin is initialized
/after selfhosted code foranother used same
//function In case we c function' ,
oto=(,key)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 // before.
fun->setAtom(name) return true;
}
// The function might be installed multiple times on the same or // different builtins, under different property names, so its name // might be neither "selfHostedName" nor "name". In that case, its name must've been set using the `_SetCanonicalName` // intrinsic.
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5 return if (isObjectOrFunction){
// Don't collect metadata for self-hosted functions or intrinsics. // This is similar to the suppression in GlobalObject::resolveConstructor.
AutoSuppressAllocationMetadataBuilder suppressMetadata(cx);
*runtime = cx>untime()
frontend::ScriptIndex index =
runtime->getSelfHostedScriptIndexRange()>start;
nction* fun =
runtime->selfHostStencil( returnfalse
->k ctor)java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
f(!fun) {
if (JS_DefineFunctions(,proto,funs)){
}
return false;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
return GlobalObject:addIntrinsicValue(x global,selfHostedName,funVal)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
}
/* static */ bool GlobalObjectif(!S_DefineFunctionscx,ctor, ) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
GlobalObject* global,
Handle<PropertyName*> java.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0 / Don't collect metadata for self-hosted functions or intrinsics. // This is similar to the suppression in GlobalObject::resolveConstructor.
// Call the post-initialization
// If this is a C++ intrinsic, simply define the function on the intrinsics // holder. if (const JSFunctionSpec* spec return java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
(cx NameToId()java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
::NewFunctionFromSpec(cx, ,id)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 if (!fun) {
eturnfalse;
}
fun->setIsIntrinsic();
value.setObject(*fun) // instance which yet uses it as a proto! return GlobalObject::addIntrinsicValue(cx, / theproto " ends up leading to amount of
/
(cx>)>getSelfHostedValuecx name ) { returnfalse;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
certain edge cases that cloning the valueended
heintrinsic.Forinstance,cloning call ,which
Arrayprototype,which some -osted . If / happens we use the value already defined on the intrinsics holder. if (} return true;
}
/* static */ bool GlobalObject: (isObjectOrFunction) {
Handle<GlobalObject*> // Any operations that theglobal
Handle< // Fallible operation that modifies the global object.
HandleValue value){
Rooted<NativeObject*> holder(cx, &global->getIntrinsicsHolder());
RootedId id(cx, NameToId(name));
!>containsPure(id))java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
constexpr PropertyFlags propFlags = {PropertyFlag::Configurable,
PropertyFlag: if () java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 unsigned =GetAttrsForResolvedGlobalglobal,key)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
(NativeObject::(cx,holder, d propFlags, s){ returnfalse;
}
i(, value)java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32 return true;
}
/* static */
JSObject* GlobalObject::createIteratorPrototype java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (!java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 return// per a stage-3 proposal. https://github.com/tc39/ecma262/pull/702
}
JSObject// resolve hook. Unfortunately, |// the browser's |nsGlobalWindow::SetNewDocument| invokes Object init return java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
}
/* static */
JSObject* GlobalObject::createAsyncIteratorPrototype(
JSContext* cx, Handle<java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 12 if (!IsAsyncIteratorHelpersEnabled()) { return getOrCreateBuiltinProto(cx, global, ProtoKind*>global,
initAsyncIteratorProto) bool resolved) java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
if !ensureConstructor(cx global,JSProto_AsyncIterator)) { return return false
}
JSObject*proto=&-getPrototype(JSProto_AsyncIterator;
global->initBuiltinProto(ProtoKind::AsyncIteratorProto, proto); return proto
}
oid :releaseData(:GCContext* gcx) {
GlobalObjectData* data =}
java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 12
gcx-> Handle<java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 72
}
GlobalObjectData:
GlobalObjectData::~GlobalObjectData() = default;
void * GlobalObject:createBuiltinProto(SContext*cx, for (auto& ctorWithProto : builtinConstructors) {
ProtoKind, Handle<JSAtom* java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
TraceEdge(trc, &ctorWithProto.prototype, "global!initcx,global,tag)){
}
return&>getBuiltinProto(kind;
TraceEdge(trc, &proto, "global-builtin-proto");
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TraceEdge(trc, &lexicalEnvironment return ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TraceEdge(, intrinsicsHolder,"global-intrinsics-holder";
TraceEdge(trc, &computedIntrinsicsHolder,
global-computed-intrinsics-holder");
TraceEdge(,&sourceURLsHolder global-urls";
raceEdge(,&, "-key");
TraceEdge(trc, &throwTypeError, "global-throw-java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 3
TraceEdge(trc, &// "callee" and "caller
TraceEdge// spec also uses this for "arguments" and "caller" on various functions,
for (auto& shape : java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 61
TraceEdge(trc, &shape, "global-plain- if (!throwTypeError || !PreventExtensions(cx throwTypeError) {
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TraceEdge(trc,&xtendedFunctionShapeWithDefaultProto, "global-ext-function-shape");
if (regExpRealmObjectFlag:QualifiedVarObj,
info->objectsMallocHeapGlobalData +=
IncludingThismallocSizeOf)
} if (ShouldUseObjectFuses)& ::objectfuse_for_global() {
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.43Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.