Bug 433529 - Part 8: Fix dtrace builds with new displayAtom(). r=peterv
authorAlex Crichton <acrichton@mozilla.com>
Wed, 22 Aug 2012 23:39:14 -0700
changeset 105186 92ad8d042827fa246e21aecafd64c71bb8b575b0
parent 105185 254a6ae6cf2a4d7f6d7ac487ecdbec0f5cdf1517
child 105187 fca63fc533e2abb2aa003245e8112d76512c5c15
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewerspeterv
bugs433529
milestone17.0a1
Bug 433529 - Part 8: Fix dtrace builds with new displayAtom(). r=peterv
js/src/jsfun.h
js/src/jsprobes.cpp
--- a/js/src/jsfun.h
+++ b/js/src/jsfun.h
@@ -104,19 +104,19 @@ struct JSFunction : public JSObject
         this->flags |= JSFUN_HAS_REST;
     }
 
     void setHasDefaults() {
         JS_ASSERT(!hasDefaults());
         this->flags |= JSFUN_HAS_DEFAULTS;
     }
 
-    JSAtom *atom() { return hasGuessedAtom() ? NULL : atom_.get(); }
+    JSAtom *atom() const { return hasGuessedAtom() ? NULL : atom_.get(); }
     void initAtom(JSAtom *atom) { atom_.init(atom); }
-    JSAtom *displayAtom() { return atom_; }
+    JSAtom *displayAtom() const { return atom_; }
 
     void setGuessedAtom(JSAtom *atom) {
         JS_ASSERT(this->atom_ == NULL);
         JS_ASSERT(atom != NULL);
         JS_ASSERT(!hasGuessedAtom());
         this->atom_ = atom;
         this->flags |= JSFUN_HAS_GUESSED_ATOM;
     }
--- a/js/src/jsprobes.cpp
+++ b/js/src/jsprobes.cpp
@@ -158,19 +158,19 @@ ScriptFilename(const JSScript *script)
     return script->filename;
 }
 
 static const char *
 FunctionName(JSContext *cx, const JSFunction *fun, JSAutoByteString* bytes)
 {
     if (!fun)
         return Probes::nullName;
-    if (!fun->atom)
+    if (!fun->displayAtom())
         return Probes::anonymousName;
-    return bytes->encode(cx, fun->atom) ? bytes->ptr() : Probes::nullName;
+    return bytes->encode(cx, fun->displayAtom()) ? bytes->ptr() : Probes::nullName;
 }
 
 /*
  * These functions call the DTrace macros for the JavaScript USDT probes.
  * Originally this code was inlined in the JavaScript code; however since
  * a number of operations are called, these have been placed into functions
  * to reduce any negative compiler optimization effect that the addition of
  * a number of usually unused lines of code would cause.