Bug 1258436 - Remove GC suppression in JSFunction::createScriptForLazilyInterpretedFunction. r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 23 Mar 2016 02:30:00 -0400
changeset 290427 f66ab359f3ef5f651e85ff1194366a27b54d3120
parent 290426 cdcc256acea1290e9b68ef8eb9f65ce3901adf76
child 290428 a9fbf93943403ffeb24d6e67ea15859b7ed7aeb5
push id30120
push userryanvm@gmail.com
push dateSat, 26 Mar 2016 02:08:36 +0000
treeherdermozilla-central@8a4359ad909f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1258436
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1258436 - Remove GC suppression in JSFunction::createScriptForLazilyInterpretedFunction. r=sfink
js/src/devtools/rootAnalysis/annotations.js
js/src/jsfun.cpp
js/src/jsscriptinlines.h
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -71,16 +71,17 @@ var ignoreCallees = {
     "js::Class.trace" : true,
     "js::Class.finalize" : true,
     "JSRuntime.destroyPrincipals" : true,
     "icu_50::UObject.__deleting_dtor" : true, // destructors in ICU code can't cause GC
     "mozilla::CycleCollectedJSRuntime.DescribeCustomObjects" : true, // During tracing, cannot GC.
     "mozilla::CycleCollectedJSRuntime.NoteCustomGCThingXPCOMChildren" : true, // During tracing, cannot GC.
     "PLDHashTableOps.hashKey" : true,
     "z_stream_s.zfree" : true,
+    "z_stream_s.zalloc" : true,
     "GrGLInterface.fCallback" : true,
     "std::strstreambuf._M_alloc_fun" : true,
     "std::strstreambuf._M_free_fun" : true,
     "struct js::gc::Callback<void (*)(JSRuntime*, void*)>.op" : true,
 };
 
 function fieldCallCannotGC(csu, fullfield)
 {
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -1345,21 +1345,16 @@ JSFunction::createScriptForLazilyInterpr
     MOZ_ASSERT(fun->isInterpretedLazy());
 
     Rooted<LazyScript*> lazy(cx, fun->lazyScriptOrNull());
     if (lazy) {
         // Trigger a pre barrier on the lazy script being overwritten.
         if (cx->zone()->needsIncrementalBarrier())
             LazyScript::writeBarrierPre(lazy);
 
-        // Suppress GC for now although we should be able to remove this by
-        // making 'lazy' a Rooted<LazyScript*> (which requires adding a
-        // THING_ROOT_LAZY_SCRIPT).
-        AutoSuppressGC suppressGC(cx);
-
         RootedScript script(cx, lazy->maybeScript());
 
         // Only functions without inner functions or direct eval are
         // re-lazified. Functions with either of those are on the static scope
         // chain of their inner functions, or in the case of eval, possibly
         // eval'd inner functions. This prohibits re-lazification as
         // StaticScopeIter queries needsCallObject of those functions, which
         // requires a non-lazy script.  Note that if this ever changes,
--- a/js/src/jsscriptinlines.h
+++ b/js/src/jsscriptinlines.h
@@ -82,19 +82,20 @@ ScriptAndCounts::ScriptAndCounts(ScriptA
 
 void
 SetFrameArgumentsObject(JSContext* cx, AbstractFramePtr frame,
                         HandleScript script, JSObject* argsobj);
 
 inline JSFunction*
 LazyScript::functionDelazifying(JSContext* cx) const
 {
-    if (function_ && !function_->getOrCreateScript(cx))
+    Rooted<const LazyScript*> self(cx, this);
+    if (self->function_ && !self->function_->getOrCreateScript(cx))
         return nullptr;
-    return function_;
+    return self->function_;
 }
 
 } // namespace js
 
 inline JSFunction*
 JSScript::functionDelazifying() const
 {
     if (function_ && function_->isInterpretedLazy()) {