Bug 1146410: IonMonkey: Make it possible to print typeset information anywhere, r=jandem
authorHannes Verschore <hv1989@gmail.com>
Thu, 26 Mar 2015 12:14:03 +0100
changeset 266131 4c099b1b4e58dec6394e98275689136d07eca00e
parent 266130 c58c75afbd913fc509a9486121764a4f71c94511
child 266132 6e52859a78a7b8c5a1c74c825a1ad96c7c201adc
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1146410
milestone39.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 1146410: IonMonkey: Make it possible to print typeset information anywhere, r=jandem
js/src/vm/TypeInference.cpp
js/src/vm/TypeInference.h
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -636,63 +636,63 @@ ConstraintTypeSet::addType(ExclusiveCont
             constraint = constraint->next;
         }
     } else {
         MOZ_ASSERT(!constraintList);
     }
 }
 
 void
-TypeSet::print()
+TypeSet::print(FILE *fp)
 {
     if (flags & TYPE_FLAG_NON_DATA_PROPERTY)
-        fprintf(stderr, " [non-data]");
+        fprintf(fp, " [non-data]");
 
     if (flags & TYPE_FLAG_NON_WRITABLE_PROPERTY)
-        fprintf(stderr, " [non-writable]");
+        fprintf(fp, " [non-writable]");
 
     if (definiteProperty())
-        fprintf(stderr, " [definite:%d]", definiteSlot());
+        fprintf(fp, " [definite:%d]", definiteSlot());
 
     if (baseFlags() == 0 && !baseObjectCount()) {
-        fprintf(stderr, " missing");
+        fprintf(fp, " missing");
         return;
     }
 
     if (flags & TYPE_FLAG_UNKNOWN)
-        fprintf(stderr, " unknown");
+        fprintf(fp, " unknown");
     if (flags & TYPE_FLAG_ANYOBJECT)
-        fprintf(stderr, " object");
+        fprintf(fp, " object");
 
     if (flags & TYPE_FLAG_UNDEFINED)
-        fprintf(stderr, " void");
+        fprintf(fp, " void");
     if (flags & TYPE_FLAG_NULL)
-        fprintf(stderr, " null");
+        fprintf(fp, " null");
     if (flags & TYPE_FLAG_BOOLEAN)
-        fprintf(stderr, " bool");
+        fprintf(fp, " bool");
     if (flags & TYPE_FLAG_INT32)
-        fprintf(stderr, " int");
+        fprintf(fp, " int");
     if (flags & TYPE_FLAG_DOUBLE)
-        fprintf(stderr, " float");
+        fprintf(fp, " float");
     if (flags & TYPE_FLAG_STRING)
-        fprintf(stderr, " string");
+        fprintf(fp, " string");
     if (flags & TYPE_FLAG_SYMBOL)
-        fprintf(stderr, " symbol");
+        fprintf(fp, " symbol");
     if (flags & TYPE_FLAG_LAZYARGS)
-        fprintf(stderr, " lazyargs");
+        fprintf(fp, " lazyargs");
 
     uint32_t objectCount = baseObjectCount();
     if (objectCount) {
-        fprintf(stderr, " object[%u]", objectCount);
+        fprintf(fp, " object[%u]", objectCount);
 
         unsigned count = getObjectCount();
         for (unsigned i = 0; i < count; i++) {
             ObjectKey *key = getObject(i);
             if (key)
-                fprintf(stderr, " %s", TypeString(ObjectType(key)));
+                fprintf(fp, " %s", TypeString(ObjectType(key)));
         }
     }
 }
 
 /* static */ void
 TypeSet::readBarrier(const TypeSet *types)
 {
     if (types->unknownObject())
--- a/js/src/vm/TypeInference.h
+++ b/js/src/vm/TypeInference.h
@@ -394,17 +394,17 @@ class TypeSet
     ObjectKey **objectSet;
 
   public:
 
     TypeSet()
       : flags(0), objectSet(nullptr)
     {}
 
-    void print();
+    void print(FILE *fp = stderr);
 
     /* Whether this set contains a specific type. */
     inline bool hasType(Type type) const;
 
     TypeFlags baseFlags() const { return flags & TYPE_FLAG_BASE_MASK; }
     bool unknown() const { return !!(flags & TYPE_FLAG_UNKNOWN); }
     bool unknownObject() const { return !!(flags & (TYPE_FLAG_UNKNOWN | TYPE_FLAG_ANYOBJECT)); }
     bool empty() const { return !baseFlags() && !baseObjectCount(); }