Bug 1291776 - Assert that we don't create gray arguments; r=sfink
authorTerrence Cole <terrence@mozilla.com>
Thu, 15 Sep 2016 13:50:03 -0700
changeset 314544 79b5d47038f91317a141be04f51f0c8518d18bdf
parent 314543 33d031e3454e1bdd1bb94ada0b918c48d7935067
child 314545 a6975f404e1d6837a6094b025486911147672f3a
push id81923
push usertcole@mozilla.com
push dateTue, 20 Sep 2016 20:13:24 +0000
treeherdermozilla-inbound@79b5d47038f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1291776
milestone52.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 1291776 - Assert that we don't create gray arguments; r=sfink
js/public/CallArgs.h
--- a/js/public/CallArgs.h
+++ b/js/public/CallArgs.h
@@ -283,16 +283,20 @@ class MOZ_STACK_CLASS CallArgs : public 
     friend CallArgs CallArgsFromSp(unsigned stackSlots, Value* sp, bool constructing);
 
     static CallArgs create(unsigned argc, Value* argv, bool constructing) {
         CallArgs args;
         args.clearUsedRval();
         args.argv_ = argv;
         args.argc_ = argc;
         args.constructing_ = constructing;
+#ifdef DEBUG
+        for (unsigned i = 0; i < argc; ++i)
+            MOZ_ASSERT_IF(argv[i].isMarkable(), !GCThingIsMarkedGray(GCCellPtr(argv[i])));
+#endif
         return args;
     }
 
   public:
     /*
      * Returns true if there are at least |required| arguments passed in. If
      * false, it reports an error message on the context.
      */