mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
[INFER] Only prematurely release script code when calling destroy script hook from GC, bug 679461.
This commit is contained in:
parent
2c18d8ec04
commit
d709374dca
@ -1359,10 +1359,6 @@ js_CallDestroyScriptHook(JSContext *cx, JSScript *script)
|
||||
{
|
||||
JSDestroyScriptHook hook;
|
||||
|
||||
#ifdef JS_METHODJIT
|
||||
mjit::ReleaseScriptCode(cx, script);
|
||||
#endif
|
||||
|
||||
hook = cx->debugHooks->destroyScriptHook;
|
||||
if (hook)
|
||||
hook(cx, script, cx->debugHooks->destroyScriptHookData);
|
||||
@ -1455,6 +1451,12 @@ void
|
||||
js_DestroyScriptFromGC(JSContext *cx, JSScript *script, JSObject *owner)
|
||||
{
|
||||
JS_ASSERT(cx->runtime->gcRunning);
|
||||
|
||||
#ifdef JS_METHODJIT
|
||||
/* Keep the hook from trying to recompile while the GC is running. */
|
||||
mjit::ReleaseScriptCode(cx, script);
|
||||
#endif
|
||||
|
||||
js_CallDestroyScriptHook(cx, script);
|
||||
DestroyScript(cx, script, owner, 100);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user