Skip to content

Commit 44aafcc

Browse files
author
Oana Pop Rus
committed
Backed out 4 changesets (bug 1572782) for build bustages at build/src/obj-firefox/dist/include/nsIXPCScriptable.h on a CLOSED TREE
Backed out changeset ec9d15c69bc8 (bug 1572782) Backed out changeset 8239e4baa0f4 (bug 1572782) Backed out changeset 9fd7bea2b512 (bug 1572782) Backed out changeset 11d750555fe1 (bug 1572782)
1 parent fa84e34 commit 44aafcc

File tree

113 files changed

+415
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+415
-384
lines changed

dom/bindings/Codegen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,7 @@ def finalizeHook(descriptor, hookName, freeOp, obj):
17641764
if descriptor.wrapperCache:
17651765
finalize += "ClearWrapper(self, self, %s);\n" % obj
17661766
if descriptor.isGlobal():
1767-
finalize += "mozilla::dom::FinalizeGlobal(%s, %s);\n" % (freeOp, obj)
1767+
finalize += "mozilla::dom::FinalizeGlobal(CastToJSFreeOp(%s), %s);\n" % (freeOp, obj)
17681768
finalize += fill(
17691769
"""
17701770
if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
@@ -1783,7 +1783,7 @@ class CGClassFinalizeHook(CGAbstractClassHook):
17831783
A hook for finalize, used to release our native object.
17841784
"""
17851785
def __init__(self, descriptor):
1786-
args = [Argument('JSFreeOp*', 'fop'), Argument('JSObject*', 'obj')]
1786+
args = [Argument('js::FreeOp*', 'fop'), Argument('JSObject*', 'obj')]
17871787
CGAbstractClassHook.__init__(self, descriptor, FINALIZE_HOOK_NAME,
17881788
'void', args)
17891789

dom/bindings/SimpleGlobalObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SimpleGlobalObject)
4141
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
4242
NS_INTERFACE_MAP_END
4343

