bug 684010 - remove JSScrit::isAboutToBeFinalized. r=bhackett1024
authorIgor Bukanov <igor@mir2.org>
Thu, 01 Sep 2011 21:47:07 +0200
changeset 76465 30ffa45f9a63c5e770691bc26c66494c74009773
parent 76444 12b7c9789d63a96cf9595be8d9872e0598779efb
child 76466 60df75bc14281f6f474db428155e3bcc6adc7441
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersbhackett1024
bugs684010
milestone9.0a1
bug 684010 - remove JSScrit::isAboutToBeFinalized. r=bhackett1024
js/src/jsinfer.cpp
js/src/jsinferinlines.h
js/src/jsscript.h
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -5475,17 +5475,17 @@ TypeCompartment::sweep(JSContext *cx)
         }
     }
 
     if (allocationSiteTable) {
         for (AllocationSiteTable::Enum e(*allocationSiteTable); !e.empty(); e.popFront()) {
             const AllocationSiteKey &key = e.front().key;
             TypeObject *object = e.front().value;
 
-            if (key.script->isAboutToBeFinalized(cx) || !object->isMarked())
+            if (IsAboutToBeFinalized(cx, key.script) || !object->isMarked())
                 e.removeFront();
         }
     }
 
     /*
      * The pending array is reset on GC, it can grow large (75+ KB) and is easy
      * to reallocate if the compartment becomes active again.
      */
@@ -5515,17 +5515,17 @@ TypeCompartment::~TypeCompartment()
 TypeScript::Sweep(JSContext *cx, JSScript *script)
 {
     JSCompartment *compartment = script->compartment();
     JS_ASSERT(compartment->types.inferenceEnabled);
 
     unsigned num = NumTypeSets(script);
     TypeSet *typeArray = script->types->typeArray();
 
-    if (script->isAboutToBeFinalized(cx)) {
+    if (IsAboutToBeFinalized(cx, script)) {
         /* Release all memory associated with the persistent type sets. */
         for (unsigned i = 0; i < num; i++)
             typeArray[i].clearObjects();
     } else {
         /* Remove constraints and references to dead objects from the persistent type sets. */
         for (unsigned i = 0; i < num; i++)
             typeArray[i].sweep(cx, compartment);
     }
--- a/js/src/jsinferinlines.h
+++ b/js/src/jsinferinlines.h
@@ -1214,24 +1214,16 @@ TypeObject::setFlagsFromKey(JSContext *c
 
     if (!hasAllFlags(flags))
         setFlags(cx, flags);
 }
 
 } } /* namespace js::types */
 
 inline bool
-JSScript::isAboutToBeFinalized(JSContext *cx)
-{
-    return isCachedEval ||
-        (u.object && IsAboutToBeFinalized(cx, u.object)) ||
-        (hasFunction && IsAboutToBeFinalized(cx, function()));
-}
-
-inline bool
 JSScript::ensureHasTypes(JSContext *cx)
 {
     return types || makeTypes(cx);
 }
 
 inline bool
 JSScript::ensureRanBytecode(JSContext *cx)
 {
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -624,18 +624,16 @@ struct JSScript : public js::gc::Cell {
     inline bool ensureHasTypes(JSContext *cx);
     inline bool ensureRanBytecode(JSContext *cx);
     inline bool ensureRanInference(JSContext *cx);
 
     /* Filled in by one of the above. */
     inline bool hasAnalysis();
     inline js::analyze::ScriptAnalysis *analysis();
 
-    inline bool isAboutToBeFinalized(JSContext *cx);
-
   private:
     bool makeTypes(JSContext *cx);
     bool makeAnalysis(JSContext *cx);
   public:
 
 #ifdef JS_METHODJIT
     // Fast-cached pointers to make calls faster. These are also used to
     // quickly test whether there is JIT code; a NULL value means no