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:
Jon Coppeard 2019-08-12 10:16:02 +00:00
Родитель 68fef4ffb0
Коммит 8186c345e2
98 изменённых файлов: 307 добавлений и 311 удалений

Просмотреть файл

@ -573,7 +573,7 @@ typedef bool (*GetElementsOp)(JSContext* cx, JS::HandleObject obj,
uint32_t begin, uint32_t end, uint32_t begin, uint32_t end,
ElementAdder* adder); 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 // 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 // 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 { namespace js {
struct MOZ_STATIC_CLASS Class { struct MOZ_STATIC_CLASS Class {
JS_CLASS_MEMBERS(js::ClassOps, FreeOp); JS_CLASS_MEMBERS(js::ClassOps, JSFreeOp);
const ClassSpec* spec; const ClassSpec* spec;
const ClassExtension* ext; const ClassExtension* ext;
const ObjectOps* oOps; const ObjectOps* oOps;

Просмотреть файл

@ -488,7 +488,7 @@ static inline void js_free(void* p) {
* - Ordinarily, use js_free/js_delete. * - Ordinarily, use js_free/js_delete.
* *
* - For deallocations during GC finalization, use one of the following * - 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_} * FreeOp::{free_,delete_}
*/ */

Просмотреть файл

@ -251,7 +251,7 @@ MapIteratorObject* MapIteratorObject::create(JSContext* cx, HandleObject obj,
return iterobj; return iterobj;
} }
void MapIteratorObject::finalize(FreeOp* fop, JSObject* obj) { void MapIteratorObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
MOZ_ASSERT(!IsInsideNursery(obj)); MOZ_ASSERT(!IsInsideNursery(obj));
@ -620,7 +620,7 @@ MapObject* MapObject::create(JSContext* cx,
return mapObj; return mapObj;
} }
void MapObject::finalize(FreeOp* fop, JSObject* obj) { void MapObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
if (ValueMap* map = obj->as<MapObject>().getData()) { if (ValueMap* map = obj->as<MapObject>().getData()) {
fop->delete_(obj, map, MemoryUse::MapObjectTable); fop->delete_(obj, map, MemoryUse::MapObjectTable);
@ -628,7 +628,7 @@ void MapObject::finalize(FreeOp* fop, JSObject* obj) {
} }
/* static */ /* static */
void MapObject::sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj) { void MapObject::sweepAfterMinorGC(JSFreeOp* fop, MapObject* mapobj) {
bool wasInsideNursery = IsInsideNursery(mapobj); bool wasInsideNursery = IsInsideNursery(mapobj);
if (wasInsideNursery && !IsForwarded(mapobj)) { if (wasInsideNursery && !IsForwarded(mapobj)) {
finalize(fop, mapobj); finalize(fop, mapobj);
@ -1023,7 +1023,7 @@ SetIteratorObject* SetIteratorObject::create(JSContext* cx, HandleObject obj,
return iterobj; return iterobj;
} }
void SetIteratorObject::finalize(FreeOp* fop, JSObject* obj) { void SetIteratorObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
MOZ_ASSERT(!IsInsideNursery(obj)); 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()); MOZ_ASSERT(fop->onMainThread());
SetObject* setobj = static_cast<SetObject*>(obj); SetObject* setobj = static_cast<SetObject*>(obj);
if (ValueSet* set = setobj->getData()) { if (ValueSet* set = setobj->getData()) {
@ -1253,7 +1253,7 @@ void SetObject::finalize(FreeOp* fop, JSObject* obj) {
} }
/* static */ /* static */
void SetObject::sweepAfterMinorGC(FreeOp* fop, SetObject* setobj) { void SetObject::sweepAfterMinorGC(JSFreeOp* fop, SetObject* setobj) {
bool wasInsideNursery = IsInsideNursery(setobj); bool wasInsideNursery = IsInsideNursery(setobj);
if (wasInsideNursery && !IsForwarded(setobj)) { if (wasInsideNursery && !IsForwarded(setobj)) {
finalize(fop, setobj); finalize(fop, setobj);

Просмотреть файл

@ -139,7 +139,7 @@ class MapObject : public NativeObject {
OrderedHashMap<Value, Value, UnbarrieredHashPolicy, ZoneAllocPolicy>; OrderedHashMap<Value, Value, UnbarrieredHashPolicy, ZoneAllocPolicy>;
friend class OrderedHashTableRef<MapObject>; friend class OrderedHashTableRef<MapObject>;
static void sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj); static void sweepAfterMinorGC(JSFreeOp* fop, MapObject* mapobj);
private: private:
static const ClassSpec classSpec_; static const ClassSpec classSpec_;
@ -152,7 +152,7 @@ class MapObject : public NativeObject {
static ValueMap& extract(HandleObject o); static ValueMap& extract(HandleObject o);
static ValueMap& extract(const CallArgs& args); static ValueMap& extract(const CallArgs& args);
static void trace(JSTracer* trc, JSObject* obj); 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 MOZ_MUST_USE bool construct(JSContext* cx, unsigned argc, Value* vp);
static bool is(HandleValue v); static bool is(HandleValue v);
@ -198,7 +198,7 @@ class MapIteratorObject : public NativeObject {
static MapIteratorObject* create(JSContext* cx, HandleObject mapobj, static MapIteratorObject* create(JSContext* cx, HandleObject mapobj,
ValueMap* data, ValueMap* data,
MapObject::IteratorKind kind); 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 size_t objectMoved(JSObject* obj, JSObject* old);
static MOZ_MUST_USE bool next(Handle<MapIteratorObject*> mapIterator, static MOZ_MUST_USE bool next(Handle<MapIteratorObject*> mapIterator,
@ -253,7 +253,7 @@ class SetObject : public NativeObject {
OrderedHashSet<Value, UnbarrieredHashPolicy, ZoneAllocPolicy>; OrderedHashSet<Value, UnbarrieredHashPolicy, ZoneAllocPolicy>;
friend class OrderedHashTableRef<SetObject>; friend class OrderedHashTableRef<SetObject>;
static void sweepAfterMinorGC(FreeOp* fop, SetObject* setobj); static void sweepAfterMinorGC(JSFreeOp* fop, SetObject* setobj);
private: private:
static const ClassSpec classSpec_; static const ClassSpec classSpec_;
@ -267,7 +267,7 @@ class SetObject : public NativeObject {
static ValueSet& extract(HandleObject o); static ValueSet& extract(HandleObject o);
static ValueSet& extract(const CallArgs& args); static ValueSet& extract(const CallArgs& args);
static void trace(JSTracer* trc, JSObject* obj); 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 construct(JSContext* cx, unsigned argc, Value* vp);
static bool is(HandleValue v); static bool is(HandleValue v);
@ -311,7 +311,7 @@ class SetIteratorObject : public NativeObject {
static SetIteratorObject* create(JSContext* cx, HandleObject setobj, static SetIteratorObject* create(JSContext* cx, HandleObject setobj,
ValueSet* data, ValueSet* data,
SetObject::IteratorKind kind); 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 size_t objectMoved(JSObject* obj, JSObject* old);
static MOZ_MUST_USE bool next(Handle<SetIteratorObject*> setIterator, static MOZ_MUST_USE bool next(Handle<SetIteratorObject*> setIterator,

Просмотреть файл

@ -771,7 +771,7 @@ ModuleObject* ModuleObject::create(JSContext* cx) {
} }
/* static */ /* static */
void ModuleObject::finalize(js::FreeOp* fop, JSObject* obj) { void ModuleObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->maybeOnHelperThread()); MOZ_ASSERT(fop->maybeOnHelperThread());
ModuleObject* self = &obj->as<ModuleObject>(); ModuleObject* self = &obj->as<ModuleObject>();
if (self->hasImportBindings()) { if (self->hasImportBindings()) {

Просмотреть файл

@ -322,7 +322,7 @@ class ModuleObject : public NativeObject {
static const ClassOps classOps_; static const ClassOps classOps_;
static void trace(JSTracer* trc, JSObject* obj); 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; bool hasImportBindings() const;
FunctionDeclarationVector* functionDeclarations(); FunctionDeclarationVector* functionDeclarations();

Просмотреть файл

@ -3644,7 +3644,7 @@ static const JSPropertySpec ReadableByteStreamController_properties[] = {
static const JSFunctionSpec ReadableByteStreamController_methods[] = { static const JSFunctionSpec ReadableByteStreamController_methods[] = {
JS_FS_END}; JS_FS_END};
static void ReadableByteStreamControllerFinalize(FreeOp* fop, JSObject* obj) { static void ReadableByteStreamControllerFinalize(JSFreeOp* fop, JSObject* obj) {
ReadableByteStreamController& controller = ReadableByteStreamController& controller =
obj->as<ReadableByteStreamController>(); obj->as<ReadableByteStreamController>();

Просмотреть файл

@ -3148,7 +3148,7 @@ class CloneBufferObject : public NativeObject {
return CallNonGenericMethod<is, getCloneBufferAsArrayBuffer_impl>(cx, args); 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(); obj->as<CloneBufferObject>().discard();
} }
}; };

Просмотреть файл

@ -3027,7 +3027,7 @@ static bool CreateTraceList(JSContext* cx, HandleTypeDescr descr) {
} }
/* static */ /* static */
void TypeDescr::finalize(FreeOp* fop, JSObject* obj) { void TypeDescr::finalize(JSFreeOp* fop, JSObject* obj) {
TypeDescr& descr = obj->as<TypeDescr>(); TypeDescr& descr = obj->as<TypeDescr>();
if (descr.hasTraceList()) { if (descr.hasTraceList()) {
auto list = const_cast<uint32_t*>(descr.traceList()); 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 initInstances(const JSRuntime* rt, uint8_t* mem, size_t length);
void traceInstances(JSTracer* trace, 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; 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()); MOZ_ASSERT(fop->maybeOnHelperThread());
if (ObjectValueMap* map = obj->as<WeakCollectionObject>().getMap()) { if (ObjectValueMap* map = obj->as<WeakCollectionObject>().getMap()) {
fop->delete_(obj, map, MemoryUse::WeakMapObject); fop->delete_(obj, map, MemoryUse::WeakMapObject);

Просмотреть файл

@ -128,7 +128,7 @@ bool js::intl_Collator(JSContext* cx, unsigned argc, Value* vp) {
return Collator(cx, args); return Collator(cx, args);
} }
void js::CollatorObject::finalize(FreeOp* fop, JSObject* obj) { void js::CollatorObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
const Value& slot = const Value& slot =

Просмотреть файл

@ -36,7 +36,7 @@ class CollatorObject : public NativeObject {
private: private:
static const ClassOps classOps_; static const ClassOps classOps_;
static void finalize(FreeOp* fop, JSObject* obj); static void finalize(JSFreeOp* fop, JSObject* obj);
}; };
extern JSObject* CreateCollatorPrototype(JSContext* cx, 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); 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()); MOZ_ASSERT(fop->onMainThread());
const Value& slot = obj->as<DateTimeFormatObject>().getReservedSlot( const Value& slot = obj->as<DateTimeFormatObject>().getReservedSlot(

Просмотреть файл

@ -34,7 +34,7 @@ class DateTimeFormatObject : public NativeObject {
private: private:
static const ClassOps classOps_; static const ClassOps classOps_;
static void finalize(FreeOp* fop, JSObject* obj); static void finalize(JSFreeOp* fop, JSObject* obj);
}; };
extern JSObject* CreateDateTimeFormatPrototype( extern JSObject* CreateDateTimeFormatPrototype(

Просмотреть файл

@ -149,7 +149,7 @@ bool js::intl_NumberFormat(JSContext* cx, unsigned argc, Value* vp) {
return NumberFormat(cx, args, true); 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()); MOZ_ASSERT(fop->onMainThread());
auto* numberFormat = &obj->as<NumberFormatObject>(); auto* numberFormat = &obj->as<NumberFormatObject>();

Просмотреть файл

@ -65,7 +65,7 @@ class NumberFormatObject : public NativeObject {
private: private:
static const ClassOps classOps_; 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, extern JSObject* CreateNumberFormatPrototype(JSContext* cx, HandleObject Intl,

Просмотреть файл

@ -114,7 +114,7 @@ static bool PluralRules(JSContext* cx, unsigned argc, Value* vp) {
return true; return true;
} }
void js::PluralRulesObject::finalize(FreeOp* fop, JSObject* obj) { void js::PluralRulesObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
auto* pluralRules = &obj->as<PluralRulesObject>(); auto* pluralRules = &obj->as<PluralRulesObject>();

Просмотреть файл

@ -73,7 +73,7 @@ class PluralRulesObject : public NativeObject {
private: private:
static const ClassOps classOps_; static const ClassOps classOps_;
static void finalize(FreeOp* fop, JSObject* obj); static void finalize(JSFreeOp* fop, JSObject* obj);
}; };
extern JSObject* CreatePluralRulesPrototype(JSContext* cx, extern JSObject* CreatePluralRulesPrototype(JSContext* cx,

Просмотреть файл

@ -126,7 +126,7 @@ static bool RelativeTimeFormat(JSContext* cx, unsigned argc, Value* vp) {
return true; return true;
} }
void js::RelativeTimeFormatObject::finalize(FreeOp* fop, JSObject* obj) { void js::RelativeTimeFormatObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
constexpr auto RT_FORMAT_SLOT = constexpr auto RT_FORMAT_SLOT =

Просмотреть файл

@ -32,7 +32,7 @@ class RelativeTimeFormatObject : public NativeObject {
private: private:
static const ClassOps classOps_; static const ClassOps classOps_;
static void finalize(FreeOp* fop, JSObject* obj); static void finalize(JSFreeOp* fop, JSObject* obj);
}; };
extern JSObject* CreateRelativeTimeFormatPrototype( extern JSObject* CreateRelativeTimeFormatPrototype(

Просмотреть файл

@ -173,7 +173,7 @@ void DebugAPI::onPromiseSettled(JSContext* cx, Handle<PromiseObject*> promise) {
} }
/* static */ /* static */
void DebugAPI::sweepBreakpoints(FreeOp* fop, JSScript* script) { void DebugAPI::sweepBreakpoints(JSFreeOp* fop, JSScript* script) {
if (script->hasDebugScript()) { if (script->hasDebugScript()) {
sweepBreakpointsSlow(fop, script); sweepBreakpointsSlow(fop, script);
} }

Просмотреть файл

@ -98,16 +98,16 @@ class DebugAPI {
static void traceAllForMovingGC(JSTracer* trc); static void traceAllForMovingGC(JSTracer* trc);
// Sweep dying debuggers, and detach edges to dying debuggees. // 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. // Add sweep group edges due to the presence of any debuggers.
static MOZ_MUST_USE bool findSweepGroupEdges(JSRuntime* rt); static MOZ_MUST_USE bool findSweepGroupEdges(JSRuntime* rt);
// Sweep breakpoints in a script associated with any debugger. // 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. // 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> // Validate the debugging information in a script after a moving GC>
#ifdef JSGC_HASH_TABLE_CHECKS #ifdef JSGC_HASH_TABLE_CHECKS
@ -348,7 +348,7 @@ class DebugAPI {
private: private:
static bool stepModeEnabledSlow(JSScript* script); static bool stepModeEnabledSlow(JSScript* script);
static bool hasBreakpointsAtSlow(JSScript* script, jsbytecode* pc); 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 slowPathOnNewScript(JSContext* cx, HandleScript script);
static void slowPathOnNewGlobalObject(JSContext* cx, static void slowPathOnNewGlobalObject(JSContext* cx,
Handle<GlobalObject*> global); Handle<GlobalObject*> global);

Просмотреть файл

@ -128,7 +128,7 @@ BreakpointSite* DebugScript::getOrCreateBreakpointSite(JSContext* cx,
} }
/* static */ /* static */
void DebugScript::destroyBreakpointSite(FreeOp* fop, JSScript* script, void DebugScript::destroyBreakpointSite(JSFreeOp* fop, JSScript* script,
jsbytecode* pc) { jsbytecode* pc) {
DebugScript* debug = get(script); DebugScript* debug = get(script);
BreakpointSite*& site = debug->breakpoints[script->pcToOffset(pc)]; BreakpointSite*& site = debug->breakpoints[script->pcToOffset(pc)];
@ -147,7 +147,7 @@ void DebugScript::destroyBreakpointSite(FreeOp* fop, JSScript* script,
} }
/* static */ /* static */
void DebugScript::clearBreakpointsIn(FreeOp* fop, Realm* realm, Debugger* dbg, void DebugScript::clearBreakpointsIn(JSFreeOp* fop, Realm* realm, Debugger* dbg,
JSObject* handler) { JSObject* handler) {
for (auto script = realm->zone()->cellIter<JSScript>(); !script.done(); for (auto script = realm->zone()->cellIter<JSScript>(); !script.done();
script.next()) { script.next()) {
@ -158,7 +158,7 @@ void DebugScript::clearBreakpointsIn(FreeOp* fop, Realm* realm, Debugger* dbg,
} }
/* static */ /* static */
void DebugScript::clearBreakpointsIn(FreeOp* fop, JSScript* script, void DebugScript::clearBreakpointsIn(JSFreeOp* fop, JSScript* script,
Debugger* dbg, JSObject* handler) { Debugger* dbg, JSObject* handler) {
if (!script->hasDebugScript()) { if (!script->hasDebugScript()) {
return; return;
@ -210,7 +210,7 @@ bool DebugScript::incrementStepperCount(JSContext* cx, JSScript* script) {
} }
/* static */ /* static */
void DebugScript::decrementStepperCount(FreeOp* fop, JSScript* script) { void DebugScript::decrementStepperCount(JSFreeOp* fop, JSScript* script) {
DebugScript* debug = get(script); DebugScript* debug = get(script);
MOZ_ASSERT(debug); MOZ_ASSERT(debug);
MOZ_ASSERT(debug->stepperCount > 0); MOZ_ASSERT(debug->stepperCount > 0);
@ -254,7 +254,7 @@ bool DebugScript::incrementGeneratorObserverCount(JSContext* cx,
} }
/* static */ /* static */
void DebugScript::decrementGeneratorObserverCount(FreeOp* fop, void DebugScript::decrementGeneratorObserverCount(JSFreeOp* fop,
JSScript* script) { JSScript* script) {
DebugScript* debug = get(script); DebugScript* debug = get(script);
MOZ_ASSERT(debug); MOZ_ASSERT(debug);
@ -268,7 +268,7 @@ void DebugScript::decrementGeneratorObserverCount(FreeOp* fop,
} }
/* static */ /* static */
void DebugAPI::destroyDebugScript(FreeOp* fop, JSScript* script) { void DebugAPI::destroyDebugScript(JSFreeOp* fop, JSScript* script) {
if (script->hasDebugScript()) { if (script->hasDebugScript()) {
DebugScriptMap* map = script->realm()->debugScriptMap.get(); DebugScriptMap* map = script->realm()->debugScriptMap.get();
MOZ_ASSERT(map); MOZ_ASSERT(map);
@ -296,7 +296,7 @@ void DebugAPI::checkDebugScriptAfterMovingGC(DebugScript* ds) {
#endif // JSGC_HASH_TABLE_CHECKS #endif // JSGC_HASH_TABLE_CHECKS
/* static */ /* static */
void DebugAPI::sweepBreakpointsSlow(FreeOp* fop, JSScript* script) { void DebugAPI::sweepBreakpointsSlow(JSFreeOp* fop, JSScript* script) {
bool scriptGone = IsAboutToBeFinalizedUnbarriered(&script); bool scriptGone = IsAboutToBeFinalizedUnbarriered(&script);
for (unsigned i = 0; i < script->length(); i++) { for (unsigned i = 0; i < script->length(); i++) {
BreakpointSite* site = BreakpointSite* site =

Просмотреть файл

@ -83,12 +83,12 @@ class DebugScript {
static BreakpointSite* getOrCreateBreakpointSite(JSContext* cx, static BreakpointSite* getOrCreateBreakpointSite(JSContext* cx,
JSScript* script, JSScript* script,
jsbytecode* pc); jsbytecode* pc);
static void destroyBreakpointSite(FreeOp* fop, JSScript* script, static void destroyBreakpointSite(JSFreeOp* fop, JSScript* script,
jsbytecode* pc); jsbytecode* pc);
static void clearBreakpointsIn(FreeOp* fop, JS::Realm* realm, Debugger* dbg, static void clearBreakpointsIn(JSFreeOp* fop, JS::Realm* realm, Debugger* dbg,
JSObject* handler); JSObject* handler);
static void clearBreakpointsIn(FreeOp* fop, JSScript* script, Debugger* dbg, static void clearBreakpointsIn(JSFreeOp* fop, JSScript* script, Debugger* dbg,
JSObject* handler); JSObject* handler);
#ifdef DEBUG #ifdef DEBUG
@ -102,7 +102,7 @@ class DebugScript {
* Only incrementing is fallible, as it could allocate a DebugScript. * Only incrementing is fallible, as it could allocate a DebugScript.
*/ */
static bool incrementStepperCount(JSContext* cx, JSScript* script); 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 * 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. * Only incrementing is fallible, as it could allocate a DebugScript.
*/ */
static bool incrementGeneratorObserverCount(JSContext* cx, JSScript* script); static bool incrementGeneratorObserverCount(JSContext* cx, JSScript* script);
static void decrementGeneratorObserverCount(FreeOp* fop, JSScript* script); static void decrementGeneratorObserverCount(JSFreeOp* fop, JSScript* script);
}; };
} /* namespace js */ } /* namespace js */

Просмотреть файл

@ -308,14 +308,14 @@ bool js::ParseEvalOptions(JSContext* cx, HandleValue value,
BreakpointSite::BreakpointSite(Type type) : type_(type), enabledCount(0) {} BreakpointSite::BreakpointSite(Type type) : type_(type), enabledCount(0) {}
void BreakpointSite::inc(FreeOp* fop) { void BreakpointSite::inc(JSFreeOp* fop) {
enabledCount++; enabledCount++;
if (enabledCount == 1) { if (enabledCount == 1) {
recompile(fop); recompile(fop);
} }
} }
void BreakpointSite::dec(FreeOp* fop) { void BreakpointSite::dec(JSFreeOp* fop) {
MOZ_ASSERT(enabledCount > 0); MOZ_ASSERT(enabledCount > 0);
enabledCount--; enabledCount--;
if (enabledCount == 0) { if (enabledCount == 0) {
@ -366,7 +366,7 @@ Breakpoint::Breakpoint(Debugger* debugger, BreakpointSite* site,
site->breakpoints.pushBack(this); site->breakpoints.pushBack(this);
} }
void Breakpoint::destroy(FreeOp* fop, void Breakpoint::destroy(JSFreeOp* fop,
MayDestroySite mayDestroySite /* true */) { MayDestroySite mayDestroySite /* true */) {
if (debugger->enabled) { if (debugger->enabled) {
site->dec(fop); site->dec(fop);
@ -390,13 +390,13 @@ JSBreakpointSite::JSBreakpointSite(JSScript* script, jsbytecode* pc)
MOZ_ASSERT(!DebugAPI::hasBreakpointsAt(script, pc)); MOZ_ASSERT(!DebugAPI::hasBreakpointsAt(script, pc));
} }
void JSBreakpointSite::recompile(FreeOp* fop) { void JSBreakpointSite::recompile(JSFreeOp* fop) {
if (script->hasBaselineScript()) { if (script->hasBaselineScript()) {
script->baselineScript()->toggleDebugTraps(script, pc); script->baselineScript()->toggleDebugTraps(script, pc);
} }
} }
void JSBreakpointSite::destroyIfEmpty(FreeOp* fop) { void JSBreakpointSite::destroyIfEmpty(JSFreeOp* fop) {
if (isEmpty()) { if (isEmpty()) {
DebugScript::destroyBreakpointSite(fop, script, pc); DebugScript::destroyBreakpointSite(fop, script, pc);
} }
@ -409,11 +409,11 @@ WasmBreakpointSite::WasmBreakpointSite(wasm::Instance* instance_,
MOZ_ASSERT(instance->debugEnabled()); MOZ_ASSERT(instance->debugEnabled());
} }
void WasmBreakpointSite::recompile(FreeOp* fop) { void WasmBreakpointSite::recompile(JSFreeOp* fop) {
instance->debug().toggleBreakpointTrap(fop->runtime(), offset, isEnabled()); instance->debug().toggleBreakpointTrap(fop->runtime(), offset, isEnabled());
} }
void WasmBreakpointSite::destroyIfEmpty(FreeOp* fop) { void WasmBreakpointSite::destroyIfEmpty(JSFreeOp* fop) {
if (isEmpty()) { if (isEmpty()) {
instance->destroyBreakpointSite(fop, offset); instance->destroyBreakpointSite(fop, offset);
} }
@ -523,7 +523,7 @@ DebuggerMemory& Debugger::memory() const {
/*** DebuggerVectorHolder *****************************************************/ /*** DebuggerVectorHolder *****************************************************/
static void GlobalDebuggerVectorHolder_finalize(FreeOp* fop, JSObject* obj) { static void GlobalDebuggerVectorHolder_finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->maybeOnHelperThread()); MOZ_ASSERT(fop->maybeOnHelperThread());
void* ptr = obj->as<NativeObject>().getPrivate(); void* ptr = obj->as<NativeObject>().getPrivate();
auto debuggers = static_cast<GlobalObject::DebuggerVector*>(ptr); auto debuggers = static_cast<GlobalObject::DebuggerVector*>(ptr);
@ -3063,7 +3063,7 @@ static bool UpdateExecutionObservabilityOfScriptsInZone(
AutoSuppressProfilerSampling suppressProfilerSampling(cx); AutoSuppressProfilerSampling suppressProfilerSampling(cx);
FreeOp* fop = cx->runtime()->defaultFreeOp(); JSFreeOp* fop = cx->runtime()->defaultFreeOp();
Vector<JSScript*> scripts(cx); Vector<JSScript*> scripts(cx);
@ -3756,7 +3756,7 @@ void Debugger::trace(JSTracer* trc) {
} }
/* static */ /* static */
void DebugAPI::sweepAll(FreeOp* fop) { void DebugAPI::sweepAll(JSFreeOp* fop) {
JSRuntime* rt = fop->runtime(); JSRuntime* rt = fop->runtime();
Debugger* dbg = rt->debuggerList().getFirst(); Debugger* dbg = rt->debuggerList().getFirst();
@ -3785,7 +3785,8 @@ void DebugAPI::sweepAll(FreeOp* fop) {
} }
/* static */ /* static */
void Debugger::detachAllDebuggersFromGlobal(FreeOp* fop, GlobalObject* global) { void Debugger::detachAllDebuggersFromGlobal(JSFreeOp* fop,
GlobalObject* global) {
const GlobalObject::DebuggerVector* debuggers = global->getDebuggers(); const GlobalObject::DebuggerVector* debuggers = global->getDebuggers();
MOZ_ASSERT(!debuggers->empty()); MOZ_ASSERT(!debuggers->empty());
while (!debuggers->empty()) { while (!debuggers->empty()) {
@ -4693,7 +4694,7 @@ static WeakHeapPtr<Debugger*>* findDebuggerInVector(
return p; return p;
} }
void Debugger::removeDebuggeeGlobal(FreeOp* fop, GlobalObject* global, void Debugger::removeDebuggeeGlobal(JSFreeOp* fop, GlobalObject* global,
WeakGlobalObjectSet::Enum* debugEnum, WeakGlobalObjectSet::Enum* debugEnum,
FromSweep fromSweep) { FromSweep fromSweep) {
// The caller might have found global by enumerating this->debuggees; if // 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 // 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 // Debugger's frame map, so it will not be cleaned up by neither
// lambda. Manually clean it up here. // lambda. Manually clean it up here.
FreeOp* fop = cx->runtime()->defaultFreeOp(); JSFreeOp* fop = cx->runtime()->defaultFreeOp();
frameobj->freeFrameIterData(fop); frameobj->freeFrameIterData(fop);
frameobj->maybeDecrementFrameScriptStepperCount(fop, to); frameobj->maybeDecrementFrameScriptStepperCount(fop, to);
@ -6381,7 +6382,7 @@ void Debugger::removeFromFrameMapsAndClearBreakpointsIn(JSContext* cx,
AbstractFramePtr frame, AbstractFramePtr frame,
bool suspending) { bool suspending) {
forEachDebuggerFrame(frame, [&](DebuggerFrame* frameobj) { forEachDebuggerFrame(frame, [&](DebuggerFrame* frameobj) {
FreeOp* fop = cx->runtime()->defaultFreeOp(); JSFreeOp* fop = cx->runtime()->defaultFreeOp();
frameobj->freeFrameIterData(fop); frameobj->freeFrameIterData(fop);
Debugger* dbg = Debugger::fromChildJSObject(frameobj); Debugger* dbg = Debugger::fromChildJSObject(frameobj);

Просмотреть файл

@ -734,7 +734,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
enum class FromSweep { No, Yes }; enum class FromSweep { No, Yes };
MOZ_MUST_USE bool addDebuggeeGlobal(JSContext* cx, Handle<GlobalObject*> obj); 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, WeakGlobalObjectSet::Enum* debugEnum,
FromSweep fromSweep); FromSweep fromSweep);
@ -1059,7 +1059,7 @@ class Debugger : private mozilla::LinkedListElement<Debugger> {
WeakGlobalObjectSet::Range allDebuggees() const { return debuggees.all(); } WeakGlobalObjectSet::Range allDebuggees() const { return debuggees.all(); }
static void detachAllDebuggersFromGlobal(FreeOp* fop, GlobalObject* global); static void detachAllDebuggersFromGlobal(JSFreeOp* fop, GlobalObject* global);
#ifdef DEBUG #ifdef DEBUG
static bool isDebuggerCrossCompartmentEdge(JSObject* obj, static bool isDebuggerCrossCompartmentEdge(JSObject* obj,
const js::gc::Cell* cell); const js::gc::Cell* cell);
@ -1237,7 +1237,7 @@ struct Handler {
virtual void hold(JSObject* owner) = 0; virtual void hold(JSObject* owner) = 0;
/* Report that this Handler is no longer held by owner. See comment above. */ /* 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 * Trace the reference to the handler. This method will be called by the
@ -1281,7 +1281,7 @@ class BreakpointSite {
size_t allocSize(); size_t allocSize();
protected: protected:
virtual void recompile(FreeOp* fop) = 0; virtual void recompile(JSFreeOp* fop) = 0;
bool isEnabled() const { return enabledCount > 0; } bool isEnabled() const { return enabledCount > 0; }
public: public:
@ -1291,10 +1291,10 @@ class BreakpointSite {
bool hasBreakpoint(Breakpoint* bp); bool hasBreakpoint(Breakpoint* bp);
Type type() const { return type_; } Type type() const { return type_; }
void inc(FreeOp* fop); void inc(JSFreeOp* fop);
void dec(FreeOp* fop); void dec(JSFreeOp* fop);
bool isEmpty() const; bool isEmpty() const;
virtual void destroyIfEmpty(FreeOp* fop) = 0; virtual void destroyIfEmpty(JSFreeOp* fop) = 0;
inline JSBreakpointSite* asJS(); inline JSBreakpointSite* asJS();
inline WasmBreakpointSite* asWasm(); inline WasmBreakpointSite* asWasm();
@ -1344,7 +1344,7 @@ class Breakpoint {
Breakpoint(Debugger* debugger, BreakpointSite* site, JSObject* handler); Breakpoint(Debugger* debugger, BreakpointSite* site, JSObject* handler);
enum MayDestroySite { False, True }; enum MayDestroySite { False, True };
void destroy(FreeOp* fop, void destroy(JSFreeOp* fop,
MayDestroySite mayDestroySite = MayDestroySite::True); MayDestroySite mayDestroySite = MayDestroySite::True);
Breakpoint* nextInDebugger(); Breakpoint* nextInDebugger();
@ -1361,12 +1361,12 @@ class JSBreakpointSite : public BreakpointSite {
jsbytecode* const pc; jsbytecode* const pc;
protected: protected:
void recompile(FreeOp* fop) override; void recompile(JSFreeOp* fop) override;
public: public:
JSBreakpointSite(JSScript* script, jsbytecode* pc); JSBreakpointSite(JSScript* script, jsbytecode* pc);
void destroyIfEmpty(FreeOp* fop) override; void destroyIfEmpty(JSFreeOp* fop) override;
}; };
inline JSBreakpointSite* BreakpointSite::asJS() { inline JSBreakpointSite* BreakpointSite::asJS() {
@ -1380,12 +1380,12 @@ class WasmBreakpointSite : public BreakpointSite {
uint32_t offset; uint32_t offset;
private: private:
void recompile(FreeOp* fop) override; void recompile(JSFreeOp* fop) override;
public: public:
WasmBreakpointSite(wasm::Instance* instance, uint32_t offset); WasmBreakpointSite(wasm::Instance* instance, uint32_t offset);
void destroyIfEmpty(FreeOp* fop) override; void destroyIfEmpty(JSFreeOp* fop) override;
}; };
inline WasmBreakpointSite* BreakpointSite::asWasm() { inline WasmBreakpointSite* BreakpointSite::asWasm() {

Просмотреть файл

@ -105,7 +105,7 @@ void ScriptedOnStepHandler::hold(JSObject* owner) {
AddCellMemory(owner, allocSize(), MemoryUse::DebuggerOnStepHandler); 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); fop->delete_(owner, this, allocSize(), MemoryUse::DebuggerOnStepHandler);
} }
@ -137,7 +137,7 @@ void ScriptedOnPopHandler::hold(JSObject* owner) {
AddCellMemory(owner, allocSize(), MemoryUse::DebuggerOnPopHandler); 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); fop->delete_(owner, this, allocSize(), MemoryUse::DebuggerOnPopHandler);
} }
@ -368,7 +368,7 @@ bool DebuggerFrame::setGenerator(JSContext* cx,
return true; return true;
} }
void DebuggerFrame::clearGenerator(FreeOp* fop) { void DebuggerFrame::clearGenerator(JSFreeOp* fop) {
if (!hasGenerator()) { if (!hasGenerator()) {
return; return;
} }
@ -400,7 +400,7 @@ void DebuggerFrame::clearGenerator(FreeOp* fop) {
} }
void DebuggerFrame::clearGenerator( void DebuggerFrame::clearGenerator(
FreeOp* fop, Debugger* owner, JSFreeOp* fop, Debugger* owner,
Debugger::GeneratorWeakMap::Enum* maybeGeneratorFramesEnum) { Debugger::GeneratorWeakMap::Enum* maybeGeneratorFramesEnum) {
if (!hasGenerator()) { if (!hasGenerator()) {
return; return;
@ -675,7 +675,7 @@ bool DebuggerFrame::setOnStepHandler(JSContext* cx, HandleDebuggerFrame frame,
return true; return true;
} }
FreeOp* fop = cx->defaultFreeOp(); JSFreeOp* fop = cx->defaultFreeOp();
AbstractFramePtr referent = DebuggerFrame::getReferent(frame); AbstractFramePtr referent = DebuggerFrame::getReferent(frame);
// Adjust execution observability and step counts on whatever code (JS or // 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) { } else if (!handler && prior) {
// Single stepping toggled on->off. // Single stepping toggled on->off.
FreeOp* fop = cx->runtime()->defaultFreeOp(); JSFreeOp* fop = cx->runtime()->defaultFreeOp();
if (!instance->debug().decrementStepperCount(fop, if (!instance->debug().decrementStepperCount(fop,
wasmFrame->funcIndex())) { wasmFrame->funcIndex())) {
return false; return false;
@ -970,7 +970,7 @@ void DebuggerFrame::setOnPopHandler(JSContext* cx, OnPopHandler* handler) {
return; return;
} }
FreeOp* fop = cx->defaultFreeOp(); JSFreeOp* fop = cx->defaultFreeOp();
if (prior) { if (prior) {
prior->drop(fop, this); prior->drop(fop, this);
@ -1030,7 +1030,7 @@ void DebuggerFrame::setFrameIterData(FrameIter::Data* data) {
InitObjectPrivate(this, data, MemoryUse::DebuggerFrameIterData); InitObjectPrivate(this, data, MemoryUse::DebuggerFrameIterData);
} }
void DebuggerFrame::freeFrameIterData(FreeOp* fop) { void DebuggerFrame::freeFrameIterData(JSFreeOp* fop) {
if (FrameIter::Data* data = frameIterData()) { if (FrameIter::Data* data = frameIterData()) {
fop->delete_(this, data, MemoryUse::DebuggerFrameIterData); fop->delete_(this, data, MemoryUse::DebuggerFrameIterData);
setPrivate(nullptr); setPrivate(nullptr);
@ -1038,7 +1038,7 @@ void DebuggerFrame::freeFrameIterData(FreeOp* fop) {
} }
void DebuggerFrame::maybeDecrementFrameScriptStepperCount( void DebuggerFrame::maybeDecrementFrameScriptStepperCount(
FreeOp* fop, AbstractFramePtr frame) { JSFreeOp* fop, AbstractFramePtr frame) {
// If this frame has an onStep handler, decrement the script's count. // If this frame has an onStep handler, decrement the script's count.
OnStepHandler* handler = onStepHandler(); OnStepHandler* handler = onStepHandler();
if (!handler) { if (!handler) {
@ -1060,7 +1060,7 @@ void DebuggerFrame::maybeDecrementFrameScriptStepperCount(
} }
/* static */ /* static */
void DebuggerFrame::finalize(FreeOp* fop, JSObject* obj) { void DebuggerFrame::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
DebuggerFrame& frameobj = obj->as<DebuggerFrame>(); DebuggerFrame& frameobj = obj->as<DebuggerFrame>();
frameobj.freeFrameIterData(fop); frameobj.freeFrameIterData(fop);

Просмотреть файл

@ -51,7 +51,7 @@ class ScriptedOnStepHandler final : public OnStepHandler {
explicit ScriptedOnStepHandler(JSObject* object); explicit ScriptedOnStepHandler(JSObject* object);
virtual JSObject* object() const override; virtual JSObject* object() const override;
virtual void hold(JSObject* owner) 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 void trace(JSTracer* tracer) override;
virtual size_t allocSize() const override; virtual size_t allocSize() const override;
virtual bool onStep(JSContext* cx, HandleDebuggerFrame frame, virtual bool onStep(JSContext* cx, HandleDebuggerFrame frame,
@ -84,7 +84,7 @@ class ScriptedOnPopHandler final : public OnPopHandler {
explicit ScriptedOnPopHandler(JSObject* object); explicit ScriptedOnPopHandler(JSObject* object);
virtual JSObject* object() const override; virtual JSObject* object() const override;
virtual void hold(JSObject* owner) 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 void trace(JSTracer* tracer) override;
virtual size_t allocSize() const override; virtual size_t allocSize() const override;
virtual bool onPop(JSContext* cx, HandleDebuggerFrame frame, virtual bool onPop(JSContext* cx, HandleDebuggerFrame frame,
@ -237,9 +237,9 @@ class DebuggerFrame : public NativeObject {
* function will not otherwise disturb generatorFrames. Passing the enum * function will not otherwise disturb generatorFrames. Passing the enum
* allows this function to be used while iterating over generatorFrames. * allows this function to be used while iterating over generatorFrames.
*/ */
void clearGenerator(FreeOp* fop); void clearGenerator(JSFreeOp* fop);
void clearGenerator( void clearGenerator(
FreeOp* fop, Debugger* owner, JSFreeOp* fop, Debugger* owner,
Debugger::GeneratorWeakMap::Enum* maybeGeneratorFramesEnum = nullptr); Debugger::GeneratorWeakMap::Enum* maybeGeneratorFramesEnum = nullptr);
/* /*
@ -256,7 +256,7 @@ class DebuggerFrame : public NativeObject {
static const JSPropertySpec properties_[]; static const JSPropertySpec properties_[];
static const JSFunctionSpec methods_[]; static const JSFunctionSpec methods_[];
static void finalize(FreeOp* fop, JSObject* obj); static void finalize(JSFreeOp* fop, JSObject* obj);
static AbstractFramePtr getReferent(HandleDebuggerFrame frame); static AbstractFramePtr getReferent(HandleDebuggerFrame frame);
static MOZ_MUST_USE bool getFrameIter(JSContext* cx, static MOZ_MUST_USE bool getFrameIter(JSContext* cx,
@ -301,8 +301,8 @@ class DebuggerFrame : public NativeObject {
public: public:
FrameIter::Data* frameIterData() const; FrameIter::Data* frameIterData() const;
void setFrameIterData(FrameIter::Data*); void setFrameIterData(FrameIter::Data*);
void freeFrameIterData(FreeOp* fop); void freeFrameIterData(JSFreeOp* fop);
void maybeDecrementFrameScriptStepperCount(FreeOp* fop, void maybeDecrementFrameScriptStepperCount(JSFreeOp* fop,
AbstractFramePtr frame); AbstractFramePtr frame);
class GeneratorInfo; class GeneratorInfo;

Просмотреть файл

@ -337,15 +337,15 @@ class ArenaLists {
bool relocateArenas(Arena*& relocatedListOut, JS::GCReason reason, bool relocateArenas(Arena*& relocatedListOut, JS::GCReason reason,
js::SliceBudget& sliceBudget, gcstats::Statistics& stats); js::SliceBudget& sliceBudget, gcstats::Statistics& stats);
void queueForegroundObjectsForSweep(FreeOp* fop); void queueForegroundObjectsForSweep(JSFreeOp* fop);
void queueForegroundThingsForSweep(); void queueForegroundThingsForSweep();
void releaseForegroundSweptEmptyArenas(); void releaseForegroundSweptEmptyArenas();
bool foregroundFinalize(FreeOp* fop, AllocKind thingKind, bool foregroundFinalize(JSFreeOp* fop, AllocKind thingKind,
js::SliceBudget& sliceBudget, js::SliceBudget& sliceBudget,
SortedArenaList& sweepList); SortedArenaList& sweepList);
static void backgroundFinalize(FreeOp* fop, Arena* listHead, Arena** empty); static void backgroundFinalize(JSFreeOp* fop, Arena* listHead, Arena** empty);
void setParallelAllocEnabled(bool enabled); void setParallelAllocEnabled(bool enabled);
@ -353,8 +353,10 @@ class ArenaLists {
inline JSRuntime* runtime(); inline JSRuntime* runtime();
inline JSRuntime* runtimeFromAnyThread(); inline JSRuntime* runtimeFromAnyThread();
inline void queueForForegroundSweep(FreeOp* fop, const FinalizePhase& phase); inline void queueForForegroundSweep(JSFreeOp* fop,
inline void queueForBackgroundSweep(FreeOp* fop, const FinalizePhase& phase); const FinalizePhase& phase);
inline void queueForBackgroundSweep(JSFreeOp* fop,
const FinalizePhase& phase);
inline void queueForForegroundSweep(AllocKind thingKind); inline void queueForForegroundSweep(AllocKind thingKind);
inline void queueForBackgroundSweep(AllocKind thingKind); inline void queueForBackgroundSweep(AllocKind thingKind);

Просмотреть файл

@ -25,11 +25,11 @@ class AutoSetThreadIsPerformingGC;
} // namespace js } // 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. * convenience methods that also call destructors.
* *
* FreeOp is passed to finalizers and other sweep-phase hooks so that we do not * JSFreeOp is passed to finalizers and other sweep-phase hooks so that we do
* need to pass a JSContext to those hooks. * not need to pass a JSContext to those hooks.
*/ */
class JSFreeOp { class JSFreeOp {
using Cell = js::gc::Cell; using Cell = js::gc::Cell;
@ -86,7 +86,7 @@ class JSFreeOp {
void freeUntrackedLater(void* p) { queueForFreeLater(p); } void freeUntrackedLater(void* p) { queueForFreeLater(p); }
// Queue memory that was associated with a GC thing using js::AddCellMemory to // 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 // This should not be called on the default FreeOps returned by
// JSRuntime/JSContext::defaultFreeOp() since these are not destroyed until // JSRuntime/JSContext::defaultFreeOp() since these are not destroyed until

Просмотреть файл

@ -554,7 +554,7 @@ void Arena::staticAsserts() {
} }
template <typename T> template <typename T>
inline size_t Arena::finalize(FreeOp* fop, AllocKind thingKind, inline size_t Arena::finalize(JSFreeOp* fop, AllocKind thingKind,
size_t thingSize) { size_t thingSize) {
/* Enforce requirements on size of T. */ /* Enforce requirements on size of T. */
MOZ_ASSERT(thingSize % CellAlignBytes == 0); 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 // specified and inserting the others into the appropriate destination size
// bins. // bins.
template <typename T> template <typename T>
static inline bool FinalizeTypedArenas(FreeOp* fop, Arena** src, static inline bool FinalizeTypedArenas(JSFreeOp* fop, Arena** src,
SortedArenaList& dest, SortedArenaList& dest,
AllocKind thingKind, AllocKind thingKind,
SliceBudget& budget) { SliceBudget& budget) {
@ -665,7 +665,7 @@ static inline bool FinalizeTypedArenas(FreeOp* fop, Arena** src,
/* /*
* Finalize the list of areans. * 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) { AllocKind thingKind, SliceBudget& budget) {
switch (thingKind) { switch (thingKind) {
#define EXPAND_CASE(allocKind, traceKind, type, sizedType, bgFinal, nursery, \ #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 { JSFinalizeStatus status) const {
for (auto& p : finalizeCallbacks.ref()) { for (auto& p : finalizeCallbacks.ref()) {
p.op(fop, status, p.data); p.op(fop, status, p.data);
@ -2574,7 +2574,7 @@ bool MovingTracer::onRegExpSharedEdge(RegExpShared** sharedp) {
bool MovingTracer::onBigIntEdge(BigInt** bip) { return updateEdge(bip); } bool MovingTracer::onBigIntEdge(BigInt** bip) { return updateEdge(bip); }
void Zone::prepareForCompacting() { void Zone::prepareForCompacting() {
FreeOp* fop = runtimeFromMainThread()->defaultFreeOp(); JSFreeOp* fop = runtimeFromMainThread()->defaultFreeOp();
discardJitCode(fop); discardJitCode(fop);
} }
@ -2597,7 +2597,7 @@ void GCRuntime::sweepTypesAfterCompacting(Zone* zone) {
void GCRuntime::sweepZoneAfterCompacting(Zone* zone) { void GCRuntime::sweepZoneAfterCompacting(Zone* zone) {
MOZ_ASSERT(zone->isCollecting()); MOZ_ASSERT(zone->isCollecting());
FreeOp* fop = rt->defaultFreeOp(); JSFreeOp* fop = rt->defaultFreeOp();
sweepTypesAfterCompacting(zone); sweepTypesAfterCompacting(zone);
zone->sweepBreakpoints(fop); zone->sweepBreakpoints(fop);
zone->sweepWeakMaps(); zone->sweepWeakMaps();
@ -3167,7 +3167,7 @@ ArenaLists::~ArenaLists() {
ReleaseArenaList(runtime(), savedEmptyArenas, lock); ReleaseArenaList(runtime(), savedEmptyArenas, lock);
} }
void ArenaLists::queueForForegroundSweep(FreeOp* fop, void ArenaLists::queueForForegroundSweep(JSFreeOp* fop,
const FinalizePhase& phase) { const FinalizePhase& phase) {
gcstats::AutoPhase ap(fop->runtime()->gc.stats(), phase.statsPhase); gcstats::AutoPhase ap(fop->runtime()->gc.stats(), phase.statsPhase);
for (auto kind : phase.kinds) { for (auto kind : phase.kinds) {
@ -3184,7 +3184,7 @@ void ArenaLists::queueForForegroundSweep(AllocKind thingKind) {
arenaLists(thingKind).clear(); arenaLists(thingKind).clear();
} }
void ArenaLists::queueForBackgroundSweep(FreeOp* fop, void ArenaLists::queueForBackgroundSweep(JSFreeOp* fop,
const FinalizePhase& phase) { const FinalizePhase& phase) {
gcstats::AutoPhase ap(fop->runtime()->gc.stats(), phase.statsPhase); gcstats::AutoPhase ap(fop->runtime()->gc.stats(), phase.statsPhase);
for (auto kind : phase.kinds) { for (auto kind : phase.kinds) {
@ -3209,7 +3209,7 @@ inline void ArenaLists::queueForBackgroundSweep(AllocKind thingKind) {
} }
/*static*/ /*static*/
void ArenaLists::backgroundFinalize(FreeOp* fop, Arena* listHead, void ArenaLists::backgroundFinalize(JSFreeOp* fop, Arena* listHead,
Arena** empty) { Arena** empty) {
MOZ_ASSERT(listHead); MOZ_ASSERT(listHead);
MOZ_ASSERT(empty); MOZ_ASSERT(empty);
@ -3693,7 +3693,7 @@ void GCRuntime::sweepBackgroundThings(ZoneList& zones, LifoAlloc& freeBlocks) {
return; return;
} }
FreeOp fop(nullptr); JSFreeOp fop(nullptr);
// Sweep zones in order. The atoms zone must be finalized last as other // Sweep zones in order. The atoms zone must be finalized last as other
// zones may have direct pointers into it. // zones may have direct pointers into it.
@ -3869,7 +3869,7 @@ void GCRuntime::freeFromBackgroundThread(AutoLockHelperThreadState& lock) {
lifoBlocks.freeAll(); lifoBlocks.freeAll();
FreeOp* fop = TlsContext.get()->defaultFreeOp(); JSFreeOp* fop = TlsContext.get()->defaultFreeOp();
for (Nursery::BufferSet::Range r = buffers.all(); !r.empty(); for (Nursery::BufferSet::Range r = buffers.all(); !r.empty();
r.popFront()) { r.popFront()) {
// Malloc memory associated with nursery objects is not tracked as these // 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 JS::Zone::sweepUniqueIds() { uniqueIds().sweep(); }
void Realm::destroy(FreeOp* fop) { void Realm::destroy(JSFreeOp* fop) {
JSRuntime* rt = fop->runtime(); JSRuntime* rt = fop->runtime();
if (auto callback = rt->destroyRealmCallback) { if (auto callback = rt->destroyRealmCallback) {
callback(fop, this); callback(fop, this);
@ -3910,7 +3910,7 @@ void Realm::destroy(FreeOp* fop) {
fop->deleteUntracked(this); fop->deleteUntracked(this);
} }
void Compartment::destroy(FreeOp* fop) { void Compartment::destroy(JSFreeOp* fop) {
JSRuntime* rt = fop->runtime(); JSRuntime* rt = fop->runtime();
if (auto callback = rt->destroyCompartmentCallback) { if (auto callback = rt->destroyCompartmentCallback) {
callback(fop, this); callback(fop, this);
@ -3921,7 +3921,7 @@ void Compartment::destroy(FreeOp* fop) {
rt->gc.stats().sweptCompartment(); rt->gc.stats().sweptCompartment();
} }
void Zone::destroy(FreeOp* fop) { void Zone::destroy(JSFreeOp* fop) {
MOZ_ASSERT(compartments().empty()); MOZ_ASSERT(compartments().empty());
// Bug 1560019: Malloc memory associated with a zone but not with a specific // Bug 1560019: Malloc memory associated with a zone but not with a specific
// GC thing is not currently tracked. // GC thing is not currently tracked.
@ -3938,7 +3938,7 @@ void Zone::destroy(FreeOp* fop) {
* sweepCompartments from deleting every compartment. Instead, it preserves an * sweepCompartments from deleting every compartment. Instead, it preserves an
* arbitrary compartment in the zone. * arbitrary compartment in the zone.
*/ */
void Zone::sweepCompartments(FreeOp* fop, bool keepAtleastOne, void Zone::sweepCompartments(JSFreeOp* fop, bool keepAtleastOne,
bool destroyingRuntime) { bool destroyingRuntime) {
MOZ_ASSERT(!compartments().empty()); MOZ_ASSERT(!compartments().empty());
MOZ_ASSERT_IF(destroyingRuntime, !keepAtleastOne); MOZ_ASSERT_IF(destroyingRuntime, !keepAtleastOne);
@ -3968,7 +3968,7 @@ void Zone::sweepCompartments(FreeOp* fop, bool keepAtleastOne,
MOZ_ASSERT_IF(destroyingRuntime, compartments().empty()); MOZ_ASSERT_IF(destroyingRuntime, compartments().empty());
} }
void Compartment::sweepRealms(FreeOp* fop, bool keepAtleastOne, void Compartment::sweepRealms(JSFreeOp* fop, bool keepAtleastOne,
bool destroyingRuntime) { bool destroyingRuntime) {
MOZ_ASSERT(!realms().empty()); MOZ_ASSERT(!realms().empty());
MOZ_ASSERT_IF(destroyingRuntime, !keepAtleastOne); MOZ_ASSERT_IF(destroyingRuntime, !keepAtleastOne);
@ -4009,7 +4009,7 @@ void GCRuntime::deleteEmptyZone(Zone* zone) {
MOZ_CRASH("Zone not found"); 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, numActiveZoneIters == 0);
MOZ_ASSERT_IF(destroyingRuntime, arenasEmptyAtShutdown); MOZ_ASSERT_IF(destroyingRuntime, arenasEmptyAtShutdown);
@ -5474,7 +5474,7 @@ static inline void MaybeCheckWeakMapMarking(GCRuntime* gc) {
} }
IncrementalProgress GCRuntime::markGrayReferencesInCurrentGroup( IncrementalProgress GCRuntime::markGrayReferencesInCurrentGroup(
FreeOp* fop, SliceBudget& budget) { JSFreeOp* fop, SliceBudget& budget) {
MOZ_ASSERT(marker.markColor() == MarkColor::Black); MOZ_ASSERT(marker.markColor() == MarkColor::Black);
if (hasMarkedGrayRoots) { if (hasMarkedGrayRoots) {
@ -5517,7 +5517,7 @@ IncrementalProgress GCRuntime::markGrayReferencesInCurrentGroup(
return markUntilBudgetExhausted(budget, gcstats::PhaseKind::SWEEP_MARK_GRAY); return markUntilBudgetExhausted(budget, gcstats::PhaseKind::SWEEP_MARK_GRAY);
} }
IncrementalProgress GCRuntime::endMarkingSweepGroup(FreeOp* fop, IncrementalProgress GCRuntime::endMarkingSweepGroup(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
MOZ_ASSERT(marker.markColor() == MarkColor::Black); MOZ_ASSERT(marker.markColor() == MarkColor::Black);
MOZ_ASSERT(!HasIncomingCrossCompartmentPointers(rt)); MOZ_ASSERT(!HasIncomingCrossCompartmentPointers(rt));
@ -5678,7 +5678,7 @@ void GCRuntime::joinTask(GCParallelTask& task, gcstats::PhaseKind phase,
stats().recordParallelPhase(phase, task.duration()); stats().recordParallelPhase(phase, task.duration());
} }
void GCRuntime::sweepDebuggerOnMainThread(FreeOp* fop) { void GCRuntime::sweepDebuggerOnMainThread(JSFreeOp* fop) {
// Detach unreachable debuggers and global objects from each other. // Detach unreachable debuggers and global objects from each other.
// This can modify weakmaps and so must happen before weakmap sweeping. // This can modify weakmaps and so must happen before weakmap sweeping.
DebugAPI::sweepAll(fop); 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); 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) { SliceBudget& budget) {
/* /*
* Begin sweeping the group of zones in currentSweepGroup, performing * Begin sweeping the group of zones in currentSweepGroup, performing
@ -5960,11 +5960,11 @@ bool GCRuntime::shouldYieldForZeal(ZealMode mode) {
} }
#endif #endif
IncrementalProgress GCRuntime::endSweepingSweepGroup(FreeOp* fop, IncrementalProgress GCRuntime::endSweepingSweepGroup(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
{ {
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::FINALIZE_END); gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::FINALIZE_END);
FreeOp fop(rt); JSFreeOp fop(rt);
callFinalizeCallbacks(&fop, JSFINALIZE_GROUP_END); callFinalizeCallbacks(&fop, JSFINALIZE_GROUP_END);
} }
@ -6030,7 +6030,7 @@ void GCRuntime::beginSweepPhase(JS::GCReason reason, AutoGCSession& session) {
sweepActions->assertFinished(); sweepActions->assertFinished();
} }
bool ArenaLists::foregroundFinalize(FreeOp* fop, AllocKind thingKind, bool ArenaLists::foregroundFinalize(JSFreeOp* fop, AllocKind thingKind,
SliceBudget& sliceBudget, SliceBudget& sliceBudget,
SortedArenaList& sweepList) { SortedArenaList& sweepList) {
if (!arenaListsToSweep(thingKind) && incrementalSweptArenas.ref().isEmpty()) { if (!arenaListsToSweep(thingKind) && incrementalSweptArenas.ref().isEmpty()) {
@ -6081,22 +6081,22 @@ void GCRuntime::drainMarkStack() {
MOZ_RELEASE_ASSERT(marker.markUntilBudgetExhausted(unlimited)); MOZ_RELEASE_ASSERT(marker.markUntilBudgetExhausted(unlimited));
} }
static void SweepThing(FreeOp* fop, Shape* shape) { static void SweepThing(JSFreeOp* fop, Shape* shape) {
if (!shape->isMarkedAny()) { if (!shape->isMarkedAny()) {
shape->sweep(fop); shape->sweep(fop);
} }
} }
static void SweepThing(FreeOp* fop, JSScript* script) { static void SweepThing(JSFreeOp* fop, JSScript* script) {
AutoSweepJitScript sweep(script); AutoSweepJitScript sweep(script);
} }
static void SweepThing(FreeOp* fop, ObjectGroup* group) { static void SweepThing(JSFreeOp* fop, ObjectGroup* group) {
AutoSweepObjectGroup sweep(group); AutoSweepObjectGroup sweep(group);
} }
template <typename T> template <typename T>
static bool SweepArenaList(FreeOp* fop, Arena** arenasToSweep, static bool SweepArenaList(JSFreeOp* fop, Arena** arenasToSweep,
SliceBudget& sliceBudget) { SliceBudget& sliceBudget) {
while (Arena* arena = *arenasToSweep) { while (Arena* arena = *arenasToSweep) {
for (ArenaCellIterUnderGC i(arena); !i.done(); i.next()) { for (ArenaCellIterUnderGC i(arena); !i.done(); i.next()) {
@ -6114,7 +6114,7 @@ static bool SweepArenaList(FreeOp* fop, Arena** arenasToSweep,
return true; return true;
} }
IncrementalProgress GCRuntime::sweepTypeInformation(FreeOp* fop, IncrementalProgress GCRuntime::sweepTypeInformation(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
// Sweep dead type information stored in scripts and object groups, but // 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 // 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; return Finished;
} }
IncrementalProgress GCRuntime::releaseSweptEmptyArenas(FreeOp* fop, IncrementalProgress GCRuntime::releaseSweptEmptyArenas(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
// Foreground finalized GC things have already been finalized, and now their // Foreground finalized GC things have already been finalized, and now their
// arenas can be reclaimed by freeing empty ones and making non-empty ones // arenas can be reclaimed by freeing empty ones and making non-empty ones
@ -6183,7 +6183,7 @@ void GCRuntime::startSweepingAtomsTable() {
maybeAtoms.emplace(*atomsTable); maybeAtoms.emplace(*atomsTable);
} }
IncrementalProgress GCRuntime::sweepAtomsTable(FreeOp* fop, IncrementalProgress GCRuntime::sweepAtomsTable(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
if (!atomsZone->isGCSweeping()) { if (!atomsZone->isGCSweeping()) {
return Finished; return Finished;
@ -6313,7 +6313,7 @@ static size_t WeakCacheSweepTaskCount() {
return Min(targetTaskCount, MaxWeakCacheSweepTasks); return Min(targetTaskCount, MaxWeakCacheSweepTasks);
} }
IncrementalProgress GCRuntime::sweepWeakCaches(FreeOp* fop, IncrementalProgress GCRuntime::sweepWeakCaches(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
WeakCacheSweepIterator work(this); WeakCacheSweepIterator work(this);
@ -6334,7 +6334,7 @@ IncrementalProgress GCRuntime::sweepWeakCaches(FreeOp* fop,
return work.empty(lock) ? Finished : NotFinished; return work.empty(lock) ? Finished : NotFinished;
} }
IncrementalProgress GCRuntime::finalizeAllocKind(FreeOp* fop, IncrementalProgress GCRuntime::finalizeAllocKind(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
// Set the number of things per arena for this AllocKind. // Set the number of things per arena for this AllocKind.
size_t thingsPerArena = Arena::thingsPerArena(sweepAllocKind); size_t thingsPerArena = Arena::thingsPerArena(sweepAllocKind);
@ -6352,7 +6352,7 @@ IncrementalProgress GCRuntime::finalizeAllocKind(FreeOp* fop,
return Finished; return Finished;
} }
IncrementalProgress GCRuntime::sweepShapeTree(FreeOp* fop, IncrementalProgress GCRuntime::sweepShapeTree(JSFreeOp* fop,
SliceBudget& budget) { SliceBudget& budget) {
// Remove dead shapes from the shape tree, but don't finalize them yet. // 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. // Implementation of the SweepAction interface that calls a method on GCRuntime.
class SweepActionCall final : public SweepAction { class SweepActionCall final : public SweepAction {
using Method = IncrementalProgress (GCRuntime::*)(FreeOp* fop, using Method = IncrementalProgress (GCRuntime::*)(JSFreeOp* fop,
SliceBudget& budget); SliceBudget& budget);
Method method; Method method;
@ -6589,7 +6589,7 @@ class SweepActionForEach final : public SweepAction {
}; };
static UniquePtr<SweepAction> Call(IncrementalProgress (GCRuntime::*method)( static UniquePtr<SweepAction> Call(IncrementalProgress (GCRuntime::*method)(
FreeOp* fop, SliceBudget& budget)) { JSFreeOp* fop, SliceBudget& budget)) {
return MakeUnique<SweepActionCall>(method); return MakeUnique<SweepActionCall>(method);
} }
@ -6685,7 +6685,7 @@ IncrementalProgress GCRuntime::performSweepActions(SliceBudget& budget) {
AutoSetThreadIsSweeping threadIsSweeping; AutoSetThreadIsSweeping threadIsSweeping;
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP); 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 // 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. // yield to the mutator until we've starting sweeping a sweep group.
@ -6732,7 +6732,7 @@ void GCRuntime::endSweepPhase(bool destroyingRuntime) {
AutoSetThreadIsSweeping threadIsSweeping; AutoSetThreadIsSweeping threadIsSweeping;
gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP); gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP);
FreeOp fop(rt); JSFreeOp fop(rt);
MOZ_ASSERT_IF(destroyingRuntime, !sweepOnBackgroundThread); MOZ_ASSERT_IF(destroyingRuntime, !sweepOnBackgroundThread);
@ -7258,7 +7258,7 @@ void GCRuntime::incrementalSlice(SliceBudget& budget,
gcstats::AutoPhase ap1(stats(), gcstats::PhaseKind::SWEEP); gcstats::AutoPhase ap1(stats(), gcstats::PhaseKind::SWEEP);
gcstats::AutoPhase ap2(stats(), gcstats::PhaseKind::DESTROY); gcstats::AutoPhase ap2(stats(), gcstats::PhaseKind::DESTROY);
AutoSetThreadIsSweeping threadIsSweeping; AutoSetThreadIsSweeping threadIsSweeping;
FreeOp fop(rt); JSFreeOp fop(rt);
sweepZones(&fop, destroyingRuntime); sweepZones(&fop, destroyingRuntime);
} }
@ -8432,7 +8432,7 @@ void PreventGCDuringInteractiveDebug() { TlsContext.get()->suppressGC++; }
#endif #endif
void js::ReleaseAllJITCode(FreeOp* fop) { void js::ReleaseAllJITCode(JSFreeOp* fop) {
js::CancelOffThreadIonCompile(fop->runtime()); js::CancelOffThreadIonCompile(fop->runtime());
for (ZonesIter zone(fop->runtime(), SkipAtoms); !zone.done(); zone.next()) { 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 TraceRuntime(JSTracer* trc);
extern void ReleaseAllJITCode(FreeOp* op); extern void ReleaseAllJITCode(JSFreeOp* op);
extern void PrepareForDebugGC(JSRuntime* rt); extern void PrepareForDebugGC(JSRuntime* rt);

Просмотреть файл

@ -55,7 +55,7 @@ struct SweepAction {
// The arguments passed to each action. // The arguments passed to each action.
struct Args { struct Args {
GCRuntime* gc; GCRuntime* gc;
FreeOp* fop; JSFreeOp* fop;
SliceBudget& budget; SliceBudget& budget;
}; };
@ -630,25 +630,27 @@ class GCRuntime {
void groupZonesForSweeping(JS::GCReason reason); void groupZonesForSweeping(JS::GCReason reason);
MOZ_MUST_USE bool findSweepGroupEdges(); MOZ_MUST_USE bool findSweepGroupEdges();
void getNextSweepGroup(); void getNextSweepGroup();
IncrementalProgress markGrayReferencesInCurrentGroup(FreeOp* fop, IncrementalProgress markGrayReferencesInCurrentGroup(JSFreeOp* fop,
SliceBudget& budget); SliceBudget& budget);
IncrementalProgress endMarkingSweepGroup(FreeOp* fop, SliceBudget& budget); IncrementalProgress endMarkingSweepGroup(JSFreeOp* fop, SliceBudget& budget);
void markIncomingCrossCompartmentPointers(MarkColor color); void markIncomingCrossCompartmentPointers(MarkColor color);
IncrementalProgress beginSweepingSweepGroup(FreeOp* fop, SliceBudget& budget); IncrementalProgress beginSweepingSweepGroup(JSFreeOp* fop,
void sweepDebuggerOnMainThread(FreeOp* fop); SliceBudget& budget);
void sweepJitDataOnMainThread(FreeOp* fop); void sweepDebuggerOnMainThread(JSFreeOp* fop);
IncrementalProgress endSweepingSweepGroup(FreeOp* fop, SliceBudget& budget); void sweepJitDataOnMainThread(JSFreeOp* fop);
IncrementalProgress endSweepingSweepGroup(JSFreeOp* fop, SliceBudget& budget);
IncrementalProgress performSweepActions(SliceBudget& sliceBudget); IncrementalProgress performSweepActions(SliceBudget& sliceBudget);
IncrementalProgress sweepTypeInformation(FreeOp* fop, SliceBudget& budget); IncrementalProgress sweepTypeInformation(JSFreeOp* fop, SliceBudget& budget);
IncrementalProgress releaseSweptEmptyArenas(FreeOp* fop, SliceBudget& budget); IncrementalProgress releaseSweptEmptyArenas(JSFreeOp* fop,
SliceBudget& budget);
void startSweepingAtomsTable(); void startSweepingAtomsTable();
IncrementalProgress sweepAtomsTable(FreeOp* fop, SliceBudget& budget); IncrementalProgress sweepAtomsTable(JSFreeOp* fop, SliceBudget& budget);
IncrementalProgress sweepWeakCaches(FreeOp* fop, SliceBudget& budget); IncrementalProgress sweepWeakCaches(JSFreeOp* fop, SliceBudget& budget);
IncrementalProgress finalizeAllocKind(FreeOp* fop, SliceBudget& budget); IncrementalProgress finalizeAllocKind(JSFreeOp* fop, SliceBudget& budget);
IncrementalProgress sweepShapeTree(FreeOp* fop, SliceBudget& budget); IncrementalProgress sweepShapeTree(JSFreeOp* fop, SliceBudget& budget);
void endSweepPhase(bool lastGC); void endSweepPhase(bool lastGC);
bool allCCVisibleZonesWereCollected() const; bool allCCVisibleZonesWereCollected() const;
void sweepZones(FreeOp* fop, bool destroyingRuntime); void sweepZones(JSFreeOp* fop, bool destroyingRuntime);
void decommitFreeArenasWithoutUnlocking(const AutoLockGC& lock); void decommitFreeArenasWithoutUnlocking(const AutoLockGC& lock);
void startDecommit(); void startDecommit();
void queueZonesAndStartBackgroundSweep(ZoneList& zones); void queueZonesAndStartBackgroundSweep(ZoneList& zones);
@ -692,7 +694,7 @@ class GCRuntime {
void checkForCompartmentMismatches(); void checkForCompartmentMismatches();
#endif #endif
void callFinalizeCallbacks(FreeOp* fop, JSFinalizeStatus status) const; void callFinalizeCallbacks(JSFreeOp* fop, JSFinalizeStatus status) const;
void callWeakPointerZonesCallbacks() const; void callWeakPointerZonesCallbacks() const;
void callWeakPointerCompartmentCallbacks(JS::Compartment* comp) const; void callWeakPointerCompartmentCallbacks(JS::Compartment* comp) const;
void callDoCycleCollectionCallback(JSContext* cx); void callDoCycleCollectionCallback(JSContext* cx);

Просмотреть файл

@ -440,7 +440,7 @@ class Arena {
inline size_t& atomBitmapStart(); inline size_t& atomBitmapStart();
template <typename T> 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(); static void staticAsserts();

Просмотреть файл

@ -177,7 +177,7 @@ Zone::DebuggerVector* Zone::getOrCreateDebuggers(JSContext* cx) {
return debuggers; return debuggers;
} }
void Zone::sweepBreakpoints(FreeOp* fop) { void Zone::sweepBreakpoints(JSFreeOp* fop) {
if (fop->runtime()->debuggerList().isEmpty()) { if (fop->runtime()->debuggerList().isEmpty()) {
return; return;
} }
@ -343,7 +343,7 @@ void Zone::sweepWeakMaps() {
WeakMapBase::sweepZone(this); WeakMapBase::sweepZone(this);
} }
void Zone::discardJitCode(FreeOp* fop, void Zone::discardJitCode(JSFreeOp* fop,
ShouldDiscardBaselineCode discardBaselineCode, ShouldDiscardBaselineCode discardBaselineCode,
ShouldDiscardJitScripts discardJitScripts) { ShouldDiscardJitScripts discardJitScripts) {
if (!jitZone()) { if (!jitZone()) {
@ -540,7 +540,7 @@ void Zone::deleteEmptyCompartment(JS::Compartment* comp) {
MOZ_ASSERT(comp->realms().length() == 1); MOZ_ASSERT(comp->realms().length() == 1);
Realm* realm = comp->realms()[0]; Realm* realm = comp->realms()[0];
FreeOp* fop = runtimeFromMainThread()->defaultFreeOp(); JSFreeOp* fop = runtimeFromMainThread()->defaultFreeOp();
realm->destroy(fop); realm->destroy(fop);
comp->destroy(fop); comp->destroy(fop);

Просмотреть файл

@ -147,7 +147,7 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> {
explicit Zone(JSRuntime* rt); explicit Zone(JSRuntime* rt);
~Zone(); ~Zone();
MOZ_MUST_USE bool init(bool isSystem); MOZ_MUST_USE bool init(bool isSystem);
void destroy(js::FreeOp* fop); void destroy(JSFreeOp* fop);
static JS::Zone* from(ZoneAllocator* zoneAlloc) { static JS::Zone* from(ZoneAllocator* zoneAlloc) {
return static_cast<Zone*>(zoneAlloc); return static_cast<Zone*>(zoneAlloc);
@ -202,7 +202,7 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> {
}; };
void discardJitCode( void discardJitCode(
js::FreeOp* fop, JSFreeOp* fop,
ShouldDiscardBaselineCode discardBaselineCode = DiscardBaselineCode, ShouldDiscardBaselineCode discardBaselineCode = DiscardBaselineCode,
ShouldDiscardJitScripts discardJitScripts = KeepJitScripts); ShouldDiscardJitScripts discardJitScripts = KeepJitScripts);
@ -312,10 +312,10 @@ class Zone : public js::ZoneAllocator, public js::gc::GraphNodeBase<JS::Zone> {
#endif #endif
void sweepAfterMinorGC(JSTracer* trc); void sweepAfterMinorGC(JSTracer* trc);
void sweepBreakpoints(js::FreeOp* fop); void sweepBreakpoints(JSFreeOp* fop);
void sweepUniqueIds(); void sweepUniqueIds();
void sweepWeakMaps(); 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>; using DebuggerVector = js::Vector<js::Debugger*, 0, js::SystemAllocPolicy>;

Просмотреть файл

@ -511,7 +511,7 @@ void BaselineScript::Trace(JSTracer* trc, BaselineScript* script) {
script->trace(trc); script->trace(trc);
} }
void BaselineScript::Destroy(FreeOp* fop, BaselineScript* script) { void BaselineScript::Destroy(JSFreeOp* fop, BaselineScript* script) {
MOZ_ASSERT(!script->hasPendingIonBuilder()); MOZ_ASSERT(!script->hasPendingIonBuilder());
// This allocation is tracked by JSScript::setBaselineScript / // This allocation is tracked by JSScript::setBaselineScript /
@ -915,7 +915,7 @@ void BaselineInterpreter::toggleCodeCoverageInstrumentation(bool enable) {
toggleCodeCoverageInstrumentationUnchecked(enable); toggleCodeCoverageInstrumentationUnchecked(enable);
} }
void jit::FinishDiscardBaselineScript(FreeOp* fop, JSScript* script) { void jit::FinishDiscardBaselineScript(JSFreeOp* fop, JSScript* script) {
MOZ_ASSERT(script->hasBaselineScript()); MOZ_ASSERT(script->hasBaselineScript());
MOZ_ASSERT(!script->jitScript()->active()); MOZ_ASSERT(!script->jitScript()->active());

Просмотреть файл

@ -289,7 +289,7 @@ struct BaselineScript final {
size_t traceLoggerToggleOffsetEntries); size_t traceLoggerToggleOffsetEntries);
static void Trace(JSTracer* trc, BaselineScript* script); 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() { static inline size_t offsetOfMethod() {
return offsetof(BaselineScript, method_); return offsetof(BaselineScript, method_);
@ -423,7 +423,7 @@ bool CanBaselineInterpretScript(JSScript* script);
bool BaselineCompileFromBaselineInterpreter(JSContext* cx, BaselineFrame* frame, bool BaselineCompileFromBaselineInterpreter(JSContext* cx, BaselineFrame* frame,
uint8_t** res); uint8_t** res);
void FinishDiscardBaselineScript(FreeOp* fop, JSScript* script); void FinishDiscardBaselineScript(JSFreeOp* fop, JSScript* script);
void AddSizeOfBaselineData(JSScript* script, mozilla::MallocSizeOf mallocSizeOf, void AddSizeOfBaselineData(JSScript* script, mozilla::MallocSizeOf mallocSizeOf,
size_t* data); 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. // If this jitcode had a bytecode map, it must have already been removed.
#ifdef DEBUG #ifdef DEBUG
JSRuntime* rt = fop->runtime(); 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. // This allocation is tracked by JSScript::setIonScript / clearIonScript.
fop->deleteUntracked(script); fop->deleteUntracked(script);
} }
@ -2493,7 +2493,7 @@ MethodStatus jit::Recompile(JSContext* cx, HandleScript script,
return Method_Compiled; return Method_Compiled;
} }
static void InvalidateActivation(FreeOp* fop, static void InvalidateActivation(JSFreeOp* fop,
const JitActivationIterator& activations, const JitActivationIterator& activations,
bool invalidateAll) { bool invalidateAll) {
JitSpew(JitSpew_IonInvalidate, "BEGIN invalidating activation"); JitSpew(JitSpew_IonInvalidate, "BEGIN invalidating activation");
@ -2660,7 +2660,7 @@ static void InvalidateActivation(FreeOp* fop,
JitSpew(JitSpew_IonInvalidate, "END invalidating activation"); 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. // The caller should previously have cancelled off thread compilation.
#ifdef DEBUG #ifdef DEBUG
for (RealmsInZoneIter realm(zone); !realm.done(); realm.next()) { 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, const RecompileInfoVector& invalid, bool resetUses,
bool cancelOffThread) { bool cancelOffThread) {
JitSpew(JitSpew_IonInvalidate, "Start invalidation."); JitSpew(JitSpew_IonInvalidate, "Start invalidation.");
@ -2820,7 +2820,7 @@ void jit::Invalidate(JSContext* cx, JSScript* script, bool resetUses,
Invalidate(cx, scripts, resetUses, cancelOffThread); Invalidate(cx, scripts, resetUses, cancelOffThread);
} }
void jit::FinishInvalidation(FreeOp* fop, JSScript* script) { void jit::FinishInvalidation(JSFreeOp* fop, JSScript* script) {
if (!script->hasIonScript()) { if (!script->hasIonScript()) {
return; return;
} }
@ -3014,7 +3014,7 @@ size_t jit::SizeOfIonData(JSScript* script,
return result; return result;
} }
void jit::DestroyJitScripts(FreeOp* fop, JSScript* script) { void jit::DestroyJitScripts(JSFreeOp* fop, JSScript* script) {
if (script->hasIonScript()) { if (script->hasIonScript()) {
IonScript* ion = script->ionScript(); IonScript* ion = script->ionScript();
script->clearIonScript(fop); script->clearIonScript(fop);

Просмотреть файл

@ -169,7 +169,7 @@ static inline bool IsErrorStatus(JitExecStatus status) {
struct EnterJitData; struct EnterJitData;
// Walk the stack and invalidate active Ion frames for the invalid scripts. // 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, const RecompileInfoVector& invalid, bool resetUses = true,
bool cancelOffThread = true); bool cancelOffThread = true);
void Invalidate(JSContext* cx, const RecompileInfoVector& invalid, void Invalidate(JSContext* cx, const RecompileInfoVector& invalid,
@ -254,7 +254,7 @@ bool OffThreadCompilationAvailable(JSContext* cx);
void ForbidCompilation(JSContext* cx, JSScript* script); void ForbidCompilation(JSContext* cx, JSScript* script);
size_t SizeOfIonData(JSScript* script, mozilla::MallocSizeOf mallocSizeOf); 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); void TraceJitScripts(JSTracer* trc, JSScript* script);
bool JitSupportsSimd(); bool JitSupportsSimd();

Просмотреть файл

@ -101,7 +101,7 @@ class JitCode : public gc::TenuredCell {
size_t headerSize() const { return headerSize_; } size_t headerSize() const { return headerSize_; }
void traceChildren(JSTracer* trc); void traceChildren(JSTracer* trc);
void finalize(FreeOp* fop); void finalize(JSFreeOp* fop);
void setInvalidated() { invalidated_ = true; } void setInvalidated() { invalidated_ = true; }
void setHasBytecodeMap() { hasBytecodeMap_ = true; } void setHasBytecodeMap() { hasBytecodeMap_ = true; }
@ -294,7 +294,7 @@ struct IonScript {
size_t safepointsSize, size_t safepointsSize,
OptimizationLevel optimizationLevel); OptimizationLevel optimizationLevel);
static void Trace(JSTracer* trc, IonScript* script); 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 offsetOfMethod() { return offsetof(IonScript, method_); }
static inline size_t offsetOfOsrEntryOffset() { static inline size_t offsetOfOsrEntryOffset() {
@ -437,7 +437,7 @@ struct IonScript {
size_t invalidationCount() const { return invalidationCount_; } size_t invalidationCount() const { return invalidationCount_; }
void incrementInvalidationCount() { invalidationCount_++; } void incrementInvalidationCount() { invalidationCount_++; }
void decrementInvalidationCount(FreeOp* fop) { void decrementInvalidationCount(JSFreeOp* fop) {
MOZ_ASSERT(invalidationCount_); MOZ_ASSERT(invalidationCount_);
invalidationCount_--; invalidationCount_--;
if (!invalidationCount_) { if (!invalidationCount_) {

Просмотреть файл

@ -684,8 +684,8 @@ class JitRealm {
}; };
// Called from Zone::discardJitCode(). // Called from Zone::discardJitCode().
void InvalidateAll(FreeOp* fop, JS::Zone* zone); void InvalidateAll(JSFreeOp* fop, JS::Zone* zone);
void FinishInvalidation(FreeOp* fop, JSScript* script); void FinishInvalidation(JSFreeOp* fop, JSScript* script);
// This class ensures JIT code is executable on its destruction. Creators // 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. // 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; return true;
} }
void JSScript::maybeReleaseJitScript(FreeOp* fop) { void JSScript::maybeReleaseJitScript(JSFreeOp* fop) {
if (!jitScript_ || zone()->types.keepJitScripts || hasBaselineScript() || if (!jitScript_ || zone()->types.keepJitScripts || hasBaselineScript() ||
jitScript_->active()) { jitScript_->active()) {
return; return;
@ -172,7 +172,7 @@ void JSScript::maybeReleaseJitScript(FreeOp* fop) {
releaseJitScript(fop); releaseJitScript(fop);
} }
void JSScript::releaseJitScript(FreeOp* fop) { void JSScript::releaseJitScript(JSFreeOp* fop) {
MOZ_ASSERT(!hasIonScript()); MOZ_ASSERT(!hasIonScript());
fop->removeCellMemory(this, jitScript_->allocBytes(), MemoryUse::JitScript); fop->removeCellMemory(this, jitScript_->allocBytes(), MemoryUse::JitScript);

Просмотреть файл

@ -45,7 +45,7 @@
using namespace js; 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); static bool exn_toSource(JSContext* cx, unsigned argc, Value* vp);
@ -337,7 +337,7 @@ JSString* js::ComputeStackString(JSContext* cx) {
return str.get(); return str.get();
} }
static void exn_finalize(FreeOp* fop, JSObject* obj) { static void exn_finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->maybeOnHelperThread()); MOZ_ASSERT(fop->maybeOnHelperThread());
if (JSErrorReport* report = obj->as<ErrorObject>().getErrorReport()) { if (JSErrorReport* report = obj->as<ErrorObject>().getErrorReport()) {
// Bug 1560019: This allocation is not currently tracked. // 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); 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. */ /* Implemented in jsexn.cpp. */
/** /**

Просмотреть файл

@ -715,7 +715,7 @@ void ProxyObject::trace(JSTracer* trc, JSObject* obj) {
Proxy::trace(trc, 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(). // Suppress a bogus warning about finalize().
JS::AutoSuppressGCAnalysis nogc; JS::AutoSuppressGCAnalysis nogc;

Просмотреть файл

@ -429,7 +429,7 @@ class FileObject : public NativeObject {
return obj; return obj;
} }
static void finalize(FreeOp* fop, JSObject* obj) { static void finalize(JSFreeOp* fop, JSObject* obj) {
FileObject* fileObj = &obj->as<FileObject>(); FileObject* fileObj = &obj->as<FileObject>();
RCFile* file = fileObj->rcFile(); RCFile* file = fileObj->rcFile();
fop->removeCellMemory(obj, sizeof(*file), MemoryUse::FileObjectFile); fop->removeCellMemory(obj, sizeof(*file), MemoryUse::FileObjectFile);

Просмотреть файл

@ -6980,7 +6980,7 @@ class StreamCacheEntryObject : public NativeObject {
static const ClassOps classOps_; static const ClassOps classOps_;
static const JSPropertySpec properties_; static const JSPropertySpec properties_;
static void finalize(FreeOp*, JSObject* obj) { static void finalize(JSFreeOp*, JSObject* obj) {
obj->as<StreamCacheEntryObject>().cache().Release(); obj->as<StreamCacheEntryObject>().cache().Release();
} }

Просмотреть файл

@ -901,7 +901,7 @@ bool UnmappedArgumentsObject::obj_enumerate(JSContext* cx, HandleObject obj) {
return true; return true;
} }
void ArgumentsObject::finalize(FreeOp* fop, JSObject* obj) { void ArgumentsObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(!IsInsideNursery(obj)); MOZ_ASSERT(!IsInsideNursery(obj));
ArgumentsObject& argsobj = obj->as<ArgumentsObject>(); ArgumentsObject& argsobj = obj->as<ArgumentsObject>();
if (argsobj.data()) { if (argsobj.data()) {

Просмотреть файл

@ -374,7 +374,7 @@ class ArgumentsObject : public NativeObject {
: 0); : 0);
} }
static void finalize(FreeOp* fop, JSObject* obj); static void finalize(JSFreeOp* fop, JSObject* obj);
static void trace(JSTracer* trc, JSObject* obj); static void trace(JSTracer* trc, JSObject* obj);
static size_t objectMoved(JSObject* dst, JSObject* src); static size_t objectMoved(JSObject* dst, JSObject* src);

Просмотреть файл

@ -938,7 +938,7 @@ ArrayBufferObject::FreeInfo* ArrayBufferObject::freeInfo() const {
return reinterpret_cast<FreeInfo*>(inlineDataPointer()); return reinterpret_cast<FreeInfo*>(inlineDataPointer());
} }
void ArrayBufferObject::releaseData(FreeOp* fop) { void ArrayBufferObject::releaseData(JSFreeOp* fop) {
switch (bufferKind()) { switch (bufferKind()) {
case INLINE_DATA: case INLINE_DATA:
// Inline data doesn't require releasing. // Inline data doesn't require releasing.
@ -1479,7 +1479,7 @@ void ArrayBufferObject::addSizeOfExcludingThis(
} }
/* static */ /* static */
void ArrayBufferObject::finalize(FreeOp* fop, JSObject* obj) { void ArrayBufferObject::finalize(JSFreeOp* fop, JSObject* obj) {
obj->as<ArrayBufferObject>().releaseData(fop); obj->as<ArrayBufferObject>().releaseData(fop);
} }

Просмотреть файл

@ -389,7 +389,7 @@ class ArrayBufferObject : public ArrayBufferObjectMaybeShared {
} }
bool hasInlineData() const { return dataPointer() == inlineDataPointer(); } bool hasInlineData() const { return dataPointer() == inlineDataPointer(); }
void releaseData(FreeOp* fop); void releaseData(JSFreeOp* fop);
BufferKind bufferKind() const { BufferKind bufferKind() const {
return BufferKind(flags() & BUFFER_KIND_MASK); return BufferKind(flags() & BUFFER_KIND_MASK);
@ -427,7 +427,7 @@ class ArrayBufferObject : public ArrayBufferObjectMaybeShared {
#endif #endif
uint32_t wasmBoundsCheckLimit() const; 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, static BufferContents createMappedContents(int fd, size_t offset,
size_t length); size_t length);

Просмотреть файл

@ -169,7 +169,7 @@ void BigInt::initializeDigitsToZero() {
std::uninitialized_fill_n(digs.begin(), digs.Length(), 0); std::uninitialized_fill_n(digs.begin(), digs.Length(), 0);
} }
void BigInt::finalize(js::FreeOp* fop) { void BigInt::finalize(JSFreeOp* fop) {
if (hasHeapDigits()) { if (hasHeapDigits()) {
size_t size = digitLength() * sizeof(Digit); size_t size = digitLength() * sizeof(Digit);
fop->free_(this, heapDigits_, size, js::MemoryUse::BigIntDigits); fop->free_(this, heapDigits_, size, js::MemoryUse::BigIntDigits);

Просмотреть файл

@ -87,7 +87,7 @@ class BigInt final
void initializeDigitsToZero(); void initializeDigitsToZero();
void traceChildren(JSTracer* trc); void traceChildren(JSTracer* trc);
void finalize(js::FreeOp* fop); void finalize(JSFreeOp* fop);
js::HashNumber hash(); js::HashNumber hash();
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const; size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;

Просмотреть файл

@ -324,7 +324,7 @@ class JS::Compartment {
public: public:
explicit Compartment(JS::Zone* zone, bool invisibleToDebugger); 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); MOZ_MUST_USE inline bool wrap(JSContext* cx, JS::MutableHandleValue vp);
@ -380,8 +380,7 @@ class JS::Compartment {
void traceOutgoingCrossCompartmentWrappers(JSTracer* trc); void traceOutgoingCrossCompartmentWrappers(JSTracer* trc);
static void traceIncomingCrossCompartmentEdgesForZoneGC(JSTracer* trc); static void traceIncomingCrossCompartmentEdgesForZoneGC(JSTracer* trc);
void sweepRealms(js::FreeOp* fop, bool keepAtleastOne, void sweepRealms(JSFreeOp* fop, bool keepAtleastOne, bool destroyingRuntime);
bool destroyingRuntime);
void sweepAfterMinorGC(JSTracer* trc); void sweepAfterMinorGC(JSTracer* trc);
void sweepCrossCompartmentObjectWrappers(); void sweepCrossCompartmentObjectWrappers();

Просмотреть файл

@ -35,7 +35,7 @@ static RealmInstrumentation* GetInstrumentation(JSObject* obj) {
} }
/* static */ /* static */
void RealmInstrumentation::holderFinalize(FreeOp* fop, JSObject* obj) { void RealmInstrumentation::holderFinalize(JSFreeOp* fop, JSObject* obj) {
RealmInstrumentation* instrumentation = GetInstrumentation(obj); RealmInstrumentation* instrumentation = GetInstrumentation(obj);
fop->delete_(obj, instrumentation, MemoryUse::RealmInstrumentation); fop->delete_(obj, instrumentation, MemoryUse::RealmInstrumentation);
} }

Просмотреть файл

@ -83,7 +83,7 @@ class RealmInstrumentation {
void trace(JSTracer* trc); 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); 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 = if (NativeIterator* ni =
obj->as<PropertyIteratorObject>().getNativeIterator()) { obj->as<PropertyIteratorObject>().getNativeIterator()) {
fop->free_(obj, ni, ni->allocationSize(), MemoryUse::NativeIterator); fop->free_(obj, ni, ni->allocationSize(), MemoryUse::NativeIterator);

Просмотреть файл

@ -367,7 +367,7 @@ class PropertyIteratorObject : public NativeObject {
private: private:
static void trace(JSTracer* trc, JSObject* obj); 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 { 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. // Free lists for parallel allocation in the atoms zone on helper threads.
js::ContextData<js::gc::FreeLists*> atomsZoneFreeLists_; 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. // Thread that the JSContext is currently running on, if in use.
js::Thread::Id currentThread_; js::Thread::Id currentThread_;
@ -297,7 +297,7 @@ struct JSContext : public JS::RootingContext,
return *runtime_->wellKnownSymbols; return *runtime_->wellKnownSymbols;
} }
js::PropertyName* emptyString() { return runtime_->emptyString; } js::PropertyName* emptyString() { return runtime_->emptyString; }
js::FreeOp* defaultFreeOp() { return &defaultFreeOp_.ref(); } JSFreeOp* defaultFreeOp() { return &defaultFreeOp_.ref(); }
void* stackLimitAddress(JS::StackKind kind) { void* stackLimitAddress(JS::StackKind kind) {
return &nativeStackLimit[kind]; return &nativeStackLimit[kind];
} }
@ -1288,13 +1288,13 @@ class MOZ_RAII AutoSetThreadIsPerformingGC {
public: public:
AutoSetThreadIsPerformingGC() : cx(TlsContext.get()) { AutoSetThreadIsPerformingGC() : cx(TlsContext.get()) {
FreeOp* fop = cx->defaultFreeOp(); JSFreeOp* fop = cx->defaultFreeOp();
MOZ_ASSERT(!fop->isCollecting()); MOZ_ASSERT(!fop->isCollecting());
fop->isCollecting_ = true; fop->isCollecting_ = true;
} }
~AutoSetThreadIsPerformingGC() { ~AutoSetThreadIsPerformingGC() {
FreeOp* fop = cx->defaultFreeOp(); JSFreeOp* fop = cx->defaultFreeOp();
MOZ_ASSERT(fop->isCollecting()); MOZ_ASSERT(fop->isCollecting());
fop->isCollecting_ = false; fop->isCollecting_ = false;
} }

Просмотреть файл

@ -49,7 +49,7 @@ js::NativeObject::dynamicSlotsCount(Shape* shape) {
shape->getObjectClass()); shape->getObjectClass());
} }
inline void JSObject::finalize(js::FreeOp* fop) { inline void JSObject::finalize(JSFreeOp* fop) {
js::probes::FinalizeObject(this); js::probes::FinalizeObject(this);
#ifdef DEBUG #ifdef DEBUG

Просмотреть файл

@ -462,7 +462,7 @@ class JSObject : public js::gc::Cell {
MOZ_ALWAYS_INLINE JSNative callHook() const; MOZ_ALWAYS_INLINE JSNative callHook() const;
MOZ_ALWAYS_INLINE JSNative constructHook() const; MOZ_ALWAYS_INLINE JSNative constructHook() const;
MOZ_ALWAYS_INLINE void finalize(js::FreeOp* fop); MOZ_ALWAYS_INLINE void finalize(JSFreeOp* fop);
public: public:
static bool nonNativeSetProperty(JSContext* cx, js::HandleObject obj, static bool nonNativeSetProperty(JSContext* cx, js::HandleObject obj,

Просмотреть файл

@ -166,7 +166,7 @@ inline void JSScript::setBaselineScript(
} }
inline void JSScript::setBaselineScript( inline void JSScript::setBaselineScript(
js::FreeOp* fop, js::jit::BaselineScript* baselineScript) { JSFreeOp* fop, js::jit::BaselineScript* baselineScript) {
if (hasBaselineScript()) { if (hasBaselineScript()) {
js::jit::BaselineScript::writeBarrierPre(zone(), baseline); js::jit::BaselineScript::writeBarrierPre(zone(), baseline);
clearBaselineScript(fop); clearBaselineScript(fop);
@ -181,14 +181,14 @@ inline void JSScript::setBaselineScript(
updateJitCodeRaw(fop->runtime()); updateJitCodeRaw(fop->runtime());
} }
inline void JSScript::clearBaselineScript(js::FreeOp* fop) { inline void JSScript::clearBaselineScript(JSFreeOp* fop) {
MOZ_ASSERT(hasBaselineScript()); MOZ_ASSERT(hasBaselineScript());
fop->removeCellMemory(this, baseline->allocBytes(), fop->removeCellMemory(this, baseline->allocBytes(),
js::MemoryUse::BaselineScript); js::MemoryUse::BaselineScript);
baseline = nullptr; baseline = nullptr;
} }
inline void JSScript::clearIonScript(js::FreeOp* fop) { inline void JSScript::clearIonScript(JSFreeOp* fop) {
MOZ_ASSERT(hasIonScript()); MOZ_ASSERT(hasIonScript());
fop->removeCellMemory(this, ion->allocBytes(), js::MemoryUse::IonScript); fop->removeCellMemory(this, ion->allocBytes(), js::MemoryUse::IonScript);
ion = nullptr; ion = nullptr;

Просмотреть файл

@ -1515,7 +1515,7 @@ void JSScript::setIonScript(JSRuntime* rt, js::jit::IonScript* ionScript) {
setIonScript(rt->defaultFreeOp(), 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, MOZ_ASSERT_IF(ionScript != ION_DISABLED_SCRIPT,
!baselineScript()->hasPendingIonBuilder()); !baselineScript()->hasPendingIonBuilder());
if (hasIonScript()) { if (hasIonScript()) {
@ -1651,7 +1651,7 @@ bool JSScript::hasScriptName() {
return p.found(); return p.found();
} }
void ScriptSourceObject::finalize(FreeOp* fop, JSObject* obj) { void ScriptSourceObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
ScriptSourceObject* sso = &obj->as<ScriptSourceObject>(); ScriptSourceObject* sso = &obj->as<ScriptSourceObject>();
sso->source()->decref(); sso->source()->decref();
@ -4189,7 +4189,7 @@ void JSScript::addSizeOfJitScript(mozilla::MallocSizeOf mallocSizeOf,
js::GlobalObject& JSScript::uninlinedGlobal() const { return global(); } 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 // NOTE: this JSScript may be partially initialized at this point. E.g. we
// may have created it and partially initialized it with // may have created it and partially initialized it with
// JSScript::Create(), but not yet finished initializing 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_) { if (lazyData_) {
fop->free_(this, lazyData_, lazyData_->allocationSize(), fop->free_(this, lazyData_, lazyData_->allocationSize(),
MemoryUse::LazyScriptData); MemoryUse::LazyScriptData);

Просмотреть файл

@ -1279,7 +1279,7 @@ class ScriptSourceObject : public NativeObject {
static const Class class_; static const Class class_;
static void trace(JSTracer* trc, JSObject* obj); 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* create(JSContext* cx, ScriptSource* source);
static ScriptSourceObject* clone(JSContext* cx, HandleScriptSourceObject sso); 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* maybeIonScript() const { return ion; }
js::jit::IonScript* const* addressOfIonScript() const { return &ion; } js::jit::IonScript* const* addressOfIonScript() const { return &ion; }
void setIonScript(JSRuntime* rt, js::jit::IonScript* ionScript); void setIonScript(JSRuntime* rt, js::jit::IonScript* ionScript);
void setIonScript(js::FreeOp* fop, js::jit::IonScript* ionScript); void setIonScript(JSFreeOp* fop, js::jit::IonScript* ionScript);
inline void clearIonScript(js::FreeOp* fop); inline void clearIonScript(JSFreeOp* fop);
bool hasBaselineScript() const { bool hasBaselineScript() const {
bool res = baseline && baseline != BASELINE_DISABLED_SCRIPT; bool res = baseline && baseline != BASELINE_DISABLED_SCRIPT;
@ -2633,9 +2633,9 @@ class JSScript : public js::BaseScript {
} }
inline void setBaselineScript(JSRuntime* rt, inline void setBaselineScript(JSRuntime* rt,
js::jit::BaselineScript* baselineScript); js::jit::BaselineScript* baselineScript);
inline void setBaselineScript(js::FreeOp* fop, inline void setBaselineScript(JSFreeOp* fop,
js::jit::BaselineScript* baselineScript); js::jit::BaselineScript* baselineScript);
inline void clearBaselineScript(js::FreeOp* fop); inline void clearBaselineScript(JSFreeOp* fop);
void updateJitCodeRaw(JSRuntime* rt); void updateJitCodeRaw(JSRuntime* rt);
@ -2751,8 +2751,8 @@ class JSScript : public js::BaseScript {
bool hasJitScript() const { return jitScript_ != nullptr; } bool hasJitScript() const { return jitScript_ != nullptr; }
js::jit::JitScript* jitScript() { return jitScript_; } js::jit::JitScript* jitScript() { return jitScript_; }
void maybeReleaseJitScript(js::FreeOp* fop); void maybeReleaseJitScript(JSFreeOp* fop);
void releaseJitScript(js::FreeOp* fop); void releaseJitScript(JSFreeOp* fop);
inline js::GlobalObject& global() const; inline js::GlobalObject& global() const;
inline bool hasGlobal(const 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); } bool hasDebugScript() const { return hasFlag(MutableFlags::HasDebugScript); }
void setHasDebugScript(bool b) { setFlag(MutableFlags::HasDebugScript, b); } 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; static const JS::TraceKind TraceKind = JS::TraceKind::Script;
@ -3460,7 +3460,7 @@ class LazyScript : public BaseScript {
friend class GCMarker; friend class GCMarker;
void traceChildren(JSTracer* trc); void traceChildren(JSTracer* trc);
void finalize(js::FreeOp* fop); void finalize(JSFreeOp* fop);
static const JS::TraceKind TraceKind = JS::TraceKind::LazyScript; static const JS::TraceKind TraceKind = JS::TraceKind::LazyScript;

Просмотреть файл

@ -47,7 +47,7 @@ ObjectGroup::ObjectGroup(const Class* clasp, TaggedProto proto,
setGeneration(zone()->types.generation); setGeneration(zone()->types.generation);
} }
void ObjectGroup::finalize(FreeOp* fop) { void ObjectGroup::finalize(JSFreeOp* fop) {
if (auto newScript = newScriptDontCheckGeneration()) { if (auto newScript = newScriptDontCheckGeneration()) {
newScript->clear(); newScript->clear();
fop->delete_(this, newScript, newScript->gcMallocBytes(), fop->delete_(this, newScript, newScript->gcMallocBytes(),

Просмотреть файл

@ -432,7 +432,7 @@ class ObjectGroup : public gc::TenuredCell {
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const; size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
void finalize(FreeOp* fop); void finalize(JSFreeOp* fop);
static const JS::TraceKind TraceKind = JS::TraceKind::ObjectGroup; 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()); MOZ_ASSERT(fop->maybeOnHelperThread());
if (ForOfPIC::Chain* chain = if (ForOfPIC::Chain* chain =
ForOfPIC::fromJSObject(&obj->as<NativeObject>())) { 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); freeAllStubs(fop);
fop->delete_(obj, this, MemoryUse::ForOfPIC); fop->delete_(obj, this, MemoryUse::ForOfPIC);
} }
void js::ForOfPIC::Chain::freeAllStubs(FreeOp* fop) { void js::ForOfPIC::Chain::freeAllStubs(JSFreeOp* fop) {
Stub* stub = stubs_; Stub* stub = stubs_;
while (stub) { while (stub) {
Stub* next = stub->next(); Stub* next = stub->next();

Просмотреть файл

@ -187,7 +187,7 @@ struct ForOfPIC {
bool tryOptimizeArrayIteratorNext(JSContext* cx, bool* optimized); bool tryOptimizeArrayIteratorNext(JSContext* cx, bool* optimized);
void trace(JSTracer* trc); void trace(JSTracer* trc);
void finalize(FreeOp* fop, JSObject* obj); void finalize(JSFreeOp* fop, JSObject* obj);
private: private:
// Check if the global array-related objects have not been messed with // Check if the global array-related objects have not been messed with
@ -211,7 +211,7 @@ struct ForOfPIC {
// Erase the stub chain. // Erase the stub chain.
void eraseChain(JSContext* cx); void eraseChain(JSContext* cx);
void freeAllStubs(FreeOp* fop); void freeAllStubs(JSFreeOp* fop);
}; };
// Class for object that holds ForOfPIC chain. // Class for object that holds ForOfPIC chain.

Просмотреть файл

@ -462,7 +462,7 @@ class JS::Realm : public JS::shadow::Realm {
~Realm(); ~Realm();
MOZ_MUST_USE bool init(JSContext* cx, JSPrincipals* principals); MOZ_MUST_USE bool init(JSContext* cx, JSPrincipals* principals);
void destroy(js::FreeOp* fop); void destroy(JSFreeOp* fop);
void clearTables(); void clearTables();
void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, void addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,

Просмотреть файл

@ -925,7 +925,7 @@ void RegExpShared::discardJitCode() {
tables.clearAndFree(); tables.clearAndFree();
} }
void RegExpShared::finalize(FreeOp* fop) { void RegExpShared::finalize(JSFreeOp* fop) {
for (auto& comp : compilationArray) { for (auto& comp : compilationArray) {
if (comp.byteCode) { if (comp.byteCode) {
size_t length = comp.byteCodeLength(); size_t length = comp.byteCodeLength();

Просмотреть файл

@ -185,7 +185,7 @@ class RegExpShared : public gc::TenuredCell {
void traceChildren(JSTracer* trc); void traceChildren(JSTracer* trc);
void discardJitCode(); void discardJitCode();
void finalize(FreeOp* fop); void finalize(JSFreeOp* fop);
static size_t offsetOfSource() { return offsetof(RegExpShared, source); } static size_t offsetOfSource() { return offsetof(RegExpShared, source); }

Просмотреть файл

@ -20,7 +20,7 @@ using namespace js;
* that js::Class in a global reserved slot. * 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()); MOZ_ASSERT(fop->onMainThread());
RegExpStatics* res = RegExpStatics* res =
static_cast<RegExpStatics*>(obj->as<RegExpStaticsObject>().getPrivate()); static_cast<RegExpStatics*>(obj->as<RegExpStaticsObject>().getPrivate());

Просмотреть файл

@ -690,10 +690,10 @@ struct JSRuntime {
js::WriteOnceData<js::PropertyName*> emptyString; js::WriteOnceData<js::PropertyName*> emptyString;
private: private:
js::MainThreadData<js::FreeOp*> defaultFreeOp_; js::MainThreadData<JSFreeOp*> defaultFreeOp_;
public: public:
js::FreeOp* defaultFreeOp() { JSFreeOp* defaultFreeOp() {
MOZ_ASSERT(defaultFreeOp_); MOZ_ASSERT(defaultFreeOp_);
return defaultFreeOp_; return defaultFreeOp_;
} }

Просмотреть файл

@ -41,7 +41,7 @@ class SavedFrame : public NativeObject {
static bool parentProperty(JSContext* cx, unsigned argc, Value* vp); static bool parentProperty(JSContext* cx, unsigned argc, Value* vp);
static bool toStringMethod(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++. // Convenient getters for SavedFrame's reserved slots for use from C++.
JSAtom* getSource(); JSAtom* getSource();

Просмотреть файл

@ -400,7 +400,7 @@ const Class SavedFrame::protoClass_ = {
JS_PS_END}; JS_PS_END};
/* static */ /* static */
void SavedFrame::finalize(FreeOp* fop, JSObject* obj) { void SavedFrame::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->onMainThread()); MOZ_ASSERT(fop->onMainThread());
JSPrincipals* p = obj->as<SavedFrame>().getPrincipals(); JSPrincipals* p = obj->as<SavedFrame>().getPrincipals();
if (p) { if (p) {

Просмотреть файл

@ -463,7 +463,7 @@ Scope* Scope::clone(JSContext* cx, HandleScope scope, HandleScope enclosing) {
return nullptr; return nullptr;
} }
void Scope::finalize(FreeOp* fop) { void Scope::finalize(JSFreeOp* fop) {
MOZ_ASSERT(CurrentThreadIsGCSweeping()); MOZ_ASSERT(CurrentThreadIsGCSweeping());
applyScopeDataTyped([this, fop](auto data) { applyScopeDataTyped([this, fop](auto data) {
fop->delete_(this, data, SizeOfAllocatedData(data), MemoryUse::ScopeData); 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); static Scope* clone(JSContext* cx, HandleScope scope, HandleScope enclosing);
void traceChildren(JSTracer* trc); void traceChildren(JSTracer* trc);
void finalize(FreeOp* fop); void finalize(JSFreeOp* fop);
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const; size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const;

Просмотреть файл

@ -181,7 +181,7 @@ bool Shape::hashify(JSContext* cx, Shape* shape) {
return true; return true;
} }
void ShapeCachePtr::maybePurgeCache(FreeOp* fop, BaseShape* base) { void ShapeCachePtr::maybePurgeCache(JSFreeOp* fop, BaseShape* base) {
if (isTable()) { if (isTable()) {
ShapeTable* table = getTablePointer(); ShapeTable* table = getTablePointer();
if (table->freeList() == SHAPE_INVALID_SLOT) { 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()) { if (isTable()) {
fop->delete_(base, getTablePointer(), MemoryUse::ShapeCache); fop->delete_(base, getTablePointer(), MemoryUse::ShapeCache);
} else if (isIC()) { } else if (isIC()) {
@ -1683,7 +1683,7 @@ void Zone::checkBaseShapeTableAfterMovingGC() {
#endif // JSGC_HASH_TABLE_CHECKS #endif // JSGC_HASH_TABLE_CHECKS
void BaseShape::finalize(FreeOp* fop) { void BaseShape::finalize(JSFreeOp* fop) {
if (cache_.isInitialized()) { if (cache_.isInitialized()) {
cache_.destroy(fop, this); cache_.destroy(fop, this);
} }
@ -1794,7 +1794,7 @@ bool PropertyTree::insertChild(JSContext* cx, Shape* parent, Shape* child) {
return true; return true;
} }
void Shape::removeChild(FreeOp* fop, Shape* child) { void Shape::removeChild(JSFreeOp* fop, Shape* child) {
MOZ_ASSERT(!child->inDictionary()); MOZ_ASSERT(!child->inDictionary());
MOZ_ASSERT(child->parent == this); MOZ_ASSERT(child->parent == this);
@ -1882,7 +1882,7 @@ Shape* PropertyTree::getChild(JSContext* cx, Shape* parent,
return inlinedGetChild(cx, parent, child); 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. * 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()) { if (!inDictionary() && kids.isHash()) {
fop->delete_(this, kids.toHash(), MemoryUse::ShapeKids); fop->delete_(this, kids.toHash(), MemoryUse::ShapeKids);
} }

Просмотреть файл

@ -515,9 +515,9 @@ class ShapeCachePtr {
p = icptr; 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); void trace(JSTracer* trc);
@ -669,7 +669,7 @@ class BaseShape : public gc::TenuredCell {
BaseShape& operator=(const BaseShape& other) = delete; BaseShape& operator=(const BaseShape& other) = delete;
public: public:
void finalize(FreeOp* fop); void finalize(JSFreeOp* fop);
explicit inline BaseShape(const StackBaseShape& base); explicit inline BaseShape(const StackBaseShape& base);
@ -740,7 +740,7 @@ class BaseShape : public gc::TenuredCell {
return (cache_.isIC()) ? cache_.getICPointer() : nullptr; 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 { uint32_t slotSpan() const {
MOZ_ASSERT(isOwned()); MOZ_ASSERT(isOwned());
@ -1353,9 +1353,9 @@ class Shape : public gc::TenuredCell {
void dumpSubtree(int level, js::GenericPrinter& out) const; void dumpSubtree(int level, js::GenericPrinter& out) const;
#endif #endif
void sweep(FreeOp* fop); void sweep(JSFreeOp* fop);
void finalize(FreeOp* fop); void finalize(JSFreeOp* fop);
void removeChild(FreeOp* fop, Shape* child); void removeChild(JSFreeOp* fop, Shape* child);
static const JS::TraceKind TraceKind = JS::TraceKind::Shape; static const JS::TraceKind TraceKind = JS::TraceKind::Shape;

Просмотреть файл

@ -274,7 +274,7 @@ SharedArrayRawBuffer* SharedArrayBufferObject::rawBufferObject() const {
return reinterpret_cast<SharedArrayRawBuffer*>(v.toPrivate()); return reinterpret_cast<SharedArrayRawBuffer*>(v.toPrivate());
} }
void SharedArrayBufferObject::Finalize(FreeOp* fop, JSObject* obj) { void SharedArrayBufferObject::Finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(fop->maybeOnHelperThread()); MOZ_ASSERT(fop->maybeOnHelperThread());
SharedArrayBufferObject& buf = obj->as<SharedArrayBufferObject>(); SharedArrayBufferObject& buf = obj->as<SharedArrayBufferObject>();

Просмотреть файл

@ -187,7 +187,7 @@ class SharedArrayBufferObject : public ArrayBufferObjectMaybeShared {
uint32_t length, uint32_t length,
HandleObject proto = nullptr); HandleObject proto = nullptr);
static void Finalize(FreeOp* fop, JSObject* obj); static void Finalize(JSFreeOp* fop, JSObject* obj);
static void addSizeOfExcludingThis(JSObject* obj, static void addSizeOfExcludingThis(JSObject* obj,
mozilla::MallocSizeOf mallocSizeOf, mozilla::MallocSizeOf mallocSizeOf,

Просмотреть файл

@ -411,7 +411,7 @@ inline JSLinearString* js::StaticStrings::getUnitStringForElement(
return js::NewInlineString<CanGC>(cx, mozilla::Range<const char16_t>(&c, 1)); 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. */ /* FatInline strings are in a different arena. */
MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_STRING); MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_STRING);
MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_ATOM); 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_STRING);
MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_ATOM); MOZ_ASSERT(getAllocKind() != js::gc::AllocKind::FAT_INLINE_ATOM);
@ -442,21 +442,21 @@ inline size_t JSFlatString::allocSize() const {
return (count + 1) * charSize; 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(getAllocKind() == js::gc::AllocKind::FAT_INLINE_STRING);
MOZ_ASSERT(isInline()); MOZ_ASSERT(isInline());
// Nothing to do. // Nothing to do.
} }
inline void js::FatInlineAtom::finalize(js::FreeOp* fop) { inline void js::FatInlineAtom::finalize(JSFreeOp* fop) {
MOZ_ASSERT(JSString::isAtom()); MOZ_ASSERT(JSString::isAtom());
MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::FAT_INLINE_ATOM); MOZ_ASSERT(getAllocKind() == js::gc::AllocKind::FAT_INLINE_ATOM);
// Nothing to do. // Nothing to do.
} }
inline void JSExternalString::finalize(js::FreeOp* fop) { inline void JSExternalString::finalize(JSFreeOp* fop) {
if (!JSString::isExternal()) { if (!JSString::isExternal()) {
// This started out as an external string, but was turned into a // This started out as an external string, but was turned into a
// non-external string by JSExternalString::ensureFlat. // 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. */ /* 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. */ /* 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 size_t allocSize() const;
inline void finalize(js::FreeOp* fop); inline void finalize(JSFreeOp* fop);
#if defined(DEBUG) || defined(JS_JITSPEW) #if defined(DEBUG) || defined(JS_JITSPEW)
void dumpRepresentation(js::GenericPrinter& out, int indent) const; 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 // Only called by the GC for strings with the AllocKind::FAT_INLINE_STRING
// kind. // kind.
MOZ_ALWAYS_INLINE void finalize(js::FreeOp* fop); MOZ_ALWAYS_INLINE void finalize(JSFreeOp* fop);
}; };
static_assert(sizeof(JSFatInlineString) % js::gc::CellAlignBytes == 0, 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 // Only called by the GC for strings with the AllocKind::EXTERNAL_STRING
// kind. // 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 // Free the external chars and allocate a new buffer, converting this to a
// flat string (which still lives in an AllocKind::EXTERNAL_STRING // flat string (which still lives in an AllocKind::EXTERNAL_STRING
@ -1236,7 +1236,7 @@ class FatInlineAtom : public JSAtom {
HashNumber hash() const { return hash_; } HashNumber hash() const { return hash_; }
void initHash(HashNumber hash) { hash_ = hash; } void initHash(HashNumber hash) { hash_ = hash; }
inline void finalize(js::FreeOp* fop); inline void finalize(JSFreeOp* fop);
}; };
static_assert( static_assert(

Просмотреть файл

@ -89,7 +89,7 @@ class Symbol : public js::gc::TenuredCell {
js::TraceManuallyBarrieredEdge(trc, &description_, "description"); js::TraceManuallyBarrieredEdge(trc, &description_, "description");
} }
} }
inline void finalize(js::FreeOp*) {} inline void finalize(JSFreeOp*) {}
static MOZ_ALWAYS_INLINE void writeBarrierPre(Symbol* thing) { static MOZ_ALWAYS_INLINE void writeBarrierPre(Symbol* thing) {
if (thing && !thing->isWellKnownSymbol()) { if (thing && !thing->isWellKnownSymbol()) {

Просмотреть файл

@ -418,7 +418,7 @@ struct MOZ_RAII AutoEnterAnalysis {
// Prevent us from calling the objectMetadataCallback. // Prevent us from calling the objectMetadataCallback.
js::AutoSuppressAllocationMetadataBuilder suppressMetadata; js::AutoSuppressAllocationMetadataBuilder suppressMetadata;
FreeOp* freeOp; JSFreeOp* freeOp;
Zone* zone; Zone* zone;
explicit AutoEnterAnalysis(JSContext* cx) explicit AutoEnterAnalysis(JSContext* cx)
@ -426,7 +426,7 @@ struct MOZ_RAII AutoEnterAnalysis {
init(cx->defaultFreeOp(), cx->zone()); init(cx->defaultFreeOp(), cx->zone());
} }
AutoEnterAnalysis(FreeOp* fop, Zone* zone) AutoEnterAnalysis(JSFreeOp* fop, Zone* zone)
: suppressGC(TlsContext.get()), suppressMetadata(zone) { : suppressGC(TlsContext.get()), suppressMetadata(zone) {
init(fop, zone); init(fop, zone);
} }
@ -444,7 +444,7 @@ struct MOZ_RAII AutoEnterAnalysis {
} }
private: private:
void init(FreeOp* fop, Zone* zone) { void init(JSFreeOp* fop, Zone* zone) {
#ifdef JS_CRASH_DIAGNOSTICS #ifdef JS_CRASH_DIAGNOSTICS
MOZ_RELEASE_ASSERT(CurrentThreadCanAccessZone(zone)); MOZ_RELEASE_ASSERT(CurrentThreadCanAccessZone(zone));
#endif #endif

Просмотреть файл

@ -2651,7 +2651,7 @@ bool js::ClassCanHaveExtraProperties(const Class* clasp) {
clasp->getOpsGetProperty() || IsTypedArrayClass(clasp); clasp->getOpsGetProperty() || IsTypedArrayClass(clasp);
} }
void TypeZone::processPendingRecompiles(FreeOp* fop, void TypeZone::processPendingRecompiles(JSFreeOp* fop,
RecompileInfoVector& recompiles) { RecompileInfoVector& recompiles) {
MOZ_ASSERT(!recompiles.empty()); MOZ_ASSERT(!recompiles.empty());
@ -4486,7 +4486,7 @@ AutoClearTypeInferenceStateOnOOM::~AutoClearTypeInferenceStateOnOOM() {
if (zone->types.hadOOMSweepingTypes()) { if (zone->types.hadOOMSweepingTypes()) {
gc::AutoSetThreadIsSweeping threadIsSweeping; gc::AutoSetThreadIsSweeping threadIsSweeping;
JSRuntime* rt = zone->runtimeFromMainThread(); JSRuntime* rt = zone->runtimeFromMainThread();
FreeOp fop(rt); JSFreeOp fop(rt);
js::CancelOffThreadIonCompile(rt); js::CancelOffThreadIonCompile(rt);
zone->setPreservingCode(false); zone->setPreservingCode(false);
zone->discardJitCode(&fop, Zone::KeepBaselineCode); zone->discardJitCode(&fop, Zone::KeepBaselineCode);

Просмотреть файл

@ -262,7 +262,7 @@ class TypeZone {
void addPendingRecompile(JSContext* cx, const RecompileInfo& info); void addPendingRecompile(JSContext* cx, const RecompileInfo& info);
void addPendingRecompile(JSContext* cx, JSScript* script); void addPendingRecompile(JSContext* cx, JSScript* script);
void processPendingRecompiles(FreeOp* fop, RecompileInfoVector& recompiles); void processPendingRecompiles(JSFreeOp* fop, RecompileInfoVector& recompiles);
bool isSweepingTypes() const { return sweepingTypes; } bool isSweepingTypes() const { return sweepingTypes; }
void setSweepingTypes(bool sweeping) { void setSweepingTypes(bool sweeping) {

Просмотреть файл

@ -149,7 +149,7 @@ void TypedArrayObject::assertZeroLengthArrayData() const {
} }
#endif #endif
void TypedArrayObject::finalize(FreeOp* fop, JSObject* obj) { void TypedArrayObject::finalize(JSFreeOp* fop, JSObject* obj) {
MOZ_ASSERT(!IsInsideNursery(obj)); MOZ_ASSERT(!IsInsideNursery(obj));
TypedArrayObject* curObj = &obj->as<TypedArrayObject>(); TypedArrayObject* curObj = &obj->as<TypedArrayObject>();

Просмотреть файл

@ -158,7 +158,7 @@ class TypedArrayObject : public ArrayBufferViewObject {
static bool isOriginalByteOffsetGetter(Native native); 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); static size_t objectMoved(JSObject* obj, JSObject* old);
/* Initialization bits */ /* Initialization bits */

Просмотреть файл

@ -127,7 +127,7 @@ bool DebugState::incrementStepperCount(JSContext* cx, uint32_t funcIndex) {
return true; return true;
} }
bool DebugState::decrementStepperCount(FreeOp* fop, uint32_t funcIndex) { bool DebugState::decrementStepperCount(JSFreeOp* fop, uint32_t funcIndex) {
const CodeRange& codeRange = const CodeRange& codeRange =
codeRanges(Tier::Debug)[funcToCodeRangeIndex(funcIndex)]; codeRanges(Tier::Debug)[funcToCodeRangeIndex(funcIndex)];
MOZ_ASSERT(codeRange.isFunction()); MOZ_ASSERT(codeRange.isFunction());
@ -228,7 +228,7 @@ bool DebugState::hasBreakpointSite(uint32_t offset) {
return breakpointSites_.has(offset); return breakpointSites_.has(offset);
} }
void DebugState::destroyBreakpointSite(FreeOp* fop, Instance* instance, void DebugState::destroyBreakpointSite(JSFreeOp* fop, Instance* instance,
uint32_t offset) { uint32_t offset) {
WasmBreakpointSiteMap::Ptr p = breakpointSites_.lookup(offset); WasmBreakpointSiteMap::Ptr p = breakpointSites_.lookup(offset);
MOZ_ASSERT(p); MOZ_ASSERT(p);
@ -237,7 +237,7 @@ void DebugState::destroyBreakpointSite(FreeOp* fop, Instance* instance,
breakpointSites_.remove(p); breakpointSites_.remove(p);
} }
void DebugState::clearBreakpointsIn(FreeOp* fop, WasmInstanceObject* instance, void DebugState::clearBreakpointsIn(JSFreeOp* fop, WasmInstanceObject* instance,
js::Debugger* dbg, JSObject* handler) { js::Debugger* dbg, JSObject* handler) {
MOZ_ASSERT(instance); MOZ_ASSERT(instance);
if (breakpointSites_.empty()) { 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) { WasmInstanceObject* instance) {
clearBreakpointsIn(fop, instance, nullptr, nullptr); clearBreakpointsIn(fop, instance, nullptr, nullptr);
} }

Просмотреть файл

@ -94,17 +94,18 @@ class DebugState {
Instance* instance, Instance* instance,
uint32_t offset); uint32_t offset);
bool hasBreakpointSite(uint32_t offset); bool hasBreakpointSite(uint32_t offset);
void destroyBreakpointSite(FreeOp* fop, Instance* instance, uint32_t offset); void destroyBreakpointSite(JSFreeOp* fop, Instance* instance,
void clearBreakpointsIn(FreeOp* fp, WasmInstanceObject* instance, uint32_t offset);
void clearBreakpointsIn(JSFreeOp* fp, WasmInstanceObject* instance,
js::Debugger* dbg, JSObject* handler); 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 // When the Code is debug-enabled, single-stepping mode can be toggled on
// the granularity of individual functions. // the granularity of individual functions.
bool stepModeEnabled(uint32_t funcIndex) const; bool stepModeEnabled(uint32_t funcIndex) const;
bool incrementStepperCount(JSContext* cx, uint32_t funcIndex); bool incrementStepperCount(JSContext* cx, uint32_t funcIndex);
bool decrementStepperCount(FreeOp* fop, uint32_t funcIndex); bool decrementStepperCount(JSFreeOp* fop, uint32_t funcIndex);
// Stack inspection helpers. // Stack inspection helpers.

Просмотреть файл

@ -1966,7 +1966,7 @@ WasmBreakpointSite* Instance::getOrCreateBreakpointSite(JSContext* cx,
return debug().getOrCreateBreakpointSite(cx, this, offset); 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()); MOZ_ASSERT(debugEnabled());
return debug().destroyBreakpointSite(fop, this, offset); return debug().destroyBreakpointSite(fop, this, offset);
} }

Просмотреть файл

@ -57,7 +57,7 @@ class Instance {
const UniqueDebugState maybeDebug_; const UniqueDebugState maybeDebug_;
StructTypeDescrVector structTypeDescrs_; StructTypeDescrVector structTypeDescrs_;
friend void Zone::sweepBreakpoints(js::FreeOp*); friend void Zone::sweepBreakpoints(JSFreeOp*);
// Internal helpers: // Internal helpers:
const void** addressOfFuncTypeId(const FuncTypeIdDesc& funcTypeId) const; const void** addressOfFuncTypeId(const FuncTypeIdDesc& funcTypeId) const;
@ -169,7 +169,7 @@ class Instance {
JSString* createDisplayURL(JSContext* cx); JSString* createDisplayURL(JSContext* cx);
WasmBreakpointSite* getOrCreateBreakpointSite(JSContext* cx, uint32_t offset); WasmBreakpointSite* getOrCreateBreakpointSite(JSContext* cx, uint32_t offset);
void destroyBreakpointSite(FreeOp* fop, uint32_t offset); void destroyBreakpointSite(JSFreeOp* fop, uint32_t offset);
// about:memory reporting: // about:memory reporting:

Просмотреть файл

@ -685,7 +685,7 @@ const JSFunctionSpec WasmModuleObject::static_methods[] = {
JS_FS_END}; JS_FS_END};
/* static */ /* static */
void WasmModuleObject::finalize(FreeOp* fop, JSObject* obj) { void WasmModuleObject::finalize(JSFreeOp* fop, JSObject* obj) {
const Module& module = obj->as<WasmModuleObject>().module(); const Module& module = obj->as<WasmModuleObject>().module();
obj->zone()->decJitMemory(module.codeLength(module.code().stableTier())); obj->zone()->decJitMemory(module.codeLength(module.code().stableTier()));
fop->release(obj, &module, module.gcMallocBytesExcludingCode(), fop->release(obj, &module, module.gcMallocBytesExcludingCode(),
@ -1229,7 +1229,7 @@ bool WasmInstanceObject::isNewborn() const {
} }
/* static */ /* static */
void WasmInstanceObject::finalize(FreeOp* fop, JSObject* obj) { void WasmInstanceObject::finalize(JSFreeOp* fop, JSObject* obj) {
WasmInstanceObject& instance = obj->as<WasmInstanceObject>(); WasmInstanceObject& instance = obj->as<WasmInstanceObject>();
fop->delete_(obj, &instance.exports(), MemoryUse::WasmInstanceExports); fop->delete_(obj, &instance.exports(), MemoryUse::WasmInstanceExports);
fop->delete_(obj, &instance.scopes(), MemoryUse::WasmInstanceScopes); fop->delete_(obj, &instance.scopes(), MemoryUse::WasmInstanceScopes);
@ -1619,7 +1619,7 @@ const Class WasmMemoryObject::class_ = {
&WasmMemoryObject::classOps_}; &WasmMemoryObject::classOps_};
/* static */ /* static */
void WasmMemoryObject::finalize(FreeOp* fop, JSObject* obj) { void WasmMemoryObject::finalize(JSFreeOp* fop, JSObject* obj) {
WasmMemoryObject& memory = obj->as<WasmMemoryObject>(); WasmMemoryObject& memory = obj->as<WasmMemoryObject>();
if (memory.hasObservers()) { if (memory.hasObservers()) {
fop->delete_(obj, &memory.observers(), MemoryUse::WasmMemoryObservers); fop->delete_(obj, &memory.observers(), MemoryUse::WasmMemoryObservers);
@ -1968,7 +1968,7 @@ bool WasmTableObject::isNewborn() const {
} }
/* static */ /* static */
void WasmTableObject::finalize(FreeOp* fop, JSObject* obj) { void WasmTableObject::finalize(JSFreeOp* fop, JSObject* obj) {
WasmTableObject& tableObj = obj->as<WasmTableObject>(); WasmTableObject& tableObj = obj->as<WasmTableObject>();
if (!tableObj.isNewborn()) { if (!tableObj.isNewborn()) {
auto& table = tableObj.table(); auto& table = tableObj.table();
@ -2369,7 +2369,7 @@ void WasmGlobalObject::trace(JSTracer* trc, JSObject* obj) {
} }
/* static */ /* static */
void WasmGlobalObject::finalize(FreeOp* fop, JSObject* obj) { void WasmGlobalObject::finalize(JSFreeOp* fop, JSObject* obj) {
WasmGlobalObject* global = reinterpret_cast<WasmGlobalObject*>(obj); WasmGlobalObject* global = reinterpret_cast<WasmGlobalObject*>(obj);
if (!global->isNewborn()) { if (!global->isNewborn()) {
fop->delete_(obj, global->cell(), MemoryUse::WasmGlobalCell); fop->delete_(obj, global->cell(), MemoryUse::WasmGlobalCell);
@ -3424,7 +3424,7 @@ class ResolveResponseClosure : public NativeObject {
static const unsigned IMPORT_OBJ_SLOT = 3; static const unsigned IMPORT_OBJ_SLOT = 3;
static const ClassOps classOps_; static const ClassOps classOps_;
static void finalize(FreeOp* fop, JSObject* obj) { static void finalize(JSFreeOp* fop, JSObject* obj) {
auto& closure = obj->as<ResolveResponseClosure>(); auto& closure = obj->as<ResolveResponseClosure>();
fop->release(obj, &closure.compileArgs(), fop->release(obj, &closure.compileArgs(),
MemoryUse::WasmResolveResponseClosure); MemoryUse::WasmResolveResponseClosure);

Просмотреть файл

@ -127,7 +127,7 @@ JSObject* InitWebAssemblyClass(JSContext* cx, Handle<GlobalObject*> global);
class WasmModuleObject : public NativeObject { class WasmModuleObject : public NativeObject {
static const unsigned MODULE_SLOT = 0; static const unsigned MODULE_SLOT = 0;
static const ClassOps classOps_; 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 imports(JSContext* cx, unsigned argc, Value* vp);
static bool exports(JSContext* cx, unsigned argc, Value* vp); static bool exports(JSContext* cx, unsigned argc, Value* vp);
static bool customSections(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 unsigned CELL_SLOT = 2;
static const ClassOps classOps_; static const ClassOps classOps_;
static void finalize(FreeOp*, JSObject* obj); static void finalize(JSFreeOp*, JSObject* obj);
static void trace(JSTracer* trc, JSObject* obj); static void trace(JSTracer* trc, JSObject* obj);
static bool valueGetterImpl(JSContext* cx, const CallArgs& args); 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 exportsGetterImpl(JSContext* cx, const CallArgs& args);
static bool exportsGetter(JSContext* cx, unsigned argc, Value* vp); static bool exportsGetter(JSContext* cx, unsigned argc, Value* vp);
bool isNewborn() const; 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 void trace(JSTracer* trc, JSObject* obj);
// ExportMap maps from function index to exported function object. // 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 BUFFER_SLOT = 0;
static const unsigned OBSERVERS_SLOT = 1; static const unsigned OBSERVERS_SLOT = 1;
static const ClassOps classOps_; 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 bufferGetterImpl(JSContext* cx, const CallArgs& args);
static bool bufferGetter(JSContext* cx, unsigned argc, Value* vp); static bool bufferGetter(JSContext* cx, unsigned argc, Value* vp);
static bool growImpl(JSContext* cx, const CallArgs& args); static bool growImpl(JSContext* cx, const CallArgs& args);
@ -347,7 +347,7 @@ class WasmTableObject : public NativeObject {
static const unsigned TABLE_SLOT = 0; static const unsigned TABLE_SLOT = 0;
static const ClassOps classOps_; static const ClassOps classOps_;
bool isNewborn() const; 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 void trace(JSTracer* trc, JSObject* obj);
static bool lengthGetterImpl(JSContext* cx, const CallArgs& args); static bool lengthGetterImpl(JSContext* cx, const CallArgs& args);
static bool lengthGetter(JSContext* cx, unsigned argc, Value* vp); static bool lengthGetter(JSContext* cx, unsigned argc, Value* vp);

Просмотреть файл

@ -1244,7 +1244,7 @@ class XPCWrappedNativeProto final {
nsIXPCScriptable* GetScriptable() const { return mScriptable; } 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 JSProtoObjectMoved(JSObject* obj, const JSObject* old);
void SystemIsBeingShutDown(); void SystemIsBeingShutDown();