[INFER] Fix merge botches.
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 01 Jul 2011 19:40:53 -0700
changeset 75170 670548b1f7ce841766f524cadbaf51aa408bcec9
parent 75169 0c5ed245a04fca6cbf57507eb42414df49d2e671
child 75171 a24aa7a782bfb4e2da91367e3bd9a1f8cb160623
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone7.0a1
[INFER] Fix merge botches.
js/src/jsinfer.cpp
js/src/jsobj.h
js/src/methodjit/MethodJIT-inl.h
js/src/xpconnect/src/xpcjsruntime.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -152,27 +152,27 @@ static bool InferSpewActive(SpewChannel 
         if (strstr(env, "full")) {
             for (unsigned i = 0; i < SPEW_COUNT; i++)
                 active[i] = true;
         }
     }
     return active[channel];
 }
 
+#ifdef DEBUG
+
 static bool InferSpewColorable()
 {
     /* Only spew colors on xterm-color to not screw up emacs. */
     const char *env = getenv("TERM");
     if (!env)
         return false;
     return strcmp(env, "xterm-color") == 0;
 }
 
-#ifdef DEBUG
-
 const char *
 types::InferSpewColorReset()
 {
     if (!InferSpewColorable())
         return "";
     return "\x1b[0m";
 }
 
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -631,21 +631,24 @@ struct JSObject : js::gc::Cell {
     /* Whether a slot is at a fixed offset from this object. */
     inline bool isFixedSlot(size_t slot);
 
     /* Index into the dynamic slots array to use for a dynamic slot. */
     inline size_t dynamicSlotIndex(size_t slot);
 
     inline size_t numFixedSlots() const;
 
+    /* Whether this object has any dynamic slots at all. */
+    inline bool hasSlotsArray() const;
+
+    /* Get the number of dynamic slots required for a given capacity. */
+    inline size_t numDynamicSlots(size_t capacity) const;
+
   private:
     inline js::Value* fixedSlots() const;
-    inline bool hasSlotsArray() const;
-
-    inline size_t numDynamicSlots(size_t capacity) const;
 
   public:
     /* Minimum size for dynamically allocated slots. */
     static const uint32 SLOT_CAPACITY_MIN = 8;
 
     bool allocSlots(JSContext *cx, size_t nslots);
     bool growSlots(JSContext *cx, size_t nslots);
     void shrinkSlots(JSContext *cx, size_t nslots);
--- a/js/src/methodjit/MethodJIT-inl.h
+++ b/js/src/methodjit/MethodJIT-inl.h
@@ -78,16 +78,19 @@ CanMethodJIT(JSContext *cx, JSScript *sc
     if (status == JITScript_None)
         return TryCompile(cx, fp);
     return Compile_Okay;
 }
 
 static inline bool
 RecursiveMethodJIT(JSContext *cx, StackFrame *fp)
 {
+    if (!cx->compartment->hasJaegerCompartment())
+        return false;
+
     /*
      * We can recursively enter the method JIT on a single stack frame by
      * taking back edges, compiling, getting kicked back into the interpreter
      * and repeating. Watch for this case here, and finish the frame in the
      * interpreter. :XXX: should be more robust.
      */
     static const unsigned RECURSIVE_METHODJIT_LIMIT = 10;
     VMFrame *f = cx->compartment->jaegerCompartment()->activeFrame();
--- a/js/src/xpconnect/src/xpcjsruntime.cpp
+++ b/js/src/xpconnect/src/xpcjsruntime.cpp
@@ -1336,17 +1336,17 @@ struct PRInt64Data {
 #endif
 void
 GetJSObjectSlotsCallback(JSContext *cx, void *v, size_t traceKind, void *thing)
 {
     JS_ASSERT(traceKind == JSTRACE_OBJECT);
     JSObject *obj = (JSObject *)thing;
     if (obj->hasSlotsArray()) {
         PRInt64Data *data = (PRInt64Data *) v;
-        data->n += obj->numSlots() * sizeof(js::Value);
+        data->n += obj->numDynamicSlots(obj->numSlots()) * sizeof(js::Value);
     }
 }
 #ifdef _MSC_VER
 #pragma optimize("", on)
 #endif
 
 static PRInt64
 GetJSObjectSlots(void *dummy)