44-
static void SimpleGlobal_finalize(JSFreeOp* fop, JSObject* obj) {
44+
static void SimpleGlobal_finalize(js::FreeOp* fop, JSObject* obj) {
4545
SimpleGlobalObject* globalObject =
4646
static_cast<SimpleGlobalObject*>(JS_GetPrivate(obj));
4747
if (globalObject) {

js/public/Class.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@
2525
*/
2626

2727
struct JSAtomState;
28+
struct JSFreeOp;
2829
struct JSFunctionSpec;
2930

3031
namespace js {
3132

3233
struct Class;
34+
class FreeOp;
3335
class Shape;
3436

3537
// This is equal to JSFunction::class_. Use it in places where you don't want
@@ -573,7 +575,7 @@ typedef bool (*GetElementsOp)(JSContext* cx, JS::HandleObject obj,
573575
uint32_t begin, uint32_t end,
574576
ElementAdder* adder);
575577

576-
typedef void (*FinalizeOp)(JSFreeOp* fop, JSObject* obj);
578+
typedef void (*FinalizeOp)(FreeOp* fop, JSObject* obj);
577579

578580
// The special treatment of |finalize| and |trace| is necessary because if we
579581
// assign either of those hooks to a local variable and then call it -- as is
@@ -867,7 +869,7 @@ static const uint32_t JSCLASS_CACHED_PROTO_MASK =
867869
namespace js {
868870

869871
struct MOZ_STATIC_CLASS Class {
870-
JS_CLASS_MEMBERS(js::ClassOps, JSFreeOp);
872+
JS_CLASS_MEMBERS(js::ClassOps, FreeOp);
871873
const ClassSpec* spec;
872874
const ClassExtension* ext;
873875
const ObjectOps* oOps;

js/public/GCAPI.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "js/UniquePtr.h"
2020
#include "js/Utility.h"
2121

22+
struct JSFreeOp;
23+
2224
#ifdef JS_BROKEN_GCC_ATTRIBUTE_WARNING
2325
# pragma GCC diagnostic push
2426
# pragma GCC diagnostic ignored "-Wattributes"

js/public/MemoryFunctions.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,22 @@
1616
#include "jstypes.h" // JS_PUBLIC_API
1717

1818
struct JSContext;
19-
class JSFreeOp;
2019
class JSObject;
2120
struct JSRuntime;
2221

22+
struct JSFreeOp {
23+
protected:
24+
JSRuntime* runtime_;
25+
26+
explicit JSFreeOp(JSRuntime* rt) : runtime_(rt) {}
27+
28+
public:
29+
JSRuntime* runtime() const {
30+
MOZ_ASSERT(runtime_);
31+
return runtime_;
32+
}
33+
};
34+
2335
extern JS_PUBLIC_API void* JS_malloc(JSContext* cx, size_t nbytes);
2436

2537
extern JS_PUBLIC_API void* JS_realloc(JSContext* cx, void* p, size_t oldBytes,

js/public/TypeDecls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ typedef uint8_t jsbytecode;
2727
class JSAtom;
2828
struct JSContext;
2929
class JSFunction;
30-
class JSFreeOp;
3130
class JSObject;
3231
struct JSRuntime;
3332
class JSScript;
3433
class JSString;
34+
struct JSFreeOp;
3535

3636
namespace js {
3737
class TempAllocPolicy;

js/public/Utility.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ static inline void js_free(void* p) {
488488
* - Ordinarily, use js_free/js_delete.
489489
*
490490
* - For deallocations during GC finalization, use one of the following
491-
* operations on the JSFreeOp provided to the finalizer:
491+
* operations on the FreeOp provided to the finalizer:
492492
*
493-
* JSFreeOp::{free_,delete_}
493+
* FreeOp::{free_,delete_}
494494
*/
495495

496496
/*

js/src/builtin/MapObject.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ MapIteratorObject* MapIteratorObject::create(JSContext* cx, HandleObject obj,
251251
return iterobj;
252252
}
253253

254-
void MapIteratorObject::finalize(JSFreeOp* fop, JSObject* obj) {
254+
void MapIteratorObject::finalize(FreeOp* fop, JSObject* obj) {
255255
MOZ_ASSERT(fop->onMainThread());
256256
MOZ_ASSERT(!IsInsideNursery(obj));
257257

@@ -620,15 +620,15 @@ MapObject* MapObject::create(JSContext* cx,
620620
return mapObj;
621621
}
622622

623-
void MapObject::finalize(JSFreeOp* fop, JSObject* obj) {
623+
void MapObject::finalize(FreeOp* fop, JSObject* obj) {
624624
MOZ_ASSERT(fop->onMainThread());
625625
if (ValueMap* map = obj->as<MapObject>().getData()) {
626626
fop->delete_(obj, map, MemoryUse::MapObjectTable);
627627
}
628628
}
629629

630630
/* static */
631-
void MapObject::sweepAfterMinorGC(JSFreeOp* fop, MapObject* mapobj) {
631+
void MapObject::sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj) {
632632
bool wasInsideNursery = IsInsideNursery(mapobj);
633633
if (wasInsideNursery && !IsForwarded(mapobj)) {
634634
finalize(fop, mapobj);
@@ -1023,7 +1023,7 @@ SetIteratorObject* SetIteratorObject::create(JSContext* cx, HandleObject obj,
10231023
return iterobj;
10241024
}
10251025

1026-
void SetIteratorObject::finalize(JSFreeOp* fop, JSObject* obj) {
1026+
void SetIteratorObject::finalize(FreeOp* fop, JSObject* obj) {
10271027
MOZ_ASSERT(fop->onMainThread());
10281028
MOZ_ASSERT(!IsInsideNursery(obj));
10291029

@@ -1244,7 +1244,7 @@ void SetObject::trace(JSTracer* trc, JSObject* obj) {
12441244
}
12451245
}
12461246

1247-
void SetObject::finalize(JSFreeOp* fop, JSObject* obj) {
1247+
void SetObject::finalize(FreeOp* fop, JSObject* obj) {
12481248
MOZ_ASSERT(fop->onMainThread());
12491249
SetObject* setobj = static_cast<SetObject*>(obj);
12501250
if (ValueSet* set = setobj->getData()) {
@@ -1253,7 +1253,7 @@ void SetObject::finalize(JSFreeOp* fop, JSObject* obj) {
12531253
}
12541254

12551255
/* static */
1256-
void SetObject::sweepAfterMinorGC(JSFreeOp* fop, SetObject* setobj) {
1256+
void SetObject::sweepAfterMinorGC(FreeOp* fop, SetObject* setobj) {
12571257
bool wasInsideNursery = IsInsideNursery(setobj);
12581258
if (wasInsideNursery && !IsForwarded(setobj)) {
12591259
finalize(fop, setobj);

js/src/builtin/MapObject.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class MapObject : public NativeObject {
139139
OrderedHashMap<Value, Value, UnbarrieredHashPolicy, ZoneAllocPolicy>;
140140
friend class OrderedHashTableRef<MapObject>;
141141

142-
static void sweepAfterMinorGC(JSFreeOp* fop, MapObject* mapobj);
142+
static void sweepAfterMinorGC(FreeOp* fop, MapObject* mapobj);
143143

144144
private:
145145
static const ClassSpec classSpec_;
@@ -152,7 +152,7 @@ class MapObject : public NativeObject {
152152
static ValueMap& extract(HandleObject o);
153153
static ValueMap& extract(const CallArgs& args);
154154
static void trace(JSTracer* trc, JSObject* obj);
155-
static void finalize(JSFreeOp* fop, JSObject* obj);
155+
static void finalize(FreeOp* fop, JSObject* obj);
156156
static MOZ_MUST_USE bool construct(JSContext* cx, unsigned argc, Value* vp);
157157

158158
static bool is(HandleValue v);
@@ -198,7 +198,7 @@ class MapIteratorObject : public NativeObject {
198198
static MapIteratorObject* create(JSContext* cx, HandleObject mapobj,
199199
ValueMap* data,
200200
MapObject::IteratorKind kind);
201-
static void finalize(JSFreeOp* fop, JSObject* obj);
201+
static void finalize(FreeOp* fop, JSObject* obj);
202202
static size_t objectMoved(JSObject* obj, JSObject* old);
203203

204204
static MOZ_MUST_USE bool next(Handle<MapIteratorObject*> mapIterator,
@@ -253,7 +253,7 @@ class SetObject : public NativeObject {
253253
OrderedHashSet<Value, UnbarrieredHashPolicy, ZoneAllocPolicy>;
254254
friend class OrderedHashTableRef<SetObject>;
255255

256-
static void sweepAfterMinorGC(JSFreeOp* fop, SetObject* setobj);
256+
static void sweepAfterMinorGC(FreeOp* fop, SetObject* setobj);
257257

258258
private:
259259
static const ClassSpec classSpec_;
@@ -267,7 +267,7 @@ class SetObject : public NativeObject {
267267
static ValueSet& extract(HandleObject o);
268268
static ValueSet& extract(const CallArgs& args);
269269
static void trace(JSTracer* trc, JSObject* obj);
270-
static void finalize(JSFreeOp* fop, JSObject* obj);
270+
static void finalize(FreeOp* fop, JSObject* obj);
271271
static bool construct(JSContext* cx, unsigned argc, Value* vp);
272272

273273
static bool is(HandleValue v);
@@ -311,7 +311,7 @@ class SetIteratorObject : public NativeObject {
311311
static SetIteratorObject* create(JSContext* cx, HandleObject setobj,
312312
ValueSet* data,
313313
SetObject::IteratorKind kind);
314-
static void finalize(JSFreeOp* fop, JSObject* obj);
314+
static void finalize(FreeOp* fop, JSObject* obj);
315315
static size_t objectMoved(JSObject* obj, JSObject* old);
316316

317317
static MOZ_MUST_USE bool next(Handle<SetIteratorObject*> setIterator,

js/src/builtin/ModuleObject.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,9 @@ void ModuleNamespaceObject::ProxyHandler::trace(JSTracer* trc,
679679
}
680680
}
681681

682-
void ModuleNamespaceObject::ProxyHandler::finalize(JSFreeOp* fop,
682+
void ModuleNamespaceObject::ProxyHandler::finalize(JSFreeOp* fopArg,
683683
JSObject* proxy) const {
684+
FreeOp* fop = FreeOp::get(fopArg);
684685
auto& self = proxy->as<ModuleNamespaceObject>();
685686

686687
if (self.hasBindings()) {
@@ -771,7 +772,7 @@ ModuleObject* ModuleObject::create(JSContext* cx) {
771772
}
772773

773774
/* static */
774-
void ModuleObject::finalize(JSFreeOp* fop, JSObject* obj) {
775+
void ModuleObject::finalize(js::FreeOp* fop, JSObject* obj) {
775776
MOZ_ASSERT(fop->maybeOnHelperThread());
776777
ModuleObject* self = &obj->as<ModuleObject>();
777778
if (self->hasImportBindings()) {

0 commit comments

Comments
 (0)