Bug 843337 - No need for getAllocKind in JSObject::finalize anymore; r=jonco

--HG--
extra : rebase_source : d5fdc33b362d7d486579f1934316e00a746a3d13
This commit is contained in:
Terrence Cole 2013-02-20 14:33:04 -08:00
parent 6541316d0a
commit 32583c75a8

View File

@ -234,19 +234,21 @@ JSObject::finalize(js::FreeOp *fop)
{
js::Probes::finalizeObject(this);
#ifdef DEBUG
if (!IsBackgroundFinalized(getAllocKind())) {
/* Assert we're on the main thread. */
fop->runtime()->assertValidThread();
/*
* Finalize obj first, in case it needs map and slots. Objects with
* finalize hooks are not finalized in the background, as the class is
* stored in the object's shape, which may have already been destroyed.
*/
js::Class *clasp = getClass();
if (clasp->finalize)
clasp->finalize(fop, this);
}
#endif
/*
* Finalize obj first, in case it needs map and slots. Objects with
* finalize hooks are not finalized in the background, as the class is
* stored in the object's shape, which may have already been destroyed.
*/
js::Class *clasp = getClass();
if (clasp->finalize)
clasp->finalize(fop, this);
finish(fop);
}