Bug 1384544 - Improve atom marking assertions for JSFunction's atom r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 14 Sep 2017 09:54:54 +0100
changeset 430431 971c6a19e3b5d60a4e40f60453e726ec28f92b64
parent 430430 21edf7e4f6adee7c85cef2e5827bc5431a62d7e6
child 430432 6777be860609e4149d9ffa73b8dc6f1beadfbd5d
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1384544
milestone57.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 1384544 - Improve atom marking assertions for JSFunction's atom r=sfink
js/src/jsfun.h
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -349,49 +349,47 @@ class JSFunction : public js::NativeObje
         return atom_;
     }
 
     void setCompileTimeName(JSAtom* atom) {
         MOZ_ASSERT(!atom_);
         MOZ_ASSERT(atom);
         MOZ_ASSERT(!hasGuessedAtom());
         MOZ_ASSERT(!isClassConstructor());
-        MOZ_ASSERT(js::AtomIsMarked(zone(), atom));
-        atom_ = atom;
+        setAtom(atom);
         flags_ |= HAS_COMPILE_TIME_NAME;
     }
     JSAtom* compileTimeName() const {
         MOZ_ASSERT(hasCompileTimeName());
         MOZ_ASSERT(atom_);
         return atom_;
     }
 
     void setGuessedAtom(JSAtom* atom) {
         MOZ_ASSERT(!atom_);
         MOZ_ASSERT(atom);
         MOZ_ASSERT(!hasCompileTimeName());
         MOZ_ASSERT(!hasGuessedAtom());
         MOZ_ASSERT(!isBoundFunction());
-        MOZ_ASSERT(js::AtomIsMarked(zone(), atom));
-        atom_ = atom;
+        setAtom(atom);
         flags_ |= HAS_GUESSED_ATOM;
     }
     void clearGuessedAtom() {
         MOZ_ASSERT(hasGuessedAtom());
         MOZ_ASSERT(!isBoundFunction());
         MOZ_ASSERT(atom_);
-        atom_ = nullptr;
+        setAtom(nullptr);
         flags_ &= ~HAS_GUESSED_ATOM;
     }
 
     void setPrefixedBoundFunctionName(JSAtom* atom) {
         MOZ_ASSERT(!hasBoundFunctionNamePrefix());
         MOZ_ASSERT(atom);
         flags_ |= HAS_BOUND_FUNCTION_NAME_PREFIX;
-        atom_ = atom;
+        setAtom(atom);
     }
 
     /* uint16_t representation bounds number of call object dynamic slots. */
     enum { MAX_ARGS_AND_VARS = 2 * ((1U << 16) - 1) };
 
     /*
      * For an interpreted function, accessors for the initial scope object of
      * activations (stack frames) of the function.