mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 06:15:43 +00:00
Bug 852789 - clear the runtime's self-hosting global on destruction of last context. r=sstangl
--HG-- extra : rebase_source : 719762b9e0647a94b3b31dafefb802952d109725
This commit is contained in:
parent
6f7abe6530
commit
4d056bc6e4
@ -420,6 +420,8 @@ js::DestroyContext(JSContext *cx, DestroyContextMode mode)
|
||||
/* Clear the statics table to remove GC roots. */
|
||||
rt->staticStrings.finish();
|
||||
|
||||
rt->finishSelfHosting();
|
||||
|
||||
JS::PrepareForFullGC(rt);
|
||||
GC(rt, GC_NORMAL, JS::gcreason::LAST_CONTEXT);
|
||||
} else if (mode == DCM_FORCE_GC) {
|
||||
|
@ -753,6 +753,7 @@ struct JSRuntime : js::RuntimeFriendFields,
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
bool initSelfHosting(JSContext *cx);
|
||||
void finishSelfHosting();
|
||||
void markSelfHostingGlobal(JSTracer *trc);
|
||||
bool isSelfHostingGlobal(js::HandleObject global) {
|
||||
return global == selfHostingGlobal_;
|
||||
|
@ -540,6 +540,12 @@ JSRuntime::initSelfHosting(JSContext *cx)
|
||||
return ok;
|
||||
}
|
||||
|
||||
void
|
||||
JSRuntime::finishSelfHosting()
|
||||
{
|
||||
selfHostingGlobal_ = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
JSRuntime::markSelfHostingGlobal(JSTracer *trc)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user