Bug 737365 - stop using the cx during finalization, part 1.

This part changes the signatures for various finalization API to take
not JSContext* but rather either JSFreeOp structure or its
library-private counterpart FreeOp. These structures wrap parameters
that are passed to the finalizers removing most of explicit dependencies
on JSContext in the finalization code.
This commit is contained in:
Igor Bukanov
2012-03-19 15:34:55 +01:00
parent 054cc031c2
commit c7e7021207
90 changed files with 435 additions and 328 deletions

View File

@@ -335,16 +335,16 @@ WeakMap_mark(JSTracer *trc, JSObject *obj)
}
static void
WeakMap_finalize(JSContext *cx, JSObject *obj)
WeakMap_finalize(FreeOp *fop, JSObject *obj)
{
if (ObjectValueMap *map = GetObjectMap(obj)) {
map->check();
#ifdef DEBUG
map->~ObjectValueMap();
memset(static_cast<void *>(map), 0xdc, sizeof(*map));
cx->free_(map);
fop->free_(map);
#else
cx->delete_(map);
fop->delete_(map);
#endif
}
}