зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1572782 - Replace internal use of js::FreeOp with JSFreeOp r=tcampbell?
Sorry for the huge patch. This is pretty much a search and replace of all uses of js::FreeOp. Differential Revision: https://phabricator.services.mozilla.com/D41412 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
68fef4ffb0
Коммит
8186c345e2
|
@ -573,7 +573,7 @@ typedef bool (*GetElementsOp)(JSContext* cx, JS::HandleObject obj,
|
|||
uint32_t begin, uint32_t end,
|
||||
ElementAdder* adder);
|
||||
|
||||
typedef void (*FinalizeOp)(FreeOp* fop, JSObject* obj);
|
||||
typedef void (*FinalizeOp)(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
// The special treatment of |finalize| and |trace| is necessary because if we
|
||||
// assign either of those hooks to a local variable and then call it -- as is
|
||||
|
@ -867,7 +867,7 @@ static const uint32_t JSCLASS_CACHED_PROTO_MASK =
|
|||
namespace js {
|
||||
|
||||
struct MOZ_STATIC_CLASS Class {
|
||||
JS_CLASS_MEMBERS(js::ClassOps, FreeOp);
|
||||
JS_CLASS_MEMBERS(js::ClassOps, JSFreeOp);
|
||||
const ClassSpec* spec;
|
||||
const ClassExtension* ext;
|
||||
const ObjectOps* oOps;
|
||||
|
|
|
@ -488,7 +488,7 @@ static inline void js_free(void* p) {
|
|||
* - Ordinarily, use js_free/js_delete.
|
||||
*
|
||||
* - For deallocations during GC finalization, use one of the following
|
||||
* operations on the FreeOp provided to the finalizer:
|
||||
* operations on the JSFreeOp provided to the finalizer:
|
||||
*
|
||||
* FreeOp::{free_,delete_}
|
||||
*/
|
||||
|
|
|
@ -251,7 +251,7 @@ MapIteratorObject* MapIteratorObject::create(JSContext* cx, HandleObject obj,
|
|||
return iterobj;
|
||||
}
|
||||
|
||||
void MapIteratorObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void MapIteratorObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
MOZ_ASSERT(!IsInsideNursery(obj));
|
||||
|
||||
|
@ -620,7 +620,7 @@ MapObject* MapObject::create(JSContext* cx,
|
|||
return mapObj;
|
||||
}
|
||||
|
||||
void MapObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void MapObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
if (ValueMap* map = obj->as<MapObject>().getData()) {
|
||||
fop->delete_(obj, map, MemoryUse::MapObjectTable);
|
||||
|
@ -628,7 +628,7 @@ void MapObject::finalize(FreeOp* fop, JSObject* obj) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void MapObject::sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj) {
|
||||
void MapObject::sweepAfterMinorGC(JSFreeOp* fop, MapObject* mapobj) {
|
||||
bool wasInsideNursery = IsInsideNursery(mapobj);
|
||||
if (wasInsideNursery && !IsForwarded(mapobj)) {
|
||||
finalize(fop, mapobj);
|
||||
|
@ -1023,7 +1023,7 @@ SetIteratorObject* SetIteratorObject::create(JSContext* cx, HandleObject obj,
|
|||
return iterobj;
|
||||
}
|
||||
|
||||
void SetIteratorObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void SetIteratorObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
MOZ_ASSERT(!IsInsideNursery(obj));
|
||||
|
||||
|
@ -1244,7 +1244,7 @@ void SetObject::trace(JSTracer* trc, JSObject* obj) {
|
|||
}
|
||||
}
|
||||
|
||||
void SetObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void SetObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
SetObject* setobj = static_cast<SetObject*>(obj);
|
||||
if (ValueSet* set = setobj->getData()) {
|
||||
|
@ -1253,7 +1253,7 @@ void SetObject::finalize(FreeOp* fop, JSObject* obj) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void SetObject::sweepAfterMinorGC(FreeOp* fop, SetObject* setobj) {
|
||||
void SetObject::sweepAfterMinorGC(JSFreeOp* fop, SetObject* setobj) {
|
||||
bool wasInsideNursery = IsInsideNursery(setobj);
|
||||
if (wasInsideNursery && !IsForwarded(setobj)) {
|
||||
finalize(fop, setobj);
|
||||
|
|
|
@ -139,7 +139,7 @@ class MapObject : public NativeObject {
|
|||
OrderedHashMap<Value, Value, UnbarrieredHashPolicy, ZoneAllocPolicy>;
|
||||
friend class OrderedHashTableRef<MapObject>;
|
||||
|
||||
static void sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj);
|
||||
static void sweepAfterMinorGC(JSFreeOp* fop, MapObject* mapobj);
|
||||
|
||||
private:
|
||||
static const ClassSpec classSpec_;
|
||||
|
@ -152,7 +152,7 @@ class MapObject : public NativeObject {
|
|||
static ValueMap& extract(HandleObject o);
|
||||
static ValueMap& extract(const CallArgs& args);
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static MOZ_MUST_USE bool construct(JSContext* cx, unsigned argc, Value* vp);
|
||||
|
||||
static bool is(HandleValue v);
|
||||
|
@ -198,7 +198,7 @@ class MapIteratorObject : public NativeObject {
|
|||
static MapIteratorObject* create(JSContext* cx, HandleObject mapobj,
|
||||
ValueMap* data,
|
||||
MapObject::IteratorKind kind);
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static size_t objectMoved(JSObject* obj, JSObject* old);
|
||||
|
||||
static MOZ_MUST_USE bool next(Handle<MapIteratorObject*> mapIterator,
|
||||
|
@ -253,7 +253,7 @@ class SetObject : public NativeObject {
|
|||
OrderedHashSet<Value, UnbarrieredHashPolicy, ZoneAllocPolicy>;
|
||||
friend class OrderedHashTableRef<SetObject>;
|
||||
|
||||
static void sweepAfterMinorGC(FreeOp* fop, SetObject* setobj);
|
||||
static void sweepAfterMinorGC(JSFreeOp* fop, SetObject* setobj);
|
||||
|
||||
private:
|
||||
static const ClassSpec classSpec_;
|
||||
|
@ -267,7 +267,7 @@ class SetObject : public NativeObject {
|
|||
static ValueSet& extract(HandleObject o);
|
||||
static ValueSet& extract(const CallArgs& args);
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static bool construct(JSContext* cx, unsigned argc, Value* vp);
|
||||
|
||||
static bool is(HandleValue v);
|
||||
|
@ -311,7 +311,7 @@ class SetIteratorObject : public NativeObject {
|
|||
static SetIteratorObject* create(JSContext* cx, HandleObject setobj,
|
||||
ValueSet* data,
|
||||
SetObject::IteratorKind kind);
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static size_t objectMoved(JSObject* obj, JSObject* old);
|
||||
|
||||
static MOZ_MUST_USE bool next(Handle<SetIteratorObject*> setIterator,
|
||||
|
|
|
@ -771,7 +771,7 @@ ModuleObject* ModuleObject::create(JSContext* cx) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void ModuleObject::finalize(js::FreeOp* fop, JSObject* obj) {
|
||||
void ModuleObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->maybeOnHelperThread());
|
||||
ModuleObject* self = &obj->as<ModuleObject>();
|
||||
if (self->hasImportBindings()) {
|
||||
|
|
|
@ -322,7 +322,7 @@ class ModuleObject : public NativeObject {
|
|||
static const ClassOps classOps_;
|
||||
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
static void finalize(js::FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
bool hasImportBindings() const;
|
||||
FunctionDeclarationVector* functionDeclarations();
|
||||
|
|
|
@ -3644,7 +3644,7 @@ static const JSPropertySpec ReadableByteStreamController_properties[] = {
|
|||
static const JSFunctionSpec ReadableByteStreamController_methods[] = {
|
||||
JS_FS_END};
|
||||
|
||||
static void ReadableByteStreamControllerFinalize(FreeOp* fop, JSObject* obj) {
|
||||
static void ReadableByteStreamControllerFinalize(JSFreeOp* fop, JSObject* obj) {
|
||||
ReadableByteStreamController& controller =
|
||||
obj->as<ReadableByteStreamController>();
|
||||
|
||||
|
|
|
@ -3148,7 +3148,7 @@ class CloneBufferObject : public NativeObject {
|
|||
return CallNonGenericMethod<is, getCloneBufferAsArrayBuffer_impl>(cx, args);
|
||||
}
|
||||
|
||||
static void Finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void Finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
obj->as<CloneBufferObject>().discard();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3027,7 +3027,7 @@ static bool CreateTraceList(JSContext* cx, HandleTypeDescr descr) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void TypeDescr::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void TypeDescr::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
TypeDescr& descr = obj->as<TypeDescr>();
|
||||
if (descr.hasTraceList()) {
|
||||
auto list = const_cast<uint32_t*>(descr.traceList());
|
||||
|
|
|
@ -202,7 +202,7 @@ class TypeDescr : public NativeObject {
|
|||
void initInstances(const JSRuntime* rt, uint8_t* mem, size_t length);
|
||||
void traceInstances(JSTracer* trace, uint8_t* mem, size_t length);
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
};
|
||||
|
||||
typedef Handle<TypeDescr*> HandleTypeDescr;
|
||||
|
|
|
@ -178,7 +178,7 @@ static void WeakCollection_trace(JSTracer* trc, JSObject* obj) {
|
|||
}
|
||||
}
|
||||
|
||||
static void WeakCollection_finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void WeakCollection_finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->maybeOnHelperThread());
|
||||
if (ObjectValueMap* map = obj->as<WeakCollectionObject>().getMap()) {
|
||||
fop->delete_(obj, map, MemoryUse::WeakMapObject);
|
||||
|
|
|
@ -128,7 +128,7 @@ bool js::intl_Collator(JSContext* cx, unsigned argc, Value* vp) {
|
|||
return Collator(cx, args);
|
||||
}
|
||||
|
||||
void js::CollatorObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void js::CollatorObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
|
||||
const Value& slot =
|
||||
|
|
|
@ -36,7 +36,7 @@ class CollatorObject : public NativeObject {
|
|||
private:
|
||||
static const ClassOps classOps_;
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
};
|
||||
|
||||
extern JSObject* CreateCollatorPrototype(JSContext* cx,
|
||||
|
|
|
@ -156,7 +156,7 @@ bool js::intl_DateTimeFormat(JSContext* cx, unsigned argc, Value* vp) {
|
|||
return DateTimeFormat(cx, args, true, DateTimeFormatOptions::Standard);
|
||||
}
|
||||
|
||||
void js::DateTimeFormatObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void js::DateTimeFormatObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
|
||||
const Value& slot = obj->as<DateTimeFormatObject>().getReservedSlot(
|
||||
|
|
|
@ -34,7 +34,7 @@ class DateTimeFormatObject : public NativeObject {
|
|||
private:
|
||||
static const ClassOps classOps_;
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
};
|
||||
|
||||
extern JSObject* CreateDateTimeFormatPrototype(
|
||||
|
|
|
@ -149,7 +149,7 @@ bool js::intl_NumberFormat(JSContext* cx, unsigned argc, Value* vp) {
|
|||
return NumberFormat(cx, args, true);
|
||||
}
|
||||
|
||||
void js::NumberFormatObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void js::NumberFormatObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
|
||||
auto* numberFormat = &obj->as<NumberFormatObject>();
|
||||
|
|
|
@ -65,7 +65,7 @@ class NumberFormatObject : public NativeObject {
|
|||
private:
|
||||
static const ClassOps classOps_;
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
};
|
||||
|
||||
extern JSObject* CreateNumberFormatPrototype(JSContext* cx, HandleObject Intl,
|
||||
|
|
|
@ -114,7 +114,7 @@ static bool PluralRules(JSContext* cx, unsigned argc, Value* vp) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void js::PluralRulesObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void js::PluralRulesObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
|
||||
auto* pluralRules = &obj->as<PluralRulesObject>();
|
||||
|
|
|
@ -73,7 +73,7 @@ class PluralRulesObject : public NativeObject {
|
|||
private:
|
||||
static const ClassOps classOps_;
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
};
|
||||
|
||||
extern JSObject* CreatePluralRulesPrototype(JSContext* cx,
|
||||
|
|
|
@ -126,7 +126,7 @@ static bool RelativeTimeFormat(JSContext* cx, unsigned argc, Value* vp) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void js::RelativeTimeFormatObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void js::RelativeTimeFormatObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
|
||||
constexpr auto RT_FORMAT_SLOT =
|
||||
|
|
|
@ -32,7 +32,7 @@ class RelativeTimeFormatObject : public NativeObject {
|
|||
private:
|
||||
static const ClassOps classOps_;
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
};
|
||||
|
||||
extern JSObject* CreateRelativeTimeFormatPrototype(
|
||||
|
|
|
@ -173,7 +173,7 @@ void DebugAPI::onPromiseSettled(JSContext* cx, Handle<PromiseObject*> promise) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugAPI::sweepBreakpoints(FreeOp* fop, JSScript* script) {
|
||||
void DebugAPI::sweepBreakpoints(JSFreeOp* fop, JSScript* script) {
|
||||
if (script->hasDebugScript()) {
|
||||
sweepBreakpointsSlow(fop, script);
|
||||
}
|
||||
|
|
|
@ -98,16 +98,16 @@ class DebugAPI {
|
|||
static void traceAllForMovingGC(JSTracer* trc);
|
||||
|
||||
// Sweep dying debuggers, and detach edges to dying debuggees.
|
||||
static void sweepAll(FreeOp* fop);
|
||||
static void sweepAll(JSFreeOp* fop);
|
||||
|
||||
// Add sweep group edges due to the presence of any debuggers.
|
||||
static MOZ_MUST_USE bool findSweepGroupEdges(JSRuntime* rt);
|
||||
|
||||
// Sweep breakpoints in a script associated with any debugger.
|
||||
static inline void sweepBreakpoints(FreeOp* fop, JSScript* script);
|
||||
static inline void sweepBreakpoints(JSFreeOp* fop, JSScript* script);
|
||||
|
||||
// Destroy the debugging information associated with a script.
|
||||
static void destroyDebugScript(FreeOp* fop, JSScript* script);
|
||||
static void destroyDebugScript(JSFreeOp* fop, JSScript* script);
|
||||
|
||||
// Validate the debugging information in a script after a moving GC>
|
||||
#ifdef JSGC_HASH_TABLE_CHECKS
|
||||
|
@ -348,7 +348,7 @@ class DebugAPI {
|
|||
private:
|
||||
static bool stepModeEnabledSlow(JSScript* script);
|
||||
static bool hasBreakpointsAtSlow(JSScript* script, jsbytecode* pc);
|
||||
static void sweepBreakpointsSlow(FreeOp* fop, JSScript* script);
|
||||
static void sweepBreakpointsSlow(JSFreeOp* fop, JSScript* script);
|
||||
static void slowPathOnNewScript(JSContext* cx, HandleScript script);
|
||||
static void slowPathOnNewGlobalObject(JSContext* cx,
|
||||
Handle<GlobalObject*> global);
|
||||
|
|
|
@ -128,7 +128,7 @@ BreakpointSite* DebugScript::getOrCreateBreakpointSite(JSContext* cx,
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugScript::destroyBreakpointSite(FreeOp* fop, JSScript* script,
|
||||
void DebugScript::destroyBreakpointSite(JSFreeOp* fop, JSScript* script,
|
||||
jsbytecode* pc) {
|
||||
DebugScript* debug = get(script);
|
||||
BreakpointSite*& site = debug->breakpoints[script->pcToOffset(pc)];
|
||||
|
@ -147,7 +147,7 @@ void DebugScript::destroyBreakpointSite(FreeOp* fop, JSScript* script,
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugScript::clearBreakpointsIn(FreeOp* fop, Realm* realm, Debugger* dbg,
|
||||
void DebugScript::clearBreakpointsIn(JSFreeOp* fop, Realm* realm, Debugger* dbg,
|
||||
JSObject* handler) {
|
||||
for (auto script = realm->zone()->cellIter<JSScript>(); !script.done();
|
||||
script.next()) {
|
||||
|
@ -158,7 +158,7 @@ void DebugScript::clearBreakpointsIn(FreeOp* fop, Realm* realm, Debugger* dbg,
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugScript::clearBreakpointsIn(FreeOp* fop, JSScript* script,
|
||||
void DebugScript::clearBreakpointsIn(JSFreeOp* fop, JSScript* script,
|
||||
Debugger* dbg, JSObject* handler) {
|
||||
if (!script->hasDebugScript()) {
|
||||
return;
|
||||
|
@ -210,7 +210,7 @@ bool DebugScript::incrementStepperCount(JSContext* cx, JSScript* script) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugScript::decrementStepperCount(FreeOp* fop, JSScript* script) {
|
||||
void DebugScript::decrementStepperCount(JSFreeOp* fop, JSScript* script) {
|
||||
DebugScript* debug = get(script);
|
||||
MOZ_ASSERT(debug);
|
||||
MOZ_ASSERT(debug->stepperCount > 0);
|
||||
|
@ -254,7 +254,7 @@ bool DebugScript::incrementGeneratorObserverCount(JSContext* cx,
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugScript::decrementGeneratorObserverCount(FreeOp* fop,
|
||||
void DebugScript::decrementGeneratorObserverCount(JSFreeOp* fop,
|
||||
JSScript* script) {
|
||||
DebugScript* debug = get(script);
|
||||
MOZ_ASSERT(debug);
|
||||
|
@ -268,7 +268,7 @@ void DebugScript::decrementGeneratorObserverCount(FreeOp* fop,
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugAPI::destroyDebugScript(FreeOp* fop, JSScript* script) {
|
||||
void DebugAPI::destroyDebugScript(JSFreeOp* fop, JSScript* script) {
|
||||
if (script->hasDebugScript()) {
|
||||
DebugScriptMap* map = script->realm()->debugScriptMap.get();
|
||||
MOZ_ASSERT(map);
|
||||
|
@ -296,7 +296,7 @@ void DebugAPI::checkDebugScriptAfterMovingGC(DebugScript* ds) {
|
|||
#endif // JSGC_HASH_TABLE_CHECKS
|
||||
|
||||
/* static */
|
||||
void DebugAPI::sweepBreakpointsSlow(FreeOp* fop, JSScript* script) {
|
||||
void DebugAPI::sweepBreakpointsSlow(JSFreeOp* fop, JSScript* script) {
|
||||
bool scriptGone = IsAboutToBeFinalizedUnbarriered(&script);
|
||||
for (unsigned i = 0; i < script->length(); i++) {
|
||||
BreakpointSite* site =
|
||||
|
|
|
@ -83,12 +83,12 @@ class DebugScript {
|
|||
static BreakpointSite* getOrCreateBreakpointSite(JSContext* cx,
|
||||
JSScript* script,
|
||||
jsbytecode* pc);
|
||||
static void destroyBreakpointSite(FreeOp* fop, JSScript* script,
|
||||
static void destroyBreakpointSite(JSFreeOp* fop, JSScript* script,
|
||||
jsbytecode* pc);
|
||||
|
||||
static void clearBreakpointsIn(FreeOp* fop, JS::Realm* realm, Debugger* dbg,
|
||||
static void clearBreakpointsIn(JSFreeOp* fop, JS::Realm* realm, Debugger* dbg,
|
||||
JSObject* handler);
|
||||
static void clearBreakpointsIn(FreeOp* fop, JSScript* script, Debugger* dbg,
|
||||
static void clearBreakpointsIn(JSFreeOp* fop, JSScript* script, Debugger* dbg,
|
||||
JSObject* handler);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -102,7 +102,7 @@ class DebugScript {
|
|||
* Only incrementing is fallible, as it could allocate a DebugScript.
|
||||
*/
|
||||
static bool incrementStepperCount(JSContext* cx, JSScript* script);
|
||||
static void decrementStepperCount(FreeOp* fop, JSScript* script);
|
||||
static void decrementStepperCount(JSFreeOp* fop, JSScript* script);
|
||||
|
||||
/*
|
||||
* Increment or decrement the generator observer count. If the count is
|
||||
|
@ -111,7 +111,7 @@ class DebugScript {
|
|||
* Only incrementing is fallible, as it could allocate a DebugScript.
|
||||
*/
|
||||
static bool incrementGeneratorObserverCount(JSContext* cx, JSScript* script);
|
||||
static void decrementGeneratorObserverCount(FreeOp* fop, JSScript* script);
|
||||
static void decrementGeneratorObserverCount(JSFreeOp* fop, JSScript* script);
|
||||
};
|
||||
|
||||
} /* namespace js */
|
||||
|
|
|
@ -308,14 +308,14 @@ bool js::ParseEvalOptions(JSContext* cx, HandleValue value,
|
|||
|
||||
BreakpointSite::BreakpointSite(Type type) : type_(type), enabledCount(0) {}
|
||||
|
||||
void BreakpointSite::inc(FreeOp* fop) {
|
||||
void BreakpointSite::inc(JSFreeOp* fop) {
|
||||
enabledCount++;
|
||||
if (enabledCount == 1) {
|
||||
recompile(fop);
|
||||
}
|
||||
}
|
||||
|
||||
void BreakpointSite::dec(FreeOp* fop) {
|
||||
void BreakpointSite::dec(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(enabledCount > 0);
|
||||
enabledCount--;
|
||||
if (enabledCount == 0) {
|
||||
|
@ -366,7 +366,7 @@ Breakpoint::Breakpoint(Debugger* debugger, BreakpointSite* site,
|
|||
site->breakpoints.pushBack(this);
|
||||
}
|
||||
|
||||
void Breakpoint::destroy(FreeOp* fop,
|
||||
void Breakpoint::destroy(JSFreeOp* fop,
|
||||
MayDestroySite mayDestroySite /* true */) {
|
||||
if (debugger->enabled) {
|
||||
site->dec(fop);
|
||||
|
@ -390,13 +390,13 @@ JSBreakpointSite::JSBreakpointSite(JSScript* script, jsbytecode* pc)
|
|||
MOZ_ASSERT(!DebugAPI::hasBreakpointsAt(script, pc));
|
||||
}
|
||||
|
||||
void JSBreakpointSite::recompile(FreeOp* fop) {
|
||||
void JSBreakpointSite::recompile(JSFreeOp* fop) {
|
||||
if (script->hasBaselineScript()) {
|
||||
script->baselineScript()->toggleDebugTraps(script, pc);
|
||||
}
|
||||
}
|
||||
|
||||
void JSBreakpointSite::destroyIfEmpty(FreeOp* fop) {
|
||||
void JSBreakpointSite::destroyIfEmpty(JSFreeOp* fop) {
|
||||
if (isEmpty()) {
|
||||
DebugScript::destroyBreakpointSite(fop, script, pc);
|
||||
}
|
||||
|
@ -409,11 +409,11 @@ WasmBreakpointSite::WasmBreakpointSite(wasm::Instance* instance_,
|
|||
MOZ_ASSERT(instance->debugEnabled());
|
||||
}
|
||||
|
||||
void WasmBreakpointSite::recompile(FreeOp* fop) {
|
||||
void WasmBreakpointSite::recompile(JSFreeOp* fop) {
|
||||
instance->debug().toggleBreakpointTrap(fop->runtime(), offset, isEnabled());
|
||||
}
|
||||
|
||||
void WasmBreakpointSite::destroyIfEmpty(FreeOp* fop) {
|
||||
void WasmBreakpointSite::destroyIfEmpty(JSFreeOp* fop) {
|
||||
if (isEmpty()) {
|
||||
instance->destroyBreakpointSite(fop, offset);
|
||||
}
|
||||
|
@ -523,7 +523,7 @@ DebuggerMemory& Debugger::memory() const {
|
|||
|
||||
/*** DebuggerVectorHolder *****************************************************/
|
||||
|
||||
static void GlobalDebuggerVectorHolder_finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void GlobalDebuggerVectorHolder_finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->maybeOnHelperThread());
|
||||
void* ptr = obj->as<NativeObject>().getPrivate();
|
||||
auto debuggers = static_cast<GlobalObject::DebuggerVector*>(ptr);
|
||||
|
@ -3063,7 +3063,7 @@ static bool UpdateExecutionObservabilityOfScriptsInZone(
|
|||
|
||||
AutoSuppressProfilerSampling suppressProfilerSampling(cx);
|
||||
|
||||
FreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
|
||||
Vector<JSScript*> scripts(cx);
|
||||
|
||||
|
@ -3756,7 +3756,7 @@ void Debugger::trace(JSTracer* trc) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebugAPI::sweepAll(FreeOp* fop) {
|
||||
void DebugAPI::sweepAll(JSFreeOp* fop) {
|
||||
JSRuntime* rt = fop->runtime();
|
||||
|
||||
Debugger* dbg = rt->debuggerList().getFirst();
|
||||
|
@ -3785,7 +3785,8 @@ void DebugAPI::sweepAll(FreeOp* fop) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void Debugger::detachAllDebuggersFromGlobal(FreeOp* fop, GlobalObject* global) {
|
||||
void Debugger::detachAllDebuggersFromGlobal(JSFreeOp* fop,
|
||||
GlobalObject* global) {
|
||||
const GlobalObject::DebuggerVector* debuggers = global->getDebuggers();
|
||||
MOZ_ASSERT(!debuggers->empty());
|
||||
while (!debuggers->empty()) {
|
||||
|
@ -4693,7 +4694,7 @@ static WeakHeapPtr<Debugger*>* findDebuggerInVector(
|
|||
return p;
|
||||
}
|
||||
|
||||
void Debugger::removeDebuggeeGlobal(FreeOp* fop, GlobalObject* global,
|
||||
void Debugger::removeDebuggeeGlobal(JSFreeOp* fop, GlobalObject* global,
|
||||
WeakGlobalObjectSet::Enum* debugEnum,
|
||||
FromSweep fromSweep) {
|
||||
// The caller might have found global by enumerating this->debuggees; if
|
||||
|
@ -6353,7 +6354,7 @@ bool Debugger::replaceFrameGuts(JSContext* cx, AbstractFramePtr from,
|
|||
// The difference is that the current frameobj is no longer in its
|
||||
// Debugger's frame map, so it will not be cleaned up by neither
|
||||
// lambda. Manually clean it up here.
|
||||
FreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
frameobj->freeFrameIterData(fop);
|
||||
frameobj->maybeDecrementFrameScriptStepperCount(fop, to);
|
||||
|
||||
|
@ -6381,7 +6382,7 @@ void Debugger::removeFromFrameMapsAndClearBreakpointsIn(JSContext* cx,
|
|||
AbstractFramePtr frame,
|
||||
bool suspending) {
|
||||
forEachDebuggerFrame(frame, [&](DebuggerFrame* frameobj) {
|
||||
FreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
frameobj->freeFrameIterData(fop);
|
||||
|
||||
Debugger* dbg = Debugger::fromChildJSObject(frameobj);
|
||||
|
|
|
@ -734,7 +734,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
|
|||
enum class FromSweep { No, Yes };
|
||||
|
||||
MOZ_MUST_USE bool addDebuggeeGlobal(JSContext* cx, Handle<GlobalObject*> obj);
|
||||
void removeDebuggeeGlobal(FreeOp* fop, GlobalObject* global,
|
||||
void removeDebuggeeGlobal(JSFreeOp* fop, GlobalObject* global,
|
||||
WeakGlobalObjectSet::Enum* debugEnum,
|
||||
FromSweep fromSweep);
|
||||
|
||||
|
@ -1059,7 +1059,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
|
|||
|
||||
WeakGlobalObjectSet::Range allDebuggees() const { return debuggees.all(); }
|
||||
|
||||
static void detachAllDebuggersFromGlobal(FreeOp* fop, GlobalObject* global);
|
||||
static void detachAllDebuggersFromGlobal(JSFreeOp* fop, GlobalObject* global);
|
||||
#ifdef DEBUG
|
||||
static bool isDebuggerCrossCompartmentEdge(JSObject* obj,
|
||||
const js::gc::Cell* cell);
|
||||
|
@ -1237,7 +1237,7 @@ struct Handler {
|
|||
virtual void hold(JSObject* owner) = 0;
|
||||
|
||||
/* Report that this Handler is no longer held by owner. See comment above. */
|
||||
virtual void drop(js::FreeOp* fop, JSObject* owner) = 0;
|
||||
virtual void drop(JSFreeOp* fop, JSObject* owner) = 0;
|
||||
|
||||
/*
|
||||
* Trace the reference to the handler. This method will be called by the
|
||||
|
@ -1281,7 +1281,7 @@ class BreakpointSite {
|
|||
size_t allocSize();
|
||||
|
||||
protected:
|
||||
virtual void recompile(FreeOp* fop) = 0;
|
||||
virtual void recompile(JSFreeOp* fop) = 0;
|
||||
bool isEnabled() const { return enabledCount > 0; }
|
||||
|
||||
public:
|
||||
|
@ -1291,10 +1291,10 @@ class BreakpointSite {
|
|||
bool hasBreakpoint(Breakpoint* bp);
|
||||
Type type() const { return type_; }
|
||||
|
||||
void inc(FreeOp* fop);
|
||||
void dec(FreeOp* fop);
|
||||
void inc(JSFreeOp* fop);
|
||||
void dec(JSFreeOp* fop);
|
||||
bool isEmpty() const;
|
||||
virtual void destroyIfEmpty(FreeOp* fop) = 0;
|
||||
virtual void destroyIfEmpty(JSFreeOp* fop) = 0;
|
||||
|
||||
inline JSBreakpointSite* asJS();
|
||||
inline WasmBreakpointSite* asWasm();
|
||||
|
@ -1344,7 +1344,7 @@ class Breakpoint {
|
|||
Breakpoint(Debugger* debugger, BreakpointSite* site, JSObject* handler);
|
||||
|
||||
enum MayDestroySite { False, True };
|
||||
void destroy(FreeOp* fop,
|
||||
void destroy(JSFreeOp* fop,
|
||||
MayDestroySite mayDestroySite = MayDestroySite::True);
|
||||
|
||||
Breakpoint* nextInDebugger();
|
||||
|
@ -1361,12 +1361,12 @@ class JSBreakpointSite : public BreakpointSite {
|
|||
jsbytecode* const pc;
|
||||
|
||||
protected:
|
||||
void recompile(FreeOp* fop) override;
|
||||
void recompile(JSFreeOp* fop) override;
|
||||
|
||||
public:
|
||||
JSBreakpointSite(JSScript* script, jsbytecode* pc);
|
||||
|
||||
void destroyIfEmpty(FreeOp* fop) override;
|
||||
void destroyIfEmpty(JSFreeOp* fop) override;
|
||||
};
|
||||
|
||||
inline JSBreakpointSite* BreakpointSite::asJS() {
|
||||
|
@ -1380,12 +1380,12 @@ class WasmBreakpointSite : public BreakpointSite {
|
|||
uint32_t offset;
|
||||
|
||||
private:
|
||||
void recompile(FreeOp* fop) override;
|
||||
void recompile(JSFreeOp* fop) override;
|
||||
|
||||
public:
|
||||
WasmBreakpointSite(wasm::Instance* instance, uint32_t offset);
|
||||
|
||||
void destroyIfEmpty(FreeOp* fop) override;
|
||||
void destroyIfEmpty(JSFreeOp* fop) override;
|
||||
};
|
||||
|
||||
inline WasmBreakpointSite* BreakpointSite::asWasm() {
|
||||
|
|
|
@ -105,7 +105,7 @@ void ScriptedOnStepHandler::hold(JSObject* owner) {
|
|||
AddCellMemory(owner, allocSize(), MemoryUse::DebuggerOnStepHandler);
|
||||
}
|
||||
|
||||
void ScriptedOnStepHandler::drop(FreeOp* fop, JSObject* owner) {
|
||||
void ScriptedOnStepHandler::drop(JSFreeOp* fop, JSObject* owner) {
|
||||
fop->delete_(owner, this, allocSize(), MemoryUse::DebuggerOnStepHandler);
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ void ScriptedOnPopHandler::hold(JSObject* owner) {
|
|||
AddCellMemory(owner, allocSize(), MemoryUse::DebuggerOnPopHandler);
|
||||
}
|
||||
|
||||
void ScriptedOnPopHandler::drop(FreeOp* fop, JSObject* owner) {
|
||||
void ScriptedOnPopHandler::drop(JSFreeOp* fop, JSObject* owner) {
|
||||
fop->delete_(owner, this, allocSize(), MemoryUse::DebuggerOnPopHandler);
|
||||
}
|
||||
|
||||
|
@ -368,7 +368,7 @@ bool DebuggerFrame::setGenerator(JSContext* cx,
|
|||
return true;
|
||||
}
|
||||
|
||||
void DebuggerFrame::clearGenerator(FreeOp* fop) {
|
||||
void DebuggerFrame::clearGenerator(JSFreeOp* fop) {
|
||||
if (!hasGenerator()) {
|
||||
return;
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ void DebuggerFrame::clearGenerator(FreeOp* fop) {
|
|||
}
|
||||
|
||||
void DebuggerFrame::clearGenerator(
|
||||
FreeOp* fop, Debugger* owner,
|
||||
JSFreeOp* fop, Debugger* owner,
|
||||
Debugger::GeneratorWeakMap::Enum* maybeGeneratorFramesEnum) {
|
||||
if (!hasGenerator()) {
|
||||
return;
|
||||
|
@ -675,7 +675,7 @@ bool DebuggerFrame::setOnStepHandler(JSContext* cx, HandleDebuggerFrame frame,
|
|||
return true;
|
||||
}
|
||||
|
||||
FreeOp* fop = cx->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->defaultFreeOp();
|
||||
AbstractFramePtr referent = DebuggerFrame::getReferent(frame);
|
||||
|
||||
// Adjust execution observability and step counts on whatever code (JS or
|
||||
|
@ -691,7 +691,7 @@ bool DebuggerFrame::setOnStepHandler(JSContext* cx, HandleDebuggerFrame frame,
|
|||
}
|
||||
} else if (!handler && prior) {
|
||||
// Single stepping toggled on->off.
|
||||
FreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->runtime()->defaultFreeOp();
|
||||
if (!instance->debug().decrementStepperCount(fop,
|
||||
wasmFrame->funcIndex())) {
|
||||
return false;
|
||||
|
@ -970,7 +970,7 @@ void DebuggerFrame::setOnPopHandler(JSContext* cx, OnPopHandler* handler) {
|
|||
return;
|
||||
}
|
||||
|
||||
FreeOp* fop = cx->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->defaultFreeOp();
|
||||
|
||||
if (prior) {
|
||||
prior->drop(fop, this);
|
||||
|
@ -1030,7 +1030,7 @@ void DebuggerFrame::setFrameIterData(FrameIter::Data* data) {
|
|||
InitObjectPrivate(this, data, MemoryUse::DebuggerFrameIterData);
|
||||
}
|
||||
|
||||
void DebuggerFrame::freeFrameIterData(FreeOp* fop) {
|
||||
void DebuggerFrame::freeFrameIterData(JSFreeOp* fop) {
|
||||
if (FrameIter::Data* data = frameIterData()) {
|
||||
fop->delete_(this, data, MemoryUse::DebuggerFrameIterData);
|
||||
setPrivate(nullptr);
|
||||
|
@ -1038,7 +1038,7 @@ void DebuggerFrame::freeFrameIterData(FreeOp* fop) {
|
|||
}
|
||||
|
||||
void DebuggerFrame::maybeDecrementFrameScriptStepperCount(
|
||||
FreeOp* fop, AbstractFramePtr frame) {
|
||||
JSFreeOp* fop, AbstractFramePtr frame) {
|
||||
// If this frame has an onStep handler, decrement the script's count.
|
||||
OnStepHandler* handler = onStepHandler();
|
||||
if (!handler) {
|
||||
|
@ -1060,7 +1060,7 @@ void DebuggerFrame::maybeDecrementFrameScriptStepperCount(
|
|||
}
|
||||
|
||||
/* static */
|
||||
void DebuggerFrame::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void DebuggerFrame::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
DebuggerFrame& frameobj = obj->as<DebuggerFrame>();
|
||||
frameobj.freeFrameIterData(fop);
|
||||
|
|
|
@ -51,7 +51,7 @@ class ScriptedOnStepHandler final : public OnStepHandler {
|
|||
explicit ScriptedOnStepHandler(JSObject* object);
|
||||
virtual JSObject* object() const override;
|
||||
virtual void hold(JSObject* owner) override;
|
||||
virtual void drop(js::FreeOp* fop, JSObject* owner) override;
|
||||
virtual void drop(JSFreeOp* fop, JSObject* owner) override;
|
||||
virtual void trace(JSTracer* tracer) override;
|
||||
virtual size_t allocSize() const override;
|
||||
virtual bool onStep(JSContext* cx, HandleDebuggerFrame frame,
|
||||
|
@ -84,7 +84,7 @@ class ScriptedOnPopHandler final : public OnPopHandler {
|
|||
explicit ScriptedOnPopHandler(JSObject* object);
|
||||
virtual JSObject* object() const override;
|
||||
virtual void hold(JSObject* owner) override;
|
||||
virtual void drop(js::FreeOp* fop, JSObject* owner) override;
|
||||
virtual void drop(JSFreeOp* fop, JSObject* owner) override;
|
||||
virtual void trace(JSTracer* tracer) override;
|
||||
virtual size_t allocSize() const override;
|
||||
virtual bool onPop(JSContext* cx, HandleDebuggerFrame frame,
|
||||
|
@ -237,9 +237,9 @@ class DebuggerFrame : public NativeObject {
|
|||
* function will not otherwise disturb generatorFrames. Passing the enum
|
||||
* allows this function to be used while iterating over generatorFrames.
|
||||
*/
|
||||
void clearGenerator(FreeOp* fop);
|
||||
void clearGenerator(JSFreeOp* fop);
|
||||
void clearGenerator(
|
||||
FreeOp* fop, Debugger* owner,
|
||||
JSFreeOp* fop, Debugger* owner,
|
||||
Debugger::GeneratorWeakMap::Enum* maybeGeneratorFramesEnum = nullptr);
|
||||
|
||||
/*
|
||||
|
@ -256,7 +256,7 @@ class DebuggerFrame : public NativeObject {
|
|||
static const JSPropertySpec properties_[];
|
||||
static const JSFunctionSpec methods_[];
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
static AbstractFramePtr getReferent(HandleDebuggerFrame frame);
|
||||
static MOZ_MUST_USE bool getFrameIter(JSContext* cx,
|
||||
|
@ -301,8 +301,8 @@ class DebuggerFrame : public NativeObject {
|
|||
public:
|
||||
FrameIter::Data* frameIterData() const;
|
||||
void setFrameIterData(FrameIter::Data*);
|
||||
void freeFrameIterData(FreeOp* fop);
|
||||
void maybeDecrementFrameScriptStepperCount(FreeOp* fop,
|
||||
void freeFrameIterData(JSFreeOp* fop);
|
||||
void maybeDecrementFrameScriptStepperCount(JSFreeOp* fop,
|
||||
AbstractFramePtr frame);
|
||||
|
||||
class GeneratorInfo;
|
||||
|
|
|
@ -337,15 +337,15 @@ class ArenaLists {
|
|||
bool relocateArenas(Arena*& relocatedListOut, JS::GCReason reason,
|
||||
js::SliceBudget& sliceBudget, gcstats::Statistics& stats);
|
||||
|
||||
void queueForegroundObjectsForSweep(FreeOp* fop);
|
||||
void queueForegroundObjectsForSweep(JSFreeOp* fop);
|
||||
void queueForegroundThingsForSweep();
|
||||
|
||||
void releaseForegroundSweptEmptyArenas();
|
||||
|
||||
bool foregroundFinalize(FreeOp* fop, AllocKind thingKind,
|
||||
bool foregroundFinalize(JSFreeOp* fop, AllocKind thingKind,
|
||||
js::SliceBudget& sliceBudget,
|
||||
SortedArenaList& sweepList);
|
||||
static void backgroundFinalize(FreeOp* fop, Arena* listHead, Arena** empty);
|
||||
static void backgroundFinalize(JSFreeOp* fop, Arena* listHead, Arena** empty);
|
||||
|
||||
void setParallelAllocEnabled(bool enabled);
|
||||
|
||||
|
@ -353,8 +353,10 @@ class ArenaLists {
|
|||
inline JSRuntime* runtime();
|
||||
inline JSRuntime* runtimeFromAnyThread();
|
||||
|
||||
inline void queueForForegroundSweep(FreeOp* fop, const FinalizePhase& phase);
|
||||
inline void queueForBackgroundSweep(FreeOp* fop, const FinalizePhase& phase);
|
||||
inline void queueForForegroundSweep(JSFreeOp* fop,
|
||||
const FinalizePhase& phase);
|
||||
inline void queueForBackgroundSweep(JSFreeOp* fop,
|
||||
const FinalizePhase& phase);
|
||||
inline void queueForForegroundSweep(AllocKind thingKind);
|
||||
inline void queueForBackgroundSweep(AllocKind thingKind);
|
||||
|
||||
|
|
|
@ -25,11 +25,11 @@ class AutoSetThreadIsPerformingGC;
|
|||
} // namespace js
|
||||
|
||||
/*
|
||||
* A FreeOp can do one thing: free memory. For convenience, it has delete_
|
||||
* A JSFreeOp can do one thing: free memory. For convenience, it has delete_
|
||||
* convenience methods that also call destructors.
|
||||
*
|
||||
* FreeOp is passed to finalizers and other sweep-phase hooks so that we do not
|
||||
* need to pass a JSContext to those hooks.
|
||||
* JSFreeOp is passed to finalizers and other sweep-phase hooks so that we do
|
||||
* not need to pass a JSContext to those hooks.
|
||||
*/
|
||||
class JSFreeOp {
|
||||
using Cell = js::gc::Cell;
|
||||
|
@ -86,7 +86,7 @@ class JSFreeOp {
|
|||
void freeUntrackedLater(void* p) { queueForFreeLater(p); }
|
||||
|
||||
// Queue memory that was associated with a GC thing using js::AddCellMemory to
|
||||
// be freed when the FreeOp is destroyed.
|
||||
// be freed when the JSFreeOp is destroyed.
|
||||
//
|
||||
// This should not be called on the default FreeOps returned by
|
||||
// JSRuntime/JSContext::defaultFreeOp() since these are not destroyed until
|
||||
|
|
|
@ -554,7 +554,7 @@ void Arena::staticAsserts() {
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
inline size_t Arena::finalize(FreeOp* fop, AllocKind thingKind,
|
||||
inline size_t Arena::finalize(JSFreeOp* fop, AllocKind thingKind,
|
||||
size_t thingSize) {
|
||||
/* Enforce requirements on size of T. */
|
||||
MOZ_ASSERT(thingSize % CellAlignBytes == 0);
|
||||
|
@ -629,7 +629,7 @@ inline size_t Arena::finalize(FreeOp* fop, AllocKind thingKind,
|
|||
// specified and inserting the others into the appropriate destination size
|
||||
// bins.
|
||||
template <typename T>
|
||||
static inline bool FinalizeTypedArenas(FreeOp* fop, Arena** src,
|
||||
static inline bool FinalizeTypedArenas(JSFreeOp* fop, Arena** src,
|
||||
SortedArenaList& dest,
|
||||
AllocKind thingKind,
|
||||
SliceBudget& budget) {
|
||||
|
@ -665,7 +665,7 @@ static inline bool FinalizeTypedArenas(FreeOp* fop, Arena** src,
|
|||
/*
|
||||
* Finalize the list of areans.
|
||||
*/
|
||||
static bool FinalizeArenas(FreeOp* fop, Arena** src, SortedArenaList& dest,
|
||||
static bool FinalizeArenas(JSFreeOp* fop, Arena** src, SortedArenaList& dest,
|
||||
AllocKind thingKind, SliceBudget& budget) {
|
||||
switch (thingKind) {
|
||||
#define EXPAND_CASE(allocKind, traceKind, type, sizedType, bgFinal, nursery, \
|
||||
|
@ -1950,7 +1950,7 @@ void GCRuntime::removeFinalizeCallback(JSFinalizeCallback callback) {
|
|||
}
|
||||
}
|
||||
|
||||
void GCRuntime::callFinalizeCallbacks(FreeOp* fop,
|
||||
void GCRuntime::callFinalizeCallbacks(JSFreeOp* fop,
|
||||
JSFinalizeStatus status) const {
|
||||
for (auto& p : finalizeCallbacks.ref()) {
|
||||
p.op(fop, status, p.data);
|
||||
|
@ -2574,7 +2574,7 @@ bool MovingTracer::onRegExpSharedEdge(RegExpShared** sharedp) {
|
|||
bool MovingTracer::onBigIntEdge(BigInt** bip) { return updateEdge(bip); }
|
||||
|
||||
void Zone::prepareForCompacting() {
|
||||
FreeOp* fop = runtimeFromMainThread()->defaultFreeOp();
|
||||
JSFreeOp* fop = runtimeFromMainThread()->defaultFreeOp();
|
||||
discardJitCode(fop);
|
||||
}
|
||||
|
||||
|
@ -2597,7 +2597,7 @@ void GCRuntime::sweepTypesAfterCompacting(Zone* zone) {
|
|||
|
||||
void GCRuntime::sweepZoneAfterCompacting(Zone* zone) {
|
||||
MOZ_ASSERT(zone->isCollecting());
|
||||
FreeOp* fop = rt->defaultFreeOp();
|
||||
JSFreeOp* fop = rt->defaultFreeOp();
|
||||
sweepTypesAfterCompacting(zone);
|
||||
zone->sweepBreakpoints(fop);
|
||||
zone->sweepWeakMaps();
|
||||
|
@ -3167,7 +3167,7 @@ ArenaLists::~ArenaLists() {
|
|||
ReleaseArenaList(runtime(), savedEmptyArenas, lock);
|
||||
}
|
||||
|
||||
void ArenaLists::queueForForegroundSweep(FreeOp* fop,
|
||||
void ArenaLists::queueForForegroundSweep(JSFreeOp* fop,
|
||||
const FinalizePhase& phase) {
|
||||
gcstats::AutoPhase ap(fop->runtime()->gc.stats(), phase.statsPhase);
|
||||
for (auto kind : phase.kinds) {
|
||||
|
@ -3184,7 +3184,7 @@ void ArenaLists::queueForForegroundSweep(AllocKind thingKind) {
|
|||
arenaLists(thingKind).clear();
|
||||
}
|
||||
|
||||
void ArenaLists::queueForBackgroundSweep(FreeOp* fop,
|
||||
void ArenaLists::queueForBackgroundSweep(JSFreeOp* fop,
|
||||
const FinalizePhase& phase) {
|
||||
gcstats::AutoPhase ap(fop->runtime()->gc.stats(), phase.statsPhase);
|
||||
for (auto kind : phase.kinds) {
|
||||
|
@ -3209,7 +3209,7 @@ inline void ArenaLists::queueForBackgroundSweep(AllocKind thingKind) {
|
|||
}
|
||||
|
||||
/*static*/
|
||||
void ArenaLists::backgroundFinalize(FreeOp* fop, Arena* listHead,
|
||||
void ArenaLists::backgroundFinalize(JSFreeOp* fop, Arena* listHead,
|
||||
Arena** empty) {
|
||||
MOZ_ASSERT(listHead);
|
||||
MOZ_ASSERT(empty);
|
||||
|
@ -3693,7 +3693,7 @@ void GCRuntime::sweepBackgroundThings(ZoneList& zones, LifoAlloc& freeBlocks) {
|
|||
return;
|
||||
}
|
||||
|
||||
FreeOp fop(nullptr);
|
||||
JSFreeOp fop(nullptr);
|
||||
|
||||
// Sweep zones in order. The atoms zone must be finalized last as other
|
||||
// zones may have direct pointers into it.
|
||||
|
@ -3869,7 +3869,7 @@ void GCRuntime::freeFromBackgroundThread(AutoLockHelperThreadState& lock) {
|
|||
|
||||
lifoBlocks.freeAll();
|
||||
|
||||
FreeOp* fop = TlsContext.get()->defaultFreeOp();
|
||||
JSFreeOp* fop = TlsContext.get()->defaultFreeOp();
|
||||
for (Nursery::BufferSet::Range r = buffers.all(); !r.empty();
|
||||
r.popFront()) {
|
||||
// Malloc memory associated with nursery objects is not tracked as these
|
||||
|
@ -3897,7 +3897,7 @@ bool UniqueIdGCPolicy::needsSweep(Cell** cellp, uint64_t*) {
|
|||
|
||||
void JS::Zone::sweepUniqueIds() { uniqueIds().sweep(); }
|
||||
|
||||
void Realm::destroy(FreeOp* fop) {
|
||||
void Realm::destroy(JSFreeOp* fop) {
|
||||
JSRuntime* rt = fop->runtime();
|
||||
if (auto callback = rt->destroyRealmCallback) {
|
||||
callback(fop, this);
|
||||
|
@ -3910,7 +3910,7 @@ void Realm::destroy(FreeOp* fop) {
|
|||
fop->deleteUntracked(this);
|
||||
}
|
||||
|
||||
void Compartment::destroy(FreeOp* fop) {
|
||||
void Compartment::destroy(JSFreeOp* fop) {
|
||||
JSRuntime* rt = fop->runtime();
|
||||
if (auto callback = rt->destroyCompartmentCallback) {
|
||||
callback(fop, this);
|
||||
|
@ -3921,7 +3921,7 @@ void Compartment::destroy(FreeOp* fop) {
|
|||
rt->gc.stats().sweptCompartment();
|
||||
}
|
||||
|
||||
void Zone::destroy(FreeOp* fop) {
|
||||
void Zone::destroy(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(compartments().empty());
|
||||
// Bug 1560019: Malloc memory associated with a zone but not with a specific
|
||||
// GC thing is not currently tracked.
|
||||
|
@ -3938,7 +3938,7 @@ void Zone::destroy(FreeOp* fop) {
|
|||
* sweepCompartments from deleting every compartment. Instead, it preserves an
|
||||
* arbitrary compartment in the zone.
|
||||
*/
|
||||
void Zone::sweepCompartments(FreeOp* fop, bool keepAtleastOne,
|
||||
void Zone::sweepCompartments(JSFreeOp* fop, bool keepAtleastOne,
|
||||
bool destroyingRuntime) {
|
||||
MOZ_ASSERT(!compartments().empty());
|
||||
MOZ_ASSERT_IF(destroyingRuntime, !keepAtleastOne);
|
||||
|
@ -3968,7 +3968,7 @@ void Zone::sweepCompartments(FreeOp* fop, bool keepAtleastOne,
|
|||
MOZ_ASSERT_IF(destroyingRuntime, compartments().empty());
|
||||
}
|
||||
|
||||
void Compartment::sweepRealms(FreeOp* fop, bool keepAtleastOne,
|
||||
void Compartment::sweepRealms(JSFreeOp* fop, bool keepAtleastOne,
|
||||
bool destroyingRuntime) {
|
||||
MOZ_ASSERT(!realms().empty());
|
||||
MOZ_ASSERT_IF(destroyingRuntime, !keepAtleastOne);
|
||||
|
@ -4009,7 +4009,7 @@ void GCRuntime::deleteEmptyZone(Zone* zone) {
|
|||
MOZ_CRASH("Zone not found");
|
||||
}
|
||||
|
||||
void GCRuntime::sweepZones(FreeOp* fop, bool destroyingRuntime) {
|
||||
void GCRuntime::sweepZones(JSFreeOp* fop, bool destroyingRuntime) {
|
||||
MOZ_ASSERT_IF(destroyingRuntime, numActiveZoneIters == 0);
|
||||
MOZ_ASSERT_IF(destroyingRuntime, arenasEmptyAtShutdown);
|
||||
|
||||
|
@ -5474,7 +5474,7 @@ static inline void MaybeCheckWeakMapMarking(GCRuntime* gc) {
|
|||
}
|
||||
|
||||
IncrementalProgress GCRuntime::markGrayReferencesInCurrentGroup(
|
||||
FreeOp* fop, SliceBudget& budget) {
|
||||
JSFreeOp* fop, SliceBudget& budget) {
|
||||
MOZ_ASSERT(marker.markColor() == MarkColor::Black);
|
||||
|
||||
if (hasMarkedGrayRoots) {
|
||||
|
@ -5517,7 +5517,7 @@ IncrementalProgress GCRuntime::markGrayReferencesInCurrentGroup(
|
|||
return markUntilBudgetExhausted(budget, gcstats::PhaseKind::SWEEP_MARK_GRAY);
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::endMarkingSweepGroup(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::endMarkingSweepGroup(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
MOZ_ASSERT(marker.markColor() == MarkColor::Black);
|
||||
MOZ_ASSERT(!HasIncomingCrossCompartmentPointers(rt));
|
||||
|
@ -5678,7 +5678,7 @@ void GCRuntime::joinTask(GCParallelTask& task, gcstats::PhaseKind phase,
|
|||
stats().recordParallelPhase(phase, task.duration());
|
||||
}
|
||||
|
||||
void GCRuntime::sweepDebuggerOnMainThread(FreeOp* fop) {
|
||||
void GCRuntime::sweepDebuggerOnMainThread(JSFreeOp* fop) {
|
||||
// Detach unreachable debuggers and global objects from each other.
|
||||
// This can modify weakmaps and so must happen before weakmap sweeping.
|
||||
DebugAPI::sweepAll(fop);
|
||||
|
@ -5705,7 +5705,7 @@ void GCRuntime::sweepDebuggerOnMainThread(FreeOp* fop) {
|
|||
}
|
||||
}
|
||||
|
||||
void GCRuntime::sweepJitDataOnMainThread(FreeOp* fop) {
|
||||
void GCRuntime::sweepJitDataOnMainThread(JSFreeOp* fop) {
|
||||
{
|
||||
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP_JIT_DATA);
|
||||
|
||||
|
@ -5823,7 +5823,7 @@ static void SweepWeakCachesOnMainThread(JSRuntime* rt) {
|
|||
});
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::beginSweepingSweepGroup(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::beginSweepingSweepGroup(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
/*
|
||||
* Begin sweeping the group of zones in currentSweepGroup, performing
|
||||
|
@ -5960,11 +5960,11 @@ bool GCRuntime::shouldYieldForZeal(ZealMode mode) {
|
|||
}
|
||||
#endif
|
||||
|
||||
IncrementalProgress GCRuntime::endSweepingSweepGroup(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::endSweepingSweepGroup(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
{
|
||||
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::FINALIZE_END);
|
||||
FreeOp fop(rt);
|
||||
JSFreeOp fop(rt);
|
||||
callFinalizeCallbacks(&fop, JSFINALIZE_GROUP_END);
|
||||
}
|
||||
|
||||
|
@ -6030,7 +6030,7 @@ void GCRuntime::beginSweepPhase(JS::GCReason reason, AutoGCSession& session) {
|
|||
sweepActions->assertFinished();
|
||||
}
|
||||
|
||||
bool ArenaLists::foregroundFinalize(FreeOp* fop, AllocKind thingKind,
|
||||
bool ArenaLists::foregroundFinalize(JSFreeOp* fop, AllocKind thingKind,
|
||||
SliceBudget& sliceBudget,
|
||||
SortedArenaList& sweepList) {
|
||||
if (!arenaListsToSweep(thingKind) && incrementalSweptArenas.ref().isEmpty()) {
|
||||
|
@ -6081,22 +6081,22 @@ void GCRuntime::drainMarkStack() {
|
|||
MOZ_RELEASE_ASSERT(marker.markUntilBudgetExhausted(unlimited));
|
||||
}
|
||||
|
||||
static void SweepThing(FreeOp* fop, Shape* shape) {
|
||||
static void SweepThing(JSFreeOp* fop, Shape* shape) {
|
||||
if (!shape->isMarkedAny()) {
|
||||
shape->sweep(fop);
|
||||
}
|
||||
}
|
||||
|
||||
static void SweepThing(FreeOp* fop, JSScript* script) {
|
||||
static void SweepThing(JSFreeOp* fop, JSScript* script) {
|
||||
AutoSweepJitScript sweep(script);
|
||||
}
|
||||
|
||||
static void SweepThing(FreeOp* fop, ObjectGroup* group) {
|
||||
static void SweepThing(JSFreeOp* fop, ObjectGroup* group) {
|
||||
AutoSweepObjectGroup sweep(group);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static bool SweepArenaList(FreeOp* fop, Arena** arenasToSweep,
|
||||
static bool SweepArenaList(JSFreeOp* fop, Arena** arenasToSweep,
|
||||
SliceBudget& sliceBudget) {
|
||||
while (Arena* arena = *arenasToSweep) {
|
||||
for (ArenaCellIterUnderGC i(arena); !i.done(); i.next()) {
|
||||
|
@ -6114,7 +6114,7 @@ static bool SweepArenaList(FreeOp* fop, Arena** arenasToSweep,
|
|||
return true;
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::sweepTypeInformation(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::sweepTypeInformation(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
// Sweep dead type information stored in scripts and object groups, but
|
||||
// don't finalize them yet. We have to sweep dead information from both live
|
||||
|
@ -6150,7 +6150,7 @@ IncrementalProgress GCRuntime::sweepTypeInformation(FreeOp* fop,
|
|||
return Finished;
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::releaseSweptEmptyArenas(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::releaseSweptEmptyArenas(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
// Foreground finalized GC things have already been finalized, and now their
|
||||
// arenas can be reclaimed by freeing empty ones and making non-empty ones
|
||||
|
@ -6183,7 +6183,7 @@ void GCRuntime::startSweepingAtomsTable() {
|
|||
maybeAtoms.emplace(*atomsTable);
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::sweepAtomsTable(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::sweepAtomsTable(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
if (!atomsZone->isGCSweeping()) {
|
||||
return Finished;
|
||||
|
@ -6313,7 +6313,7 @@ static size_t WeakCacheSweepTaskCount() {
|
|||
return Min(targetTaskCount, MaxWeakCacheSweepTasks);
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::sweepWeakCaches(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::sweepWeakCaches(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
WeakCacheSweepIterator work(this);
|
||||
|
||||
|
@ -6334,7 +6334,7 @@ IncrementalProgress GCRuntime::sweepWeakCaches(FreeOp* fop,
|
|||
return work.empty(lock) ? Finished : NotFinished;
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::finalizeAllocKind(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::finalizeAllocKind(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
// Set the number of things per arena for this AllocKind.
|
||||
size_t thingsPerArena = Arena::thingsPerArena(sweepAllocKind);
|
||||
|
@ -6352,7 +6352,7 @@ IncrementalProgress GCRuntime::finalizeAllocKind(FreeOp* fop,
|
|||
return Finished;
|
||||
}
|
||||
|
||||
IncrementalProgress GCRuntime::sweepShapeTree(FreeOp* fop,
|
||||
IncrementalProgress GCRuntime::sweepShapeTree(JSFreeOp* fop,
|
||||
SliceBudget& budget) {
|
||||
// Remove dead shapes from the shape tree, but don't finalize them yet.
|
||||
|
||||
|
@ -6454,7 +6454,7 @@ namespace sweepaction {
|
|||
|
||||
// Implementation of the SweepAction interface that calls a method on GCRuntime.
|
||||
class SweepActionCall final : public SweepAction {
|
||||
using Method = IncrementalProgress (GCRuntime::*)(FreeOp* fop,
|
||||
using Method = IncrementalProgress (GCRuntime::*)(JSFreeOp* fop,
|
||||
SliceBudget& budget);
|
||||
|
||||
Method method;
|
||||
|
@ -6589,7 +6589,7 @@ class SweepActionForEach final : public SweepAction {
|
|||
};
|
||||
|
||||
static UniquePtr<SweepAction> Call(IncrementalProgress (GCRuntime::*method)(
|
||||
FreeOp* fop, SliceBudget& budget)) {
|
||||
JSFreeOp* fop, SliceBudget& budget)) {
|
||||
return MakeUnique<SweepActionCall>(method);
|
||||
}
|
||||
|
||||
|
@ -6685,7 +6685,7 @@ IncrementalProgress GCRuntime::performSweepActions(SliceBudget& budget) {
|
|||
AutoSetThreadIsSweeping threadIsSweeping;
|
||||
|
||||
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP);
|
||||
FreeOp fop(rt);
|
||||
JSFreeOp fop(rt);
|
||||
|
||||
// Drain the mark stack, except in the first sweep slice where we must not
|
||||
// yield to the mutator until we've starting sweeping a sweep group.
|
||||
|
@ -6732,7 +6732,7 @@ void GCRuntime::endSweepPhase(bool destroyingRuntime) {
|
|||
AutoSetThreadIsSweeping threadIsSweeping;
|
||||
|
||||
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP);
|
||||
FreeOp fop(rt);
|
||||
JSFreeOp fop(rt);
|
||||
|
||||
MOZ_ASSERT_IF(destroyingRuntime, !sweepOnBackgroundThread);
|
||||
|
||||
|
@ -7258,7 +7258,7 @@ void GCRuntime::incrementalSlice(SliceBudget& budget,
|
|||
gcstats::AutoPhase ap1(stats(), gcstats::PhaseKind::SWEEP);
|
||||
gcstats::AutoPhase ap2(stats(), gcstats::PhaseKind::DESTROY);
|
||||
AutoSetThreadIsSweeping threadIsSweeping;
|
||||
FreeOp fop(rt);
|
||||
JSFreeOp fop(rt);
|
||||
sweepZones(&fop, destroyingRuntime);
|
||||
}
|
||||
|
||||
|
@ -8432,7 +8432,7 @@ void PreventGCDuringInteractiveDebug() { TlsContext.get()->suppressGC++; }
|
|||
|
||||
#endif
|
||||
|
||||
void js::ReleaseAllJITCode(FreeOp* fop) {
|
||||
void js::ReleaseAllJITCode(JSFreeOp* fop) {
|
||||
js::CancelOffThreadIonCompile(fop->runtime());
|
||||
|
||||
for (ZonesIter zone(fop->runtime(), SkipAtoms); !zone.done(); zone.next()) {
|
||||
|
|
|
@ -56,7 +56,7 @@ FOR_EACH_NONOBJECT_ALLOCKIND(EXPAND_MAPTYPETOFINALIZEKIND)
|
|||
|
||||
extern void TraceRuntime(JSTracer* trc);
|
||||
|
||||
extern void ReleaseAllJITCode(FreeOp* op);
|
||||
extern void ReleaseAllJITCode(JSFreeOp* op);
|
||||
|
||||
extern void PrepareForDebugGC(JSRuntime* rt);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ struct SweepAction {
|
|||
// The arguments passed to each action.
|
||||
struct Args {
|
||||
GCRuntime* gc;
|
||||
FreeOp* fop;
|
||||
JSFreeOp* fop;
|
||||
SliceBudget& budget;
|
||||
};
|
||||
|
||||
|
@ -630,25 +630,27 @@ class GCRuntime {
|
|||
void groupZonesForSweeping(JS::GCReason reason);
|
||||
MOZ_MUST_USE bool findSweepGroupEdges();
|
||||
void getNextSweepGroup();
|
||||
IncrementalProgress markGrayReferencesInCurrentGroup(FreeOp* fop,
|
||||
IncrementalProgress markGrayReferencesInCurrentGroup(JSFreeOp* fop,
|
||||
SliceBudget& budget);
|
||||
IncrementalProgress endMarkingSweepGroup(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress endMarkingSweepGroup(JSFreeOp* fop, SliceBudget& budget);
|
||||
void markIncomingCrossCompartmentPointers(MarkColor color);
|
||||
IncrementalProgress beginSweepingSweepGroup(FreeOp* fop, SliceBudget& budget);
|
||||
void sweepDebuggerOnMainThread(FreeOp* fop);
|
||||
void sweepJitDataOnMainThread(FreeOp* fop);
|
||||
IncrementalProgress endSweepingSweepGroup(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress beginSweepingSweepGroup(JSFreeOp* fop,
|
||||
SliceBudget& budget);
|
||||
void sweepDebuggerOnMainThread(JSFreeOp* fop);
|
||||
void sweepJitDataOnMainThread(JSFreeOp* fop);
|
||||
IncrementalProgress endSweepingSweepGroup(JSFreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress performSweepActions(SliceBudget& sliceBudget);
|
||||
IncrementalProgress sweepTypeInformation(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress releaseSweptEmptyArenas(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress sweepTypeInformation(JSFreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress releaseSweptEmptyArenas(JSFreeOp* fop,
|
||||
SliceBudget& budget);
|
||||
void startSweepingAtomsTable();
|
||||
IncrementalProgress sweepAtomsTable(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress sweepWeakCaches(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress finalizeAllocKind(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress sweepShapeTree(FreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress sweepAtomsTable(JSFreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress sweepWeakCaches(JSFreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress finalizeAllocKind(JSFreeOp* fop, SliceBudget& budget);
|
||||
IncrementalProgress sweepShapeTree(JSFreeOp* fop, SliceBudget& budget);
|
||||
void endSweepPhase(bool lastGC);
|
||||
bool allCCVisibleZonesWereCollected() const;
|
||||
void sweepZones(FreeOp* fop, bool destroyingRuntime);
|
||||
void sweepZones(JSFreeOp* fop, bool destroyingRuntime);
|
||||
void decommitFreeArenasWithoutUnlocking(const AutoLockGC& lock);
|
||||
void startDecommit();
|
||||
void queueZonesAndStartBackgroundSweep(ZoneList& zones);
|
||||
|
@ -692,7 +694,7 @@ class GCRuntime {
|
|||
void checkForCompartmentMismatches();
|
||||
#endif
|
||||
|
||||
void callFinalizeCallbacks(FreeOp* fop, JSFinalizeStatus status) const;
|
||||
void callFinalizeCallbacks(JSFreeOp* fop, JSFinalizeStatus status) const;
|
||||
void callWeakPointerZonesCallbacks() const;
|
||||
void callWeakPointerCompartmentCallbacks(JS::Compartment* comp) const;
|
||||
void callDoCycleCollectionCallback(JSContext* cx);
|
||||
|
|
|
@ -440,7 +440,7 @@ class Arena {
|
|||
inline size_t& atomBitmapStart();
|
||||
|
||||
template <typename T>
|
||||
size_t finalize(FreeOp* fop, AllocKind thingKind, size_t thingSize);
|
||||
size_t finalize(JSFreeOp* fop, AllocKind thingKind, size_t thingSize);
|
||||
|
||||
static void staticAsserts();
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ Zone::DebuggerVector* Zone::getOrCreateDebuggers(JSContext* cx) {
|
|||
return debuggers;
|
||||
}
|
||||
|
||||
void Zone::sweepBreakpoints(FreeOp* fop) {
|
||||
void Zone::sweepBreakpoints(JSFreeOp* fop) {
|
||||
if (fop->runtime()->debuggerList().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ void Zone::sweepWeakMaps() {
|
|||
WeakMapBase::sweepZone(this);
|
||||
}
|
||||
|
||||
void Zone::discardJitCode(FreeOp* fop,
|
||||
void Zone::discardJitCode(JSFreeOp* fop,
|
||||
ShouldDiscardBaselineCode discardBaselineCode,
|
||||
ShouldDiscardJitScripts discardJitScripts) {
|
||||
if (!jitZone()) {
|
||||
|
@ -540,7 +540,7 @@ void Zone::deleteEmptyCompartment(JS::Compartment* comp) {
|
|||
MOZ_ASSERT(comp->realms().length() == 1);
|
||||
|
||||
Realm* realm = comp->realms()[0];
|
||||
FreeOp* fop = runtimeFromMainThread()->defaultFreeOp();
|
||||
JSFreeOp* fop = runtimeFromMainThread()->defaultFreeOp();
|
||||
realm->destroy(fop);
|
||||
comp->destroy(fop);
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> {
|
|||
explicit Zone(JSRuntime* rt);
|
||||
~Zone();
|
||||
MOZ_MUST_USE bool init(bool isSystem);
|
||||
void destroy(js::FreeOp* fop);
|
||||
void destroy(JSFreeOp* fop);
|
||||
|
||||
static JS::Zone* from(ZoneAllocator* zoneAlloc) {
|
||||
return static_cast<Zone*>(zoneAlloc);
|
||||
|
@ -202,7 +202,7 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> {
|
|||
};
|
||||
|
||||
void discardJitCode(
|
||||
js::FreeOp* fop,
|
||||
JSFreeOp* fop,
|
||||
ShouldDiscardBaselineCode discardBaselineCode = DiscardBaselineCode,
|
||||
ShouldDiscardJitScripts discardJitScripts = KeepJitScripts);
|
||||
|
||||
|
@ -312,10 +312,10 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> {
|
|||
#endif
|
||||
|
||||
void sweepAfterMinorGC(JSTracer* trc);
|
||||
void sweepBreakpoints(js::FreeOp* fop);
|
||||
void sweepBreakpoints(JSFreeOp* fop);
|
||||
void sweepUniqueIds();
|
||||
void sweepWeakMaps();
|
||||
void sweepCompartments(js::FreeOp* fop, bool keepAtleastOne, bool lastGC);
|
||||
void sweepCompartments(JSFreeOp* fop, bool keepAtleastOne, bool lastGC);
|
||||
|
||||
using DebuggerVector = js::Vector<js::Debugger*, 0, js::SystemAllocPolicy>;
|
||||
|
||||
|
|
|
@ -511,7 +511,7 @@ void BaselineScript::Trace(JSTracer* trc, BaselineScript* script) {
|
|||
script->trace(trc);
|
||||
}
|
||||
|
||||
void BaselineScript::Destroy(FreeOp* fop, BaselineScript* script) {
|
||||
void BaselineScript::Destroy(JSFreeOp* fop, BaselineScript* script) {
|
||||
MOZ_ASSERT(!script->hasPendingIonBuilder());
|
||||
|
||||
// This allocation is tracked by JSScript::setBaselineScript /
|
||||
|
@ -915,7 +915,7 @@ void BaselineInterpreter::toggleCodeCoverageInstrumentation(bool enable) {
|
|||
toggleCodeCoverageInstrumentationUnchecked(enable);
|
||||
}
|
||||
|
||||
void jit::FinishDiscardBaselineScript(FreeOp* fop, JSScript* script) {
|
||||
void jit::FinishDiscardBaselineScript(JSFreeOp* fop, JSScript* script) {
|
||||
MOZ_ASSERT(script->hasBaselineScript());
|
||||
MOZ_ASSERT(!script->jitScript()->active());
|
||||
|
||||
|
|
|
@ -289,7 +289,7 @@ struct BaselineScript final {
|
|||
size_t traceLoggerToggleOffsetEntries);
|
||||
|
||||
static void Trace(JSTracer* trc, BaselineScript* script);
|
||||
static void Destroy(FreeOp* fop, BaselineScript* script);
|
||||
static void Destroy(JSFreeOp* fop, BaselineScript* script);
|
||||
|
||||
static inline size_t offsetOfMethod() {
|
||||
return offsetof(BaselineScript, method_);
|
||||
|
@ -423,7 +423,7 @@ bool CanBaselineInterpretScript(JSScript* script);
|
|||
bool BaselineCompileFromBaselineInterpreter(JSContext* cx, BaselineFrame* frame,
|
||||
uint8_t** res);
|
||||
|
||||
void FinishDiscardBaselineScript(FreeOp* fop, JSScript* script);
|
||||
void FinishDiscardBaselineScript(JSFreeOp* fop, JSScript* script);
|
||||
|
||||
void AddSizeOfBaselineData(JSScript* script, mozilla::MallocSizeOf mallocSizeOf,
|
||||
size_t* data);
|
||||
|
|
|
@ -708,7 +708,7 @@ void JitCode::traceChildren(JSTracer* trc) {
|
|||
}
|
||||
}
|
||||
|
||||
void JitCode::finalize(FreeOp* fop) {
|
||||
void JitCode::finalize(JSFreeOp* fop) {
|
||||
// If this jitcode had a bytecode map, it must have already been removed.
|
||||
#ifdef DEBUG
|
||||
JSRuntime* rt = fop->runtime();
|
||||
|
@ -1037,7 +1037,7 @@ void IonScript::Trace(JSTracer* trc, IonScript* script) {
|
|||
}
|
||||
}
|
||||
|
||||
void IonScript::Destroy(FreeOp* fop, IonScript* script) {
|
||||
void IonScript::Destroy(JSFreeOp* fop, IonScript* script) {
|
||||
// This allocation is tracked by JSScript::setIonScript / clearIonScript.
|
||||
fop->deleteUntracked(script);
|
||||
}
|
||||
|
@ -2493,7 +2493,7 @@ MethodStatus jit::Recompile(JSContext* cx, HandleScript script,
|
|||
return Method_Compiled;
|
||||
}
|
||||
|
||||
static void InvalidateActivation(FreeOp* fop,
|
||||
static void InvalidateActivation(JSFreeOp* fop,
|
||||
const JitActivationIterator& activations,
|
||||
bool invalidateAll) {
|
||||
JitSpew(JitSpew_IonInvalidate, "BEGIN invalidating activation");
|
||||
|
@ -2660,7 +2660,7 @@ static void InvalidateActivation(FreeOp* fop,
|
|||
JitSpew(JitSpew_IonInvalidate, "END invalidating activation");
|
||||
}
|
||||
|
||||
void jit::InvalidateAll(FreeOp* fop, Zone* zone) {
|
||||
void jit::InvalidateAll(JSFreeOp* fop, Zone* zone) {
|
||||
// The caller should previously have cancelled off thread compilation.
|
||||
#ifdef DEBUG
|
||||
for (RealmsInZoneIter realm(zone); !realm.done(); realm.next()) {
|
||||
|
@ -2691,7 +2691,7 @@ static void ClearIonScriptAfterInvalidation(JSContext* cx, JSScript* script,
|
|||
}
|
||||
}
|
||||
|
||||
void jit::Invalidate(TypeZone& types, FreeOp* fop,
|
||||
void jit::Invalidate(TypeZone& types, JSFreeOp* fop,
|
||||
const RecompileInfoVector& invalid, bool resetUses,
|
||||
bool cancelOffThread) {
|
||||
JitSpew(JitSpew_IonInvalidate, "Start invalidation.");
|
||||
|
@ -2820,7 +2820,7 @@ void jit::Invalidate(JSContext* cx, JSScript* script, bool resetUses,
|
|||
Invalidate(cx, scripts, resetUses, cancelOffThread);
|
||||
}
|
||||
|
||||
void jit::FinishInvalidation(FreeOp* fop, JSScript* script) {
|
||||
void jit::FinishInvalidation(JSFreeOp* fop, JSScript* script) {
|
||||
if (!script->hasIonScript()) {
|
||||
return;
|
||||
}
|
||||
|
@ -3014,7 +3014,7 @@ size_t jit::SizeOfIonData(JSScript* script,
|
|||
return result;
|
||||
}
|
||||
|
||||
void jit::DestroyJitScripts(FreeOp* fop, JSScript* script) {
|
||||
void jit::DestroyJitScripts(JSFreeOp* fop, JSScript* script) {
|
||||
if (script->hasIonScript()) {
|
||||
IonScript* ion = script->ionScript();
|
||||
script->clearIonScript(fop);
|
||||
|
|
|
@ -169,7 +169,7 @@ static inline bool IsErrorStatus(JitExecStatus status) {
|
|||
struct EnterJitData;
|
||||
|
||||
// Walk the stack and invalidate active Ion frames for the invalid scripts.
|
||||
void Invalidate(TypeZone& types, FreeOp* fop,
|
||||
void Invalidate(TypeZone& types, JSFreeOp* fop,
|
||||
const RecompileInfoVector& invalid, bool resetUses = true,
|
||||
bool cancelOffThread = true);
|
||||
void Invalidate(JSContext* cx, const RecompileInfoVector& invalid,
|
||||
|
@ -254,7 +254,7 @@ bool OffThreadCompilationAvailable(JSContext* cx);
|
|||
void ForbidCompilation(JSContext* cx, JSScript* script);
|
||||
|
||||
size_t SizeOfIonData(JSScript* script, mozilla::MallocSizeOf mallocSizeOf);
|
||||
void DestroyJitScripts(FreeOp* fop, JSScript* script);
|
||||
void DestroyJitScripts(JSFreeOp* fop, JSScript* script);
|
||||
void TraceJitScripts(JSTracer* trc, JSScript* script);
|
||||
|
||||
bool JitSupportsSimd();
|
||||
|
|
|
@ -101,7 +101,7 @@ class JitCode : public gc::TenuredCell {
|
|||
size_t headerSize() const { return headerSize_; }
|
||||
|
||||
void traceChildren(JSTracer* trc);
|
||||
void finalize(FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
void setInvalidated() { invalidated_ = true; }
|
||||
|
||||
void setHasBytecodeMap() { hasBytecodeMap_ = true; }
|
||||
|
@ -294,7 +294,7 @@ struct IonScript {
|
|||
size_t safepointsSize,
|
||||
OptimizationLevel optimizationLevel);
|
||||
static void Trace(JSTracer* trc, IonScript* script);
|
||||
static void Destroy(FreeOp* fop, IonScript* script);
|
||||
static void Destroy(JSFreeOp* fop, IonScript* script);
|
||||
|
||||
static inline size_t offsetOfMethod() { return offsetof(IonScript, method_); }
|
||||
static inline size_t offsetOfOsrEntryOffset() {
|
||||
|
@ -437,7 +437,7 @@ struct IonScript {
|
|||
|
||||
size_t invalidationCount() const { return invalidationCount_; }
|
||||
void incrementInvalidationCount() { invalidationCount_++; }
|
||||
void decrementInvalidationCount(FreeOp* fop) {
|
||||
void decrementInvalidationCount(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(invalidationCount_);
|
||||
invalidationCount_--;
|
||||
if (!invalidationCount_) {
|
||||
|
|
|
@ -684,8 +684,8 @@ class JitRealm {
|
|||
};
|
||||
|
||||
// Called from Zone::discardJitCode().
|
||||
void InvalidateAll(FreeOp* fop, JS::Zone* zone);
|
||||
void FinishInvalidation(FreeOp* fop, JSScript* script);
|
||||
void InvalidateAll(JSFreeOp* fop, JS::Zone* zone);
|
||||
void FinishInvalidation(JSFreeOp* fop, JSScript* script);
|
||||
|
||||
// This class ensures JIT code is executable on its destruction. Creators
|
||||
// must call makeWritable(), and not attempt to write to the buffer if it fails.
|
||||
|
|
|
@ -163,7 +163,7 @@ bool JSScript::createJitScript(JSContext* cx) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void JSScript::maybeReleaseJitScript(FreeOp* fop) {
|
||||
void JSScript::maybeReleaseJitScript(JSFreeOp* fop) {
|
||||
if (!jitScript_ || zone()->types.keepJitScripts || hasBaselineScript() ||
|
||||
jitScript_->active()) {
|
||||
return;
|
||||
|
@ -172,7 +172,7 @@ void JSScript::maybeReleaseJitScript(FreeOp* fop) {
|
|||
releaseJitScript(fop);
|
||||
}
|
||||
|
||||
void JSScript::releaseJitScript(FreeOp* fop) {
|
||||
void JSScript::releaseJitScript(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(!hasIonScript());
|
||||
|
||||
fop->removeCellMemory(this, jitScript_->allocBytes(), MemoryUse::JitScript);
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
using namespace js;
|
||||
|
||||
static void exn_finalize(FreeOp* fop, JSObject* obj);
|
||||
static void exn_finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
static bool exn_toSource(JSContext* cx, unsigned argc, Value* vp);
|
||||
|
||||
|
@ -337,7 +337,7 @@ JSString* js::ComputeStackString(JSContext* cx) {
|
|||
return str.get();
|
||||
}
|
||||
|
||||
static void exn_finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void exn_finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->maybeOnHelperThread());
|
||||
if (JSErrorReport* report = obj->as<ErrorObject>().getErrorReport()) {
|
||||
// Bug 1560019: This allocation is not currently tracked.
|
||||
|
|
|
@ -1125,15 +1125,6 @@ extern JS_FRIEND_API const DOMCallbacks* GetDOMCallbacks(JSContext* cx);
|
|||
|
||||
extern JS_FRIEND_API JSObject* GetTestingFunctions(JSContext* cx);
|
||||
|
||||
/**
|
||||
* Helper to convert FreeOp to JSFreeOp when the definition of FreeOp is not
|
||||
* available and the compiler does not know that FreeOp inherits from
|
||||
* JSFreeOp.
|
||||
*/
|
||||
inline JSFreeOp* CastToJSFreeOp(FreeOp* fop) {
|
||||
return reinterpret_cast<JSFreeOp*>(fop);
|
||||
}
|
||||
|
||||
/* Implemented in jsexn.cpp. */
|
||||
|
||||
/**
|
||||
|
|
|
@ -715,7 +715,7 @@ void ProxyObject::trace(JSTracer* trc, JSObject* obj) {
|
|||
Proxy::trace(trc, obj);
|
||||
}
|
||||
|
||||
static void proxy_Finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void proxy_Finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
// Suppress a bogus warning about finalize().
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ class FileObject : public NativeObject {
|
|||
return obj;
|
||||
}
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
FileObject* fileObj = &obj->as<FileObject>();
|
||||
RCFile* file = fileObj->rcFile();
|
||||
fop->removeCellMemory(obj, sizeof(*file), MemoryUse::FileObjectFile);
|
||||
|
|
|
@ -6980,7 +6980,7 @@ class StreamCacheEntryObject : public NativeObject {
|
|||
static const ClassOps classOps_;
|
||||
static const JSPropertySpec properties_;
|
||||
|
||||
static void finalize(FreeOp*, JSObject* obj) {
|
||||
static void finalize(JSFreeOp*, JSObject* obj) {
|
||||
obj->as<StreamCacheEntryObject>().cache().Release();
|
||||
}
|
||||
|
||||
|
|
|
@ -901,7 +901,7 @@ bool UnmappedArgumentsObject::obj_enumerate(JSContext* cx, HandleObject obj) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void ArgumentsObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void ArgumentsObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(!IsInsideNursery(obj));
|
||||
ArgumentsObject& argsobj = obj->as<ArgumentsObject>();
|
||||
if (argsobj.data()) {
|
||||
|
|
|
@ -374,7 +374,7 @@ class ArgumentsObject : public NativeObject {
|
|||
: 0);
|
||||
}
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
static size_t objectMoved(JSObject* dst, JSObject* src);
|
||||
|
||||
|
|
|
@ -938,7 +938,7 @@ ArrayBufferObject::FreeInfo* ArrayBufferObject::freeInfo() const {
|
|||
return reinterpret_cast<FreeInfo*>(inlineDataPointer());
|
||||
}
|
||||
|
||||
void ArrayBufferObject::releaseData(FreeOp* fop) {
|
||||
void ArrayBufferObject::releaseData(JSFreeOp* fop) {
|
||||
switch (bufferKind()) {
|
||||
case INLINE_DATA:
|
||||
// Inline data doesn't require releasing.
|
||||
|
@ -1479,7 +1479,7 @@ void ArrayBufferObject::addSizeOfExcludingThis(
|
|||
}
|
||||
|
||||
/* static */
|
||||
void ArrayBufferObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void ArrayBufferObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
obj->as<ArrayBufferObject>().releaseData(fop);
|
||||
}
|
||||
|
||||
|
|
|
@ -389,7 +389,7 @@ class ArrayBufferObject : public ArrayBufferObjectMaybeShared {
|
|||
}
|
||||
bool hasInlineData() const { return dataPointer() == inlineDataPointer(); }
|
||||
|
||||
void releaseData(FreeOp* fop);
|
||||
void releaseData(JSFreeOp* fop);
|
||||
|
||||
BufferKind bufferKind() const {
|
||||
return BufferKind(flags() & BUFFER_KIND_MASK);
|
||||
|
@ -427,7 +427,7 @@ class ArrayBufferObject : public ArrayBufferObjectMaybeShared {
|
|||
#endif
|
||||
uint32_t wasmBoundsCheckLimit() const;
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
static BufferContents createMappedContents(int fd, size_t offset,
|
||||
size_t length);
|
||||
|
|
|
@ -169,7 +169,7 @@ void BigInt::initializeDigitsToZero() {
|
|||
std::uninitialized_fill_n(digs.begin(), digs.Length(), 0);
|
||||
}
|
||||
|
||||
void BigInt::finalize(js::FreeOp* fop) {
|
||||
void BigInt::finalize(JSFreeOp* fop) {
|
||||
if (hasHeapDigits()) {
|
||||
size_t size = digitLength() * sizeof(Digit);
|
||||
fop->free_(this, heapDigits_, size, js::MemoryUse::BigIntDigits);
|
||||
|
|
|
@ -87,7 +87,7 @@ class BigInt final
|
|||
void initializeDigitsToZero();
|
||||
|
||||
void traceChildren(JSTracer* trc);
|
||||
void finalize(js::FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
js::HashNumber hash();
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
|
|
|
@ -324,7 +324,7 @@ class JS::Compartment {
|
|||
public:
|
||||
explicit Compartment(JS::Zone* zone, bool invisibleToDebugger);
|
||||
|
||||
void destroy(js::FreeOp* fop);
|
||||
void destroy(JSFreeOp* fop);
|
||||
|
||||
MOZ_MUST_USE inline bool wrap(JSContext* cx, JS::MutableHandleValue vp);
|
||||
|
||||
|
@ -380,8 +380,7 @@ class JS::Compartment {
|
|||
void traceOutgoingCrossCompartmentWrappers(JSTracer* trc);
|
||||
static void traceIncomingCrossCompartmentEdgesForZoneGC(JSTracer* trc);
|
||||
|
||||
void sweepRealms(js::FreeOp* fop, bool keepAtleastOne,
|
||||
bool destroyingRuntime);
|
||||
void sweepRealms(JSFreeOp* fop, bool keepAtleastOne, bool destroyingRuntime);
|
||||
void sweepAfterMinorGC(JSTracer* trc);
|
||||
void sweepCrossCompartmentObjectWrappers();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ static RealmInstrumentation* GetInstrumentation(JSObject* obj) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void RealmInstrumentation::holderFinalize(FreeOp* fop, JSObject* obj) {
|
||||
void RealmInstrumentation::holderFinalize(JSFreeOp* fop, JSObject* obj) {
|
||||
RealmInstrumentation* instrumentation = GetInstrumentation(obj);
|
||||
fop->delete_(obj, instrumentation, MemoryUse::RealmInstrumentation);
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ class RealmInstrumentation {
|
|||
|
||||
void trace(JSTracer* trc);
|
||||
|
||||
static void holderFinalize(FreeOp* fop, JSObject* obj);
|
||||
static void holderFinalize(JSFreeOp* fop, JSObject* obj);
|
||||
static void holderTrace(JSTracer* trc, JSObject* obj);
|
||||
};
|
||||
|
||||
|
|
|
@ -1078,7 +1078,7 @@ void PropertyIteratorObject::trace(JSTracer* trc, JSObject* obj) {
|
|||
}
|
||||
}
|
||||
|
||||
void PropertyIteratorObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void PropertyIteratorObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
if (NativeIterator* ni =
|
||||
obj->as<PropertyIteratorObject>().getNativeIterator()) {
|
||||
fop->free_(obj, ni, ni->allocationSize(), MemoryUse::NativeIterator);
|
||||
|
|
|
@ -367,7 +367,7 @@ class PropertyIteratorObject : public NativeObject {
|
|||
|
||||
private:
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
};
|
||||
|
||||
class ArrayIteratorObject : public NativeObject {
|
||||
|
|
|
@ -174,7 +174,7 @@ struct JSContext : public JS::RootingContext,
|
|||
// Free lists for parallel allocation in the atoms zone on helper threads.
|
||||
js::ContextData<js::gc::FreeLists*> atomsZoneFreeLists_;
|
||||
|
||||
js::ContextData<js::FreeOp> defaultFreeOp_;
|
||||
js::ContextData<JSFreeOp> defaultFreeOp_;
|
||||
|
||||
// Thread that the JSContext is currently running on, if in use.
|
||||
js::Thread::Id currentThread_;
|
||||
|
@ -297,7 +297,7 @@ struct JSContext : public JS::RootingContext,
|
|||
return *runtime_->wellKnownSymbols;
|
||||
}
|
||||
js::PropertyName* emptyString() { return runtime_->emptyString; }
|
||||
js::FreeOp* defaultFreeOp() { return &defaultFreeOp_.ref(); }
|
||||
JSFreeOp* defaultFreeOp() { return &defaultFreeOp_.ref(); }
|
||||
void* stackLimitAddress(JS::StackKind kind) {
|
||||
return &nativeStackLimit[kind];
|
||||
}
|
||||
|
@ -1288,13 +1288,13 @@ class MOZ_RAII AutoSetThreadIsPerformingGC {
|
|||
|
||||
public:
|
||||
AutoSetThreadIsPerformingGC() : cx(TlsContext.get()) {
|
||||
FreeOp* fop = cx->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->defaultFreeOp();
|
||||
MOZ_ASSERT(!fop->isCollecting());
|
||||
fop->isCollecting_ = true;
|
||||
}
|
||||
|
||||
~AutoSetThreadIsPerformingGC() {
|
||||
FreeOp* fop = cx->defaultFreeOp();
|
||||
JSFreeOp* fop = cx->defaultFreeOp();
|
||||
MOZ_ASSERT(fop->isCollecting());
|
||||
fop->isCollecting_ = false;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ js::NativeObject::dynamicSlotsCount(Shape* shape) {
|
|||
shape->getObjectClass());
|
||||
}
|
||||
|
||||
inline void JSObject::finalize(js::FreeOp* fop) {
|
||||
inline void JSObject::finalize(JSFreeOp* fop) {
|
||||
js::probes::FinalizeObject(this);
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -462,7 +462,7 @@ class JSObject : public js::gc::Cell {
|
|||
MOZ_ALWAYS_INLINE JSNative callHook() const;
|
||||
MOZ_ALWAYS_INLINE JSNative constructHook() const;
|
||||
|
||||
MOZ_ALWAYS_INLINE void finalize(js::FreeOp* fop);
|
||||
MOZ_ALWAYS_INLINE void finalize(JSFreeOp* fop);
|
||||
|
||||
public:
|
||||
static bool nonNativeSetProperty(JSContext* cx, js::HandleObject obj,
|
||||
|
|
|
@ -166,7 +166,7 @@ inline void JSScript::setBaselineScript(
|
|||
}
|
||||
|
||||
inline void JSScript::setBaselineScript(
|
||||
js::FreeOp* fop, js::jit::BaselineScript* baselineScript) {
|
||||
JSFreeOp* fop, js::jit::BaselineScript* baselineScript) {
|
||||
if (hasBaselineScript()) {
|
||||
js::jit::BaselineScript::writeBarrierPre(zone(), baseline);
|
||||
clearBaselineScript(fop);
|
||||
|
@ -181,14 +181,14 @@ inline void JSScript::setBaselineScript(
|
|||
updateJitCodeRaw(fop->runtime());
|
||||
}
|
||||
|
||||
inline void JSScript::clearBaselineScript(js::FreeOp* fop) {
|
||||
inline void JSScript::clearBaselineScript(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(hasBaselineScript());
|
||||
fop->removeCellMemory(this, baseline->allocBytes(),
|
||||
js::MemoryUse::BaselineScript);
|
||||
baseline = nullptr;
|
||||
}
|
||||
|
||||
inline void JSScript::clearIonScript(js::FreeOp* fop) {
|
||||
inline void JSScript::clearIonScript(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(hasIonScript());
|
||||
fop->removeCellMemory(this, ion->allocBytes(), js::MemoryUse::IonScript);
|
||||
ion = nullptr;
|
||||
|
|
|
@ -1515,7 +1515,7 @@ void JSScript::setIonScript(JSRuntime* rt, js::jit::IonScript* ionScript) {
|
|||
setIonScript(rt->defaultFreeOp(), ionScript);
|
||||
}
|
||||
|
||||
void JSScript::setIonScript(FreeOp* fop, js::jit::IonScript* ionScript) {
|
||||
void JSScript::setIonScript(JSFreeOp* fop, js::jit::IonScript* ionScript) {
|
||||
MOZ_ASSERT_IF(ionScript != ION_DISABLED_SCRIPT,
|
||||
!baselineScript()->hasPendingIonBuilder());
|
||||
if (hasIonScript()) {
|
||||
|
@ -1651,7 +1651,7 @@ bool JSScript::hasScriptName() {
|
|||
return p.found();
|
||||
}
|
||||
|
||||
void ScriptSourceObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void ScriptSourceObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
ScriptSourceObject* sso = &obj->as<ScriptSourceObject>();
|
||||
sso->source()->decref();
|
||||
|
@ -4189,7 +4189,7 @@ void JSScript::addSizeOfJitScript(mozilla::MallocSizeOf mallocSizeOf,
|
|||
|
||||
js::GlobalObject& JSScript::uninlinedGlobal() const { return global(); }
|
||||
|
||||
void JSScript::finalize(FreeOp* fop) {
|
||||
void JSScript::finalize(JSFreeOp* fop) {
|
||||
// NOTE: this JSScript may be partially initialized at this point. E.g. we
|
||||
// may have created it and partially initialized it with
|
||||
// JSScript::Create(), but not yet finished initializing it with
|
||||
|
@ -4875,7 +4875,7 @@ void JSScript::traceChildren(JSTracer* trc) {
|
|||
}
|
||||
}
|
||||
|
||||
void LazyScript::finalize(FreeOp* fop) {
|
||||
void LazyScript::finalize(JSFreeOp* fop) {
|
||||
if (lazyData_) {
|
||||
fop->free_(this, lazyData_, lazyData_->allocationSize(),
|
||||
MemoryUse::LazyScriptData);
|
||||
|
|
|
@ -1279,7 +1279,7 @@ class ScriptSourceObject : public NativeObject {
|
|||
static const Class class_;
|
||||
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
static ScriptSourceObject* create(JSContext* cx, ScriptSource* source);
|
||||
static ScriptSourceObject* clone(JSContext* cx, HandleScriptSourceObject sso);
|
||||
|
@ -2616,8 +2616,8 @@ class JSScript : public js::BaseScript {
|
|||
js::jit::IonScript* maybeIonScript() const { return ion; }
|
||||
js::jit::IonScript* const* addressOfIonScript() const { return &ion; }
|
||||
void setIonScript(JSRuntime* rt, js::jit::IonScript* ionScript);
|
||||
void setIonScript(js::FreeOp* fop, js::jit::IonScript* ionScript);
|
||||
inline void clearIonScript(js::FreeOp* fop);
|
||||
void setIonScript(JSFreeOp* fop, js::jit::IonScript* ionScript);
|
||||
inline void clearIonScript(JSFreeOp* fop);
|
||||
|
||||
bool hasBaselineScript() const {
|
||||
bool res = baseline && baseline != BASELINE_DISABLED_SCRIPT;
|
||||
|
@ -2633,9 +2633,9 @@ class JSScript : public js::BaseScript {
|
|||
}
|
||||
inline void setBaselineScript(JSRuntime* rt,
|
||||
js::jit::BaselineScript* baselineScript);
|
||||
inline void setBaselineScript(js::FreeOp* fop,
|
||||
inline void setBaselineScript(JSFreeOp* fop,
|
||||
js::jit::BaselineScript* baselineScript);
|
||||
inline void clearBaselineScript(js::FreeOp* fop);
|
||||
inline void clearBaselineScript(JSFreeOp* fop);
|
||||
|
||||
void updateJitCodeRaw(JSRuntime* rt);
|
||||
|
||||
|
@ -2751,8 +2751,8 @@ class JSScript : public js::BaseScript {
|
|||
bool hasJitScript() const { return jitScript_ != nullptr; }
|
||||
js::jit::JitScript* jitScript() { return jitScript_; }
|
||||
|
||||
void maybeReleaseJitScript(js::FreeOp* fop);
|
||||
void releaseJitScript(js::FreeOp* fop);
|
||||
void maybeReleaseJitScript(JSFreeOp* fop);
|
||||
void releaseJitScript(JSFreeOp* fop);
|
||||
|
||||
inline js::GlobalObject& global() const;
|
||||
inline bool hasGlobal(const js::GlobalObject* global) const;
|
||||
|
@ -3046,7 +3046,7 @@ class JSScript : public js::BaseScript {
|
|||
bool hasDebugScript() const { return hasFlag(MutableFlags::HasDebugScript); }
|
||||
void setHasDebugScript(bool b) { setFlag(MutableFlags::HasDebugScript, b); }
|
||||
|
||||
void finalize(js::FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
|
||||
static const JS::TraceKind TraceKind = JS::TraceKind::Script;
|
||||
|
||||
|
@ -3460,7 +3460,7 @@ class LazyScript : public BaseScript {
|
|||
|
||||
friend class GCMarker;
|
||||
void traceChildren(JSTracer* trc);
|
||||
void finalize(js::FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
|
||||
static const JS::TraceKind TraceKind = JS::TraceKind::LazyScript;
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ ObjectGroup::ObjectGroup(const Class* clasp, TaggedProto proto,
|
|||
setGeneration(zone()->types.generation);
|
||||
}
|
||||
|
||||
void ObjectGroup::finalize(FreeOp* fop) {
|
||||
void ObjectGroup::finalize(JSFreeOp* fop) {
|
||||
if (auto newScript = newScriptDontCheckGeneration()) {
|
||||
newScript->clear();
|
||||
fop->delete_(this, newScript, newScript->gcMallocBytes(),
|
||||
|
|
|
@ -432,7 +432,7 @@ class ObjectGroup : public gc::TenuredCell {
|
|||
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
void finalize(FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
|
||||
static const JS::TraceKind TraceKind = JS::TraceKind::ObjectGroup;
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ void js::ForOfPIC::Chain::trace(JSTracer* trc) {
|
|||
}
|
||||
}
|
||||
|
||||
static void ForOfPIC_finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void ForOfPIC_finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->maybeOnHelperThread());
|
||||
if (ForOfPIC::Chain* chain =
|
||||
ForOfPIC::fromJSObject(&obj->as<NativeObject>())) {
|
||||
|
@ -301,12 +301,12 @@ static void ForOfPIC_finalize(FreeOp* fop, JSObject* obj) {
|
|||
}
|
||||
}
|
||||
|
||||
void js::ForOfPIC::Chain::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void js::ForOfPIC::Chain::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
freeAllStubs(fop);
|
||||
fop->delete_(obj, this, MemoryUse::ForOfPIC);
|
||||
}
|
||||
|
||||
void js::ForOfPIC::Chain::freeAllStubs(FreeOp* fop) {
|
||||
void js::ForOfPIC::Chain::freeAllStubs(JSFreeOp* fop) {
|
||||
Stub* stub = stubs_;
|
||||
while (stub) {
|
||||
Stub* next = stub->next();
|
||||
|
|
|
@ -187,7 +187,7 @@ struct ForOfPIC {
|
|||
bool tryOptimizeArrayIteratorNext(JSContext* cx, bool* optimized);
|
||||
|
||||
void trace(JSTracer* trc);
|
||||
void finalize(FreeOp* fop, JSObject* obj);
|
||||
void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
private:
|
||||
// Check if the global array-related objects have not been messed with
|
||||
|
@ -211,7 +211,7 @@ struct ForOfPIC {
|
|||
// Erase the stub chain.
|
||||
void eraseChain(JSContext* cx);
|
||||
|
||||
void freeAllStubs(FreeOp* fop);
|
||||
void freeAllStubs(JSFreeOp* fop);
|
||||
};
|
||||
|
||||
// Class for object that holds ForOfPIC chain.
|
||||
|
|
|
@ -462,7 +462,7 @@ class JS::Realm : public JS::shadow::Realm {
|
|||
~Realm();
|
||||
|
||||
MOZ_MUST_USE bool init(JSContext* cx, JSPrincipals* principals);
|
||||
void destroy(js::FreeOp* fop);
|
||||
void destroy(JSFreeOp* fop);
|
||||
void clearTables();
|
||||
|
||||
void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
|
||||
|
|
|
@ -925,7 +925,7 @@ void RegExpShared::discardJitCode() {
|
|||
tables.clearAndFree();
|
||||
}
|
||||
|
||||
void RegExpShared::finalize(FreeOp* fop) {
|
||||
void RegExpShared::finalize(JSFreeOp* fop) {
|
||||
for (auto& comp : compilationArray) {
|
||||
if (comp.byteCode) {
|
||||
size_t length = comp.byteCodeLength();
|
||||
|
|
|
@ -185,7 +185,7 @@ class RegExpShared : public gc::TenuredCell {
|
|||
|
||||
void traceChildren(JSTracer* trc);
|
||||
void discardJitCode();
|
||||
void finalize(FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
|
||||
static size_t offsetOfSource() { return offsetof(RegExpShared, source); }
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ using namespace js;
|
|||
* that js::Class in a global reserved slot.
|
||||
*/
|
||||
|
||||
static void resc_finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void resc_finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
RegExpStatics* res =
|
||||
static_cast<RegExpStatics*>(obj->as<RegExpStaticsObject>().getPrivate());
|
||||
|
|
|
@ -690,10 +690,10 @@ struct JSRuntime {
|
|||
js::WriteOnceData<js::PropertyName*> emptyString;
|
||||
|
||||
private:
|
||||
js::MainThreadData<js::FreeOp*> defaultFreeOp_;
|
||||
js::MainThreadData<JSFreeOp*> defaultFreeOp_;
|
||||
|
||||
public:
|
||||
js::FreeOp* defaultFreeOp() {
|
||||
JSFreeOp* defaultFreeOp() {
|
||||
MOZ_ASSERT(defaultFreeOp_);
|
||||
return defaultFreeOp_;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ class SavedFrame : public NativeObject {
|
|||
static bool parentProperty(JSContext* cx, unsigned argc, Value* vp);
|
||||
static bool toStringMethod(JSContext* cx, unsigned argc, Value* vp);
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
// Convenient getters for SavedFrame's reserved slots for use from C++.
|
||||
JSAtom* getSource();
|
||||
|
|
|
@ -400,7 +400,7 @@ const Class SavedFrame::protoClass_ = {
|
|||
JS_PS_END};
|
||||
|
||||
/* static */
|
||||
void SavedFrame::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void SavedFrame::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->onMainThread());
|
||||
JSPrincipals* p = obj->as<SavedFrame>().getPrincipals();
|
||||
if (p) {
|
||||
|
|
|
@ -463,7 +463,7 @@ Scope* Scope::clone(JSContext* cx, HandleScope scope, HandleScope enclosing) {
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void Scope::finalize(FreeOp* fop) {
|
||||
void Scope::finalize(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(CurrentThreadIsGCSweeping());
|
||||
applyScopeDataTyped([this, fop](auto data) {
|
||||
fop->delete_(this, data, SizeOfAllocatedData(data), MemoryUse::ScopeData);
|
||||
|
|
|
@ -382,7 +382,7 @@ class Scope : public js::gc::TenuredCell {
|
|||
static Scope* clone(JSContext* cx, HandleScope scope, HandleScope enclosing);
|
||||
|
||||
void traceChildren(JSTracer* trc);
|
||||
void finalize(FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
|
||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ bool Shape::hashify(JSContext* cx, Shape* shape) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void ShapeCachePtr::maybePurgeCache(FreeOp* fop, BaseShape* base) {
|
||||
void ShapeCachePtr::maybePurgeCache(JSFreeOp* fop, BaseShape* base) {
|
||||
if (isTable()) {
|
||||
ShapeTable* table = getTablePointer();
|
||||
if (table->freeList() == SHAPE_INVALID_SLOT) {
|
||||
|
@ -305,7 +305,7 @@ void ShapeTable::trace(JSTracer* trc) {
|
|||
}
|
||||
}
|
||||
|
||||
inline void ShapeCachePtr::destroy(FreeOp* fop, BaseShape* base) {
|
||||
inline void ShapeCachePtr::destroy(JSFreeOp* fop, BaseShape* base) {
|
||||
if (isTable()) {
|
||||
fop->delete_(base, getTablePointer(), MemoryUse::ShapeCache);
|
||||
} else if (isIC()) {
|
||||
|
@ -1683,7 +1683,7 @@ void Zone::checkBaseShapeTableAfterMovingGC() {
|
|||
|
||||
#endif // JSGC_HASH_TABLE_CHECKS
|
||||
|
||||
void BaseShape::finalize(FreeOp* fop) {
|
||||
void BaseShape::finalize(JSFreeOp* fop) {
|
||||
if (cache_.isInitialized()) {
|
||||
cache_.destroy(fop, this);
|
||||
}
|
||||
|
@ -1794,7 +1794,7 @@ bool PropertyTree::insertChild(JSContext* cx, Shape* parent, Shape* child) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void Shape::removeChild(FreeOp* fop, Shape* child) {
|
||||
void Shape::removeChild(JSFreeOp* fop, Shape* child) {
|
||||
MOZ_ASSERT(!child->inDictionary());
|
||||
MOZ_ASSERT(child->parent == this);
|
||||
|
||||
|
@ -1882,7 +1882,7 @@ Shape* PropertyTree::getChild(JSContext* cx, Shape* parent,
|
|||
return inlinedGetChild(cx, parent, child);
|
||||
}
|
||||
|
||||
void Shape::sweep(FreeOp* fop) {
|
||||
void Shape::sweep(JSFreeOp* fop) {
|
||||
/*
|
||||
* We detach the child from the parent if the parent is reachable.
|
||||
*
|
||||
|
@ -1903,7 +1903,7 @@ void Shape::sweep(FreeOp* fop) {
|
|||
}
|
||||
}
|
||||
|
||||
void Shape::finalize(FreeOp* fop) {
|
||||
void Shape::finalize(JSFreeOp* fop) {
|
||||
if (!inDictionary() && kids.isHash()) {
|
||||
fop->delete_(this, kids.toHash(), MemoryUse::ShapeKids);
|
||||
}
|
||||
|
|
|
@ -515,9 +515,9 @@ class ShapeCachePtr {
|
|||
p = icptr;
|
||||
}
|
||||
|
||||
void destroy(FreeOp* fop, BaseShape* base);
|
||||
void destroy(JSFreeOp* fop, BaseShape* base);
|
||||
|
||||
void maybePurgeCache(FreeOp* fop, BaseShape* base);
|
||||
void maybePurgeCache(JSFreeOp* fop, BaseShape* base);
|
||||
|
||||
void trace(JSTracer* trc);
|
||||
|
||||
|
@ -669,7 +669,7 @@ class BaseShape : public gc::TenuredCell {
|
|||
BaseShape& operator=(const BaseShape& other) = delete;
|
||||
|
||||
public:
|
||||
void finalize(FreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
|
||||
explicit inline BaseShape(const StackBaseShape& base);
|
||||
|
||||
|
@ -740,7 +740,7 @@ class BaseShape : public gc::TenuredCell {
|
|||
return (cache_.isIC()) ? cache_.getICPointer() : nullptr;
|
||||
}
|
||||
|
||||
void maybePurgeCache(FreeOp* fop) { cache_.maybePurgeCache(fop, this); }
|
||||
void maybePurgeCache(JSFreeOp* fop) { cache_.maybePurgeCache(fop, this); }
|
||||
|
||||
uint32_t slotSpan() const {
|
||||
MOZ_ASSERT(isOwned());
|
||||
|
@ -1353,9 +1353,9 @@ class Shape : public gc::TenuredCell {
|
|||
void dumpSubtree(int level, js::GenericPrinter& out) const;
|
||||
#endif
|
||||
|
||||
void sweep(FreeOp* fop);
|
||||
void finalize(FreeOp* fop);
|
||||
void removeChild(FreeOp* fop, Shape* child);
|
||||
void sweep(JSFreeOp* fop);
|
||||
void finalize(JSFreeOp* fop);
|
||||
void removeChild(JSFreeOp* fop, Shape* child);
|
||||
|
||||
static const JS::TraceKind TraceKind = JS::TraceKind::Shape;
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ SharedArrayRawBuffer* SharedArrayBufferObject::rawBufferObject() const {
|
|||
return reinterpret_cast<SharedArrayRawBuffer*>(v.toPrivate());
|
||||
}
|
||||
|
||||
void SharedArrayBufferObject::Finalize(FreeOp* fop, JSObject* obj) {
|
||||
void SharedArrayBufferObject::Finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(fop->maybeOnHelperThread());
|
||||
|
||||
SharedArrayBufferObject& buf = obj->as<SharedArrayBufferObject>();
|
||||
|
|
|
@ -187,7 +187,7 @@ class SharedArrayBufferObject : public ArrayBufferObjectMaybeShared {
|
|||
uint32_t length,
|
||||
HandleObject proto = nullptr);
|
||||
|
||||
static void Finalize(FreeOp* fop, JSObject* obj);
|
||||
static void Finalize(JSFreeOp* fop, JSObject* obj);
|
||||
|
||||
static void addSizeOfExcludingThis(JSObject* obj,
|
||||
mozilla::MallocSizeOf mallocSizeOf,
|
||||
|
|
|
@ -411,7 +411,7 @@ inline JSLinearString* js::StaticStrings::getUnitStringForElement(
|
|||
return js::NewInlineString<CanGC>(cx, mozilla::Range<const char16_t>(&c, 1));
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_INLINE void JSString::finalize(js::FreeOp* fop) {
|
||||
MOZ_ALWAYS_INLINE void JSString::finalize(JSFreeOp* fop) {
|
||||
/* FatInline strings are in a different arena. */
|
||||
MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_STRING);
|
||||
MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_ATOM);
|
||||
|
@ -423,7 +423,7 @@ MOZ_ALWAYS_INLINE void JSString::finalize(js::FreeOp* fop) {
|
|||
}
|
||||
}
|
||||
|
||||
inline void JSFlatString::finalize(js::FreeOp* fop) {
|
||||
inline void JSFlatString::finalize(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_STRING);
|
||||
MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_ATOM);
|
||||
|
||||
|
@ -442,21 +442,21 @@ inline size_t JSFlatString::allocSize() const {
|
|||
return (count + 1) * charSize;
|
||||
}
|
||||
|
||||
inline void JSFatInlineString::finalize(js::FreeOp* fop) {
|
||||
inline void JSFatInlineString::finalize(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::FAT_INLINE_STRING);
|
||||
MOZ_ASSERT(isInline());
|
||||
|
||||
// Nothing to do.
|
||||
}
|
||||
|
||||
inline void js::FatInlineAtom::finalize(js::FreeOp* fop) {
|
||||
inline void js::FatInlineAtom::finalize(JSFreeOp* fop) {
|
||||
MOZ_ASSERT(JSString::isAtom());
|
||||
MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::FAT_INLINE_ATOM);
|
||||
|
||||
// Nothing to do.
|
||||
}
|
||||
|
||||
inline void JSExternalString::finalize(js::FreeOp* fop) {
|
||||
inline void JSExternalString::finalize(JSFreeOp* fop) {
|
||||
if (!JSString::isExternal()) {
|
||||
// This started out as an external string, but was turned into a
|
||||
// non-external string by JSExternalString::ensureFlat.
|
||||
|
|
|
@ -546,7 +546,7 @@ class JSString : public js::gc::CellWithLengthAndFlags<js::gc::Cell> {
|
|||
|
||||
/* Only called by the GC for strings with the AllocKind::STRING kind. */
|
||||
|
||||
inline void finalize(js::FreeOp* fop);
|
||||
inline void finalize(JSFreeOp* fop);
|
||||
|
||||
/* Gets the number of bytes that the chars take on the heap. */
|
||||
|
||||
|
@ -982,7 +982,7 @@ class JSFlatString : public JSLinearString {
|
|||
|
||||
inline size_t allocSize() const;
|
||||
|
||||
inline void finalize(js::FreeOp* fop);
|
||||
inline void finalize(JSFreeOp* fop);
|
||||
|
||||
#if defined(DEBUG) || defined(JS_JITSPEW)
|
||||
void dumpRepresentation(js::GenericPrinter& out, int indent) const;
|
||||
|
@ -1115,7 +1115,7 @@ class JSFatInlineString : public JSInlineString {
|
|||
|
||||
// Only called by the GC for strings with the AllocKind::FAT_INLINE_STRING
|
||||
// kind.
|
||||
MOZ_ALWAYS_INLINE void finalize(js::FreeOp* fop);
|
||||
MOZ_ALWAYS_INLINE void finalize(JSFreeOp* fop);
|
||||
};
|
||||
|
||||
static_assert(sizeof(JSFatInlineString) % js::gc::CellAlignBytes == 0,
|
||||
|
@ -1145,7 +1145,7 @@ class JSExternalString : public JSLinearString {
|
|||
|
||||
// Only called by the GC for strings with the AllocKind::EXTERNAL_STRING
|
||||
// kind.
|
||||
inline void finalize(js::FreeOp* fop);
|
||||
inline void finalize(JSFreeOp* fop);
|
||||
|
||||
// Free the external chars and allocate a new buffer, converting this to a
|
||||
// flat string (which still lives in an AllocKind::EXTERNAL_STRING
|
||||
|
@ -1236,7 +1236,7 @@ class FatInlineAtom : public JSAtom {
|
|||
HashNumber hash() const { return hash_; }
|
||||
void initHash(HashNumber hash) { hash_ = hash; }
|
||||
|
||||
inline void finalize(js::FreeOp* fop);
|
||||
inline void finalize(JSFreeOp* fop);
|
||||
};
|
||||
|
||||
static_assert(
|
||||
|
|
|
@ -89,7 +89,7 @@ class Symbol : public js::gc::TenuredCell {
|
|||
js::TraceManuallyBarrieredEdge(trc, &description_, "description");
|
||||
}
|
||||
}
|
||||
inline void finalize(js::FreeOp*) {}
|
||||
inline void finalize(JSFreeOp*) {}
|
||||
|
||||
static MOZ_ALWAYS_INLINE void writeBarrierPre(Symbol* thing) {
|
||||
if (thing && !thing->isWellKnownSymbol()) {
|
||||
|
|
|
@ -418,7 +418,7 @@ struct MOZ_RAII AutoEnterAnalysis {
|
|||
// Prevent us from calling the objectMetadataCallback.
|
||||
js::AutoSuppressAllocationMetadataBuilder suppressMetadata;
|
||||
|
||||
FreeOp* freeOp;
|
||||
JSFreeOp* freeOp;
|
||||
Zone* zone;
|
||||
|
||||
explicit AutoEnterAnalysis(JSContext* cx)
|
||||
|
@ -426,7 +426,7 @@ struct MOZ_RAII AutoEnterAnalysis {
|
|||
init(cx->defaultFreeOp(), cx->zone());
|
||||
}
|
||||
|
||||
AutoEnterAnalysis(FreeOp* fop, Zone* zone)
|
||||
AutoEnterAnalysis(JSFreeOp* fop, Zone* zone)
|
||||
: suppressGC(TlsContext.get()), suppressMetadata(zone) {
|
||||
init(fop, zone);
|
||||
}
|
||||
|
@ -444,7 +444,7 @@ struct MOZ_RAII AutoEnterAnalysis {
|
|||
}
|
||||
|
||||
private:
|
||||
void init(FreeOp* fop, Zone* zone) {
|
||||
void init(JSFreeOp* fop, Zone* zone) {
|
||||
#ifdef JS_CRASH_DIAGNOSTICS
|
||||
MOZ_RELEASE_ASSERT(CurrentThreadCanAccessZone(zone));
|
||||
#endif
|
||||
|
|
|
@ -2651,7 +2651,7 @@ bool js::ClassCanHaveExtraProperties(const Class* clasp) {
|
|||
clasp->getOpsGetProperty() || IsTypedArrayClass(clasp);
|
||||
}
|
||||
|
||||
void TypeZone::processPendingRecompiles(FreeOp* fop,
|
||||
void TypeZone::processPendingRecompiles(JSFreeOp* fop,
|
||||
RecompileInfoVector& recompiles) {
|
||||
MOZ_ASSERT(!recompiles.empty());
|
||||
|
||||
|
@ -4486,7 +4486,7 @@ AutoClearTypeInferenceStateOnOOM::~AutoClearTypeInferenceStateOnOOM() {
|
|||
if (zone->types.hadOOMSweepingTypes()) {
|
||||
gc::AutoSetThreadIsSweeping threadIsSweeping;
|
||||
JSRuntime* rt = zone->runtimeFromMainThread();
|
||||
FreeOp fop(rt);
|
||||
JSFreeOp fop(rt);
|
||||
js::CancelOffThreadIonCompile(rt);
|
||||
zone->setPreservingCode(false);
|
||||
zone->discardJitCode(&fop, Zone::KeepBaselineCode);
|
||||
|
|
|
@ -262,7 +262,7 @@ class TypeZone {
|
|||
void addPendingRecompile(JSContext* cx, const RecompileInfo& info);
|
||||
void addPendingRecompile(JSContext* cx, JSScript* script);
|
||||
|
||||
void processPendingRecompiles(FreeOp* fop, RecompileInfoVector& recompiles);
|
||||
void processPendingRecompiles(JSFreeOp* fop, RecompileInfoVector& recompiles);
|
||||
|
||||
bool isSweepingTypes() const { return sweepingTypes; }
|
||||
void setSweepingTypes(bool sweeping) {
|
||||
|
|
|
@ -149,7 +149,7 @@ void TypedArrayObject::assertZeroLengthArrayData() const {
|
|||
}
|
||||
#endif
|
||||
|
||||
void TypedArrayObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void TypedArrayObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
MOZ_ASSERT(!IsInsideNursery(obj));
|
||||
TypedArrayObject* curObj = &obj->as<TypedArrayObject>();
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ class TypedArrayObject : public ArrayBufferViewObject {
|
|||
|
||||
static bool isOriginalByteOffsetGetter(Native native);
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static size_t objectMoved(JSObject* obj, JSObject* old);
|
||||
|
||||
/* Initialization bits */
|
||||
|
|
|
@ -127,7 +127,7 @@ bool DebugState::incrementStepperCount(JSContext* cx, uint32_t funcIndex) {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DebugState::decrementStepperCount(FreeOp* fop, uint32_t funcIndex) {
|
||||
bool DebugState::decrementStepperCount(JSFreeOp* fop, uint32_t funcIndex) {
|
||||
const CodeRange& codeRange =
|
||||
codeRanges(Tier::Debug)[funcToCodeRangeIndex(funcIndex)];
|
||||
MOZ_ASSERT(codeRange.isFunction());
|
||||
|
@ -228,7 +228,7 @@ bool DebugState::hasBreakpointSite(uint32_t offset) {
|
|||
return breakpointSites_.has(offset);
|
||||
}
|
||||
|
||||
void DebugState::destroyBreakpointSite(FreeOp* fop, Instance* instance,
|
||||
void DebugState::destroyBreakpointSite(JSFreeOp* fop, Instance* instance,
|
||||
uint32_t offset) {
|
||||
WasmBreakpointSiteMap::Ptr p = breakpointSites_.lookup(offset);
|
||||
MOZ_ASSERT(p);
|
||||
|
@ -237,7 +237,7 @@ void DebugState::destroyBreakpointSite(FreeOp* fop, Instance* instance,
|
|||
breakpointSites_.remove(p);
|
||||
}
|
||||
|
||||
void DebugState::clearBreakpointsIn(FreeOp* fop, WasmInstanceObject* instance,
|
||||
void DebugState::clearBreakpointsIn(JSFreeOp* fop, WasmInstanceObject* instance,
|
||||
js::Debugger* dbg, JSObject* handler) {
|
||||
MOZ_ASSERT(instance);
|
||||
if (breakpointSites_.empty()) {
|
||||
|
@ -262,7 +262,7 @@ void DebugState::clearBreakpointsIn(FreeOp* fop, WasmInstanceObject* instance,
|
|||
}
|
||||
}
|
||||
|
||||
void DebugState::clearAllBreakpoints(FreeOp* fop,
|
||||
void DebugState::clearAllBreakpoints(JSFreeOp* fop,
|
||||
WasmInstanceObject* instance) {
|
||||
clearBreakpointsIn(fop, instance, nullptr, nullptr);
|
||||
}
|
||||
|
|
|
@ -94,17 +94,18 @@ class DebugState {
|
|||
Instance* instance,
|
||||
uint32_t offset);
|
||||
bool hasBreakpointSite(uint32_t offset);
|
||||
void destroyBreakpointSite(FreeOp* fop, Instance* instance, uint32_t offset);
|
||||
void clearBreakpointsIn(FreeOp* fp, WasmInstanceObject* instance,
|
||||
void destroyBreakpointSite(JSFreeOp* fop, Instance* instance,
|
||||
uint32_t offset);
|
||||
void clearBreakpointsIn(JSFreeOp* fp, WasmInstanceObject* instance,
|
||||
js::Debugger* dbg, JSObject* handler);
|
||||
void clearAllBreakpoints(FreeOp* fp, WasmInstanceObject* instance);
|
||||
void clearAllBreakpoints(JSFreeOp* fp, WasmInstanceObject* instance);
|
||||
|
||||
// When the Code is debug-enabled, single-stepping mode can be toggled on
|
||||
// the granularity of individual functions.
|
||||
|
||||
bool stepModeEnabled(uint32_t funcIndex) const;
|
||||
bool incrementStepperCount(JSContext* cx, uint32_t funcIndex);
|
||||
bool decrementStepperCount(FreeOp* fop, uint32_t funcIndex);
|
||||
bool decrementStepperCount(JSFreeOp* fop, uint32_t funcIndex);
|
||||
|
||||
// Stack inspection helpers.
|
||||
|
||||
|
|
|
@ -1966,7 +1966,7 @@ WasmBreakpointSite* Instance::getOrCreateBreakpointSite(JSContext* cx,
|
|||
return debug().getOrCreateBreakpointSite(cx, this, offset);
|
||||
}
|
||||
|
||||
void Instance::destroyBreakpointSite(FreeOp* fop, uint32_t offset) {
|
||||
void Instance::destroyBreakpointSite(JSFreeOp* fop, uint32_t offset) {
|
||||
MOZ_ASSERT(debugEnabled());
|
||||
return debug().destroyBreakpointSite(fop, this, offset);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ class Instance {
|
|||
const UniqueDebugState maybeDebug_;
|
||||
StructTypeDescrVector structTypeDescrs_;
|
||||
|
||||
friend void Zone::sweepBreakpoints(js::FreeOp*);
|
||||
friend void Zone::sweepBreakpoints(JSFreeOp*);
|
||||
|
||||
// Internal helpers:
|
||||
const void** addressOfFuncTypeId(const FuncTypeIdDesc& funcTypeId) const;
|
||||
|
@ -169,7 +169,7 @@ class Instance {
|
|||
|
||||
JSString* createDisplayURL(JSContext* cx);
|
||||
WasmBreakpointSite* getOrCreateBreakpointSite(JSContext* cx, uint32_t offset);
|
||||
void destroyBreakpointSite(FreeOp* fop, uint32_t offset);
|
||||
void destroyBreakpointSite(JSFreeOp* fop, uint32_t offset);
|
||||
|
||||
// about:memory reporting:
|
||||
|
||||
|
|
|
@ -685,7 +685,7 @@ const JSFunctionSpec WasmModuleObject::static_methods[] = {
|
|||
JS_FS_END};
|
||||
|
||||
/* static */
|
||||
void WasmModuleObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void WasmModuleObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
const Module& module = obj->as<WasmModuleObject>().module();
|
||||
obj->zone()->decJitMemory(module.codeLength(module.code().stableTier()));
|
||||
fop->release(obj, &module, module.gcMallocBytesExcludingCode(),
|
||||
|
@ -1229,7 +1229,7 @@ bool WasmInstanceObject::isNewborn() const {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void WasmInstanceObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void WasmInstanceObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
WasmInstanceObject& instance = obj->as<WasmInstanceObject>();
|
||||
fop->delete_(obj, &instance.exports(), MemoryUse::WasmInstanceExports);
|
||||
fop->delete_(obj, &instance.scopes(), MemoryUse::WasmInstanceScopes);
|
||||
|
@ -1619,7 +1619,7 @@ const Class WasmMemoryObject::class_ = {
|
|||
&WasmMemoryObject::classOps_};
|
||||
|
||||
/* static */
|
||||
void WasmMemoryObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void WasmMemoryObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
WasmMemoryObject& memory = obj->as<WasmMemoryObject>();
|
||||
if (memory.hasObservers()) {
|
||||
fop->delete_(obj, &memory.observers(), MemoryUse::WasmMemoryObservers);
|
||||
|
@ -1968,7 +1968,7 @@ bool WasmTableObject::isNewborn() const {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void WasmTableObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void WasmTableObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
WasmTableObject& tableObj = obj->as<WasmTableObject>();
|
||||
if (!tableObj.isNewborn()) {
|
||||
auto& table = tableObj.table();
|
||||
|
@ -2369,7 +2369,7 @@ void WasmGlobalObject::trace(JSTracer* trc, JSObject* obj) {
|
|||
}
|
||||
|
||||
/* static */
|
||||
void WasmGlobalObject::finalize(FreeOp* fop, JSObject* obj) {
|
||||
void WasmGlobalObject::finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
WasmGlobalObject* global = reinterpret_cast<WasmGlobalObject*>(obj);
|
||||
if (!global->isNewborn()) {
|
||||
fop->delete_(obj, global->cell(), MemoryUse::WasmGlobalCell);
|
||||
|
@ -3424,7 +3424,7 @@ class ResolveResponseClosure : public NativeObject {
|
|||
static const unsigned IMPORT_OBJ_SLOT = 3;
|
||||
static const ClassOps classOps_;
|
||||
|
||||
static void finalize(FreeOp* fop, JSObject* obj) {
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj) {
|
||||
auto& closure = obj->as<ResolveResponseClosure>();
|
||||
fop->release(obj, &closure.compileArgs(),
|
||||
MemoryUse::WasmResolveResponseClosure);
|
||||
|
|
|
@ -127,7 +127,7 @@ JSObject* InitWebAssemblyClass(JSContext* cx, Handle<GlobalObject*> global);
|
|||
class WasmModuleObject : public NativeObject {
|
||||
static const unsigned MODULE_SLOT = 0;
|
||||
static const ClassOps classOps_;
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static bool imports(JSContext* cx, unsigned argc, Value* vp);
|
||||
static bool exports(JSContext* cx, unsigned argc, Value* vp);
|
||||
static bool customSections(JSContext* cx, unsigned argc, Value* vp);
|
||||
|
@ -162,7 +162,7 @@ class WasmGlobalObject : public NativeObject {
|
|||
static const unsigned CELL_SLOT = 2;
|
||||
|
||||
static const ClassOps classOps_;
|
||||
static void finalize(FreeOp*, JSObject* obj);
|
||||
static void finalize(JSFreeOp*, JSObject* obj);
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
|
||||
static bool valueGetterImpl(JSContext* cx, const CallArgs& args);
|
||||
|
@ -218,7 +218,7 @@ class WasmInstanceObject : public NativeObject {
|
|||
static bool exportsGetterImpl(JSContext* cx, const CallArgs& args);
|
||||
static bool exportsGetter(JSContext* cx, unsigned argc, Value* vp);
|
||||
bool isNewborn() const;
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
|
||||
// ExportMap maps from function index to exported function object.
|
||||
|
@ -287,7 +287,7 @@ class WasmMemoryObject : public NativeObject {
|
|||
static const unsigned BUFFER_SLOT = 0;
|
||||
static const unsigned OBSERVERS_SLOT = 1;
|
||||
static const ClassOps classOps_;
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static bool bufferGetterImpl(JSContext* cx, const CallArgs& args);
|
||||
static bool bufferGetter(JSContext* cx, unsigned argc, Value* vp);
|
||||
static bool growImpl(JSContext* cx, const CallArgs& args);
|
||||
|
@ -347,7 +347,7 @@ class WasmTableObject : public NativeObject {
|
|||
static const unsigned TABLE_SLOT = 0;
|
||||
static const ClassOps classOps_;
|
||||
bool isNewborn() const;
|
||||
static void finalize(FreeOp* fop, JSObject* obj);
|
||||
static void finalize(JSFreeOp* fop, JSObject* obj);
|
||||
static void trace(JSTracer* trc, JSObject* obj);
|
||||
static bool lengthGetterImpl(JSContext* cx, const CallArgs& args);
|
||||
static bool lengthGetter(JSContext* cx, unsigned argc, Value* vp);
|
||||
|
|
|
@ -1244,7 +1244,7 @@ class XPCWrappedNativeProto final {
|
|||
|
||||
nsIXPCScriptable* GetScriptable() const { return mScriptable; }
|
||||
|
||||
void JSProtoObjectFinalized(js::FreeOp* fop, JSObject* obj);
|
||||
void JSProtoObjectFinalized(JSFreeOp* fop, JSObject* obj);
|
||||
void JSProtoObjectMoved(JSObject* obj, const JSObject* old);
|
||||
|
||||
void SystemIsBeingShutDown();
|
||||
|
|
Загрузка…
Ссылка в новой задаче