Bug 1333000 - Display some additional diagnostic information for ConstraintTypeSet corruption, r=jandem
authorSteve Fink <sfink@mozilla.com>
Wed, 05 Apr 2017 15:56:46 -0700
changeset 409705 8b3ea20f546cf5cb975ab928f99280d8fc92898d
parent 409704 8f03ab34a6051ead9d3b3d3f75c482ffde72ce31
child 409706 5e53d393c722f451c0e8dca642dbb1ace5331f6f
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1333000
milestone55.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 1333000 - Display some additional diagnostic information for ConstraintTypeSet corruption, r=jandem
js/src/vm/TypeInference.cpp
js/src/vm/TypeInference.h
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -2571,16 +2571,24 @@ TypeZone::addPendingRecompile(JSContext*
 
 #ifdef JS_CRASH_DIAGNOSTICS
 void
 js::ReportMagicWordFailure(uintptr_t actual, uintptr_t expected)
 {
     MOZ_CRASH_UNSAFE_PRINTF("Got 0x%" PRIxPTR " expected magic word 0x%" PRIxPTR,
                             actual, expected);
 }
+
+void
+js::ReportMagicWordFailure(uintptr_t actual, uintptr_t expected, uintptr_t flags, uintptr_t objectSet)
+{
+    MOZ_CRASH_UNSAFE_PRINTF("Got 0x%" PRIxPTR " expected magic word 0x%" PRIxPTR
+                            " flags 0x%" PRIxPTR " objectSet 0x%" PRIxPTR,
+                            actual, expected, flags, objectSet);
+}
 #endif
 
 void
 js::PrintTypes(JSContext* cx, JSCompartment* comp, bool force)
 {
 #ifdef DEBUG
     gc::AutoSuppressGC suppressGC(cx);
     JSAutoRequest request(cx);
--- a/js/src/vm/TypeInference.h
+++ b/js/src/vm/TypeInference.h
@@ -539,16 +539,18 @@ static const uintptr_t BaseTypeInference
 static const uintptr_t BaseTypeInferenceMagic = 0xa1a2b3b4c5c6d7d8;
 #endif
 static const uintptr_t TypeConstraintMagic = BaseTypeInferenceMagic + 1;
 static const uintptr_t ConstraintTypeSetMagic = BaseTypeInferenceMagic + 2;
 
 #ifdef JS_CRASH_DIAGNOSTICS
 extern void
 ReportMagicWordFailure(uintptr_t actual, uintptr_t expected);
+extern void
+ReportMagicWordFailure(uintptr_t actual, uintptr_t expected, uintptr_t flags, uintptr_t objectSet);
 #endif
 
 /*
  * A constraint which listens to additions to a type set and propagates those
  * changes to other type sets.
  */
 class TypeConstraint
 {
@@ -669,17 +671,17 @@ class ConstraintTypeSet : public TypeSet
         MOZ_ASSERT(!magic_);
         magic_ = ConstraintTypeSetMagic;
     }
 #endif
 
     void checkMagic() const {
 #ifdef JS_CRASH_DIAGNOSTICS
         if (MOZ_UNLIKELY(magic_ != ConstraintTypeSetMagic))
-            ReportMagicWordFailure(magic_, ConstraintTypeSetMagic);
+            ReportMagicWordFailure(magic_, ConstraintTypeSetMagic, uintptr_t(flags), uintptr_t(objectSet));
 #endif
     }
 
     TypeConstraint* constraintList() const {
         checkMagic();
         if (constraintList_)
             constraintList_->checkMagic();
         return constraintList_;