Bug 687683: Remove unnecessary 'js::' namespace prefixes from Debugger code. r=jorendorff
authorJim Blandy <jimb@mozilla.com>
Tue, 06 Dec 2011 11:40:27 -0800
changeset 82878 6a2bb05dd97ea248d19b1e657d656cdd5fbd3104
parent 82877 39b7b2f8e840740dc540040814b16ee29638e01d
child 82879 9aca452cf4519114e31f6917a37050366e5a3d57
push idunknown
push userunknown
push dateunknown
reviewersjorendorff
bugs687683
milestone11.0a1
Bug 687683: Remove unnecessary 'js::' namespace prefixes from Debugger code. r=jorendorff
js/src/vm/Debugger.cpp
js/src/vm/Debugger.h
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -159,17 +159,17 @@ BreakpointSite::recompile(JSContext *cx,
 #ifdef JS_METHODJIT
     if (script->hasJITCode()) {
         Maybe<AutoCompartment> ac;
         if (!forTrap) {
             ac.construct(cx, ScriptGlobal(cx, script, scriptGlobal));
             if (!ac.ref().enter())
                 return false;
         }
-        js::mjit::Recompiler recompiler(cx, script);
+        mjit::Recompiler recompiler(cx, script);
         recompiler.recompile();
     }
 #endif
     return true;
 }
 
 bool
 BreakpointSite::inc(JSContext *cx)
@@ -751,17 +751,17 @@ Debugger::fireNewScript(JSContext *cx, J
     Value argv[1];
     argv[0].setObject(*dsobj);
     Value rv;
     if (!Invoke(cx, ObjectValue(*object), ObjectValue(*hook), 1, argv, &rv))
         handleUncaughtException(ac, NULL, true);
 }
 
 JSTrapStatus
-Debugger::dispatchHook(JSContext *cx, js::Value *vp, Hook which)
+Debugger::dispatchHook(JSContext *cx, Value *vp, Hook which)
 {
     JS_ASSERT(which == OnDebuggerStatement || which == OnExceptionUnwind);
 
     /*
      * Determine which debuggers will receive this event, and in what order.
      * Make a copy of the list, since the original is mutable and we will be
      * calling into arbitrary JS.
      *
@@ -1016,26 +1016,26 @@ Debugger::markKeysInCompartment(JSTracer
      * make a base-class reference. Range is public in HashMap.
      */
     typedef HashMap<HeapPtrObject, HeapPtrObject, DefaultHasher<HeapPtrObject>, RuntimeAllocPolicy>
         ObjectMap;
     const ObjectMap &objStorage = objects;
     for (ObjectMap::Range r = objStorage.all(); !r.empty(); r.popFront()) {
         const HeapPtrObject &key = r.front().key;
         if (key->compartment() == comp && IsAboutToBeFinalized(tracer->context, key))
-            js::gc::MarkObject(tracer, key, "cross-compartment WeakMap key");
+            gc::MarkObject(tracer, key, "cross-compartment WeakMap key");
     }
 
     typedef HashMap<HeapPtrScript, HeapPtrObject, DefaultHasher<HeapPtrScript>, RuntimeAllocPolicy>
         ScriptMap;
     const ScriptMap &scriptStorage = scripts;
     for (ScriptMap::Range r = scriptStorage.all(); !r.empty(); r.popFront()) {
         const HeapPtrScript &key = r.front().key;
         if (key->compartment() == comp && IsAboutToBeFinalized(tracer->context, key))
-            js::gc::MarkScript(tracer, key, "cross-compartment WeakMap key");
+            gc::MarkScript(tracer, key, "cross-compartment WeakMap key");
     }
 }
 
 /*
  * Ordinarily, WeakMap keys and values are marked because at some point it was
  * discovered that the WeakMap was live; that is, some object containing the
  * WeakMap was marked during mark phase.
  *
@@ -1712,23 +1712,23 @@ Debugger::removeDebuggeeGlobal(JSContext
     JS_ASSERT_IF(compartmentEnum, compartmentEnum->front() == global);
     JS_ASSERT(debuggees.has(global));
     JS_ASSERT_IF(debugEnum, debugEnum->front() == global);
 
     /*
      * FIXME Debugger::slowPathOnLeaveFrame needs to kill all Debugger.Frame
      * objects referring to a particular js::StackFrame. This is hard if
      * Debugger objects that are no longer debugging the relevant global might
-     * have live Frame objects. So we take the easy way out and kill them
-     * here. This is a bug, since it's observable and contrary to the spec. One
+     * have live Frame objects. So we take the easy way out and kill them here.
+     * This is a bug, since it's observable and contrary to the spec. One
      * possible fix would be to put such objects into a compartment-wide bag
      * which slowPathOnLeaveFrame would have to examine.
      */
     for (FrameMap::Enum e(frames); !e.empty(); e.popFront()) {
-        js::StackFrame *fp = e.front().key;
+        StackFrame *fp = e.front().key;
         if (fp->scopeChain().getGlobal() == global) {
             e.front().value->setPrivate(NULL);
             e.removeFront();
         }
     }
 
     GlobalObject::DebuggerVector *v = global->getDebuggers();
     Debugger **p;
--- a/js/src/vm/Debugger.h
+++ b/js/src/vm/Debugger.h
@@ -52,17 +52,17 @@
 
 #include "gc/Barrier.h"
 #include "js/HashTable.h"
 #include "vm/GlobalObject.h"
 
 namespace js {
 
 class Debugger {
-    friend class js::Breakpoint;
+    friend class Breakpoint;
     friend JSBool (::JS_DefineDebuggerObject)(JSContext *cx, JSObject *obj);
 
   public:
     enum Hook {
         OnDebuggerStatement,
         OnExceptionUnwind,
         OnNewScript,
         OnEnterFrame,
@@ -198,17 +198,17 @@ class Debugger {
 
     JSObject *getHook(Hook hook) const;
     bool hasAnyLiveHooks(JSContext *cx) const;
 
     static void slowPathOnEnterFrame(JSContext *cx);
     static void slowPathOnLeaveFrame(JSContext *cx);
     static void slowPathOnNewScript(JSContext *cx, JSScript *script,
                                     GlobalObject *compileAndGoGlobal);
-    static JSTrapStatus dispatchHook(JSContext *cx, js::Value *vp, Hook which);
+    static JSTrapStatus dispatchHook(JSContext *cx, Value *vp, Hook which);
 
     JSTrapStatus fireDebuggerStatement(JSContext *cx, Value *vp);
     JSTrapStatus fireExceptionUnwind(JSContext *cx, Value *vp);
     void fireEnterFrame(JSContext *cx);
 
     /*
      * Allocate and initialize a Debugger.Script instance whose referent is
      * |script|.
@@ -253,18 +253,18 @@ class Debugger {
     static void markCrossCompartmentDebuggerObjectReferents(JSTracer *tracer);
     static bool markAllIteratively(GCMarker *trc);
     static void sweepAll(JSContext *cx);
     static void detachAllDebuggersFromGlobal(JSContext *cx, GlobalObject *global,
                                              GlobalObjectSet::Enum *compartmentEnum);
 
     static inline void onEnterFrame(JSContext *cx);
     static inline void onLeaveFrame(JSContext *cx);
-    static inline JSTrapStatus onDebuggerStatement(JSContext *cx, js::Value *vp);
-    static inline JSTrapStatus onExceptionUnwind(JSContext *cx, js::Value *vp);
+    static inline JSTrapStatus onDebuggerStatement(JSContext *cx, Value *vp);
+    static inline JSTrapStatus onExceptionUnwind(JSContext *cx, Value *vp);
     static inline void onNewScript(JSContext *cx, JSScript *script,
                                    GlobalObject *compileAndGoGlobal);
     static JSTrapStatus onTrap(JSContext *cx, Value *vp);
     static JSTrapStatus onSingleStep(JSContext *cx, Value *vp);
 
     /************************************* Functions for use by Debugger.cpp. */
 
     inline bool observesEnterFrame() const;
@@ -338,19 +338,19 @@ class Debugger {
 
   private:
     /* Prohibit copying. */
     Debugger(const Debugger &);
     Debugger & operator=(const Debugger &);
 };
 
 class BreakpointSite {
-    friend class js::Breakpoint;
+    friend class Breakpoint;
     friend struct ::JSCompartment;
-    friend class js::Debugger;
+    friend class Debugger;
 
   public:
     JSScript * const script;
     jsbytecode * const pc;
     const JSOp realOpcode;
 
   private:
     /*
@@ -397,17 +397,17 @@ class BreakpointSite {
  *
  * Nothing else causes a breakpoint to be retained, so if its script or
  * debugger is collected, the breakpoint is destroyed during GC sweep phase,
  * even if the debugger compartment isn't being GC'd. This is implemented in
  * JSCompartment::sweepBreakpoints.
  */
 class Breakpoint {
     friend struct ::JSCompartment;
-    friend class js::Debugger;
+    friend class Debugger;
 
   public:
     Debugger * const debugger;
     BreakpointSite * const site;
   private:
     js::HeapPtrObject handler;
     JSCList debuggerLinks;
     JSCList siteLinks;
@@ -485,25 +485,25 @@ Debugger::onEnterFrame(JSContext *cx)
 void
 Debugger::onLeaveFrame(JSContext *cx)
 {
     if (!cx->compartment->getDebuggees().empty() || !cx->compartment->breakpointSites.empty())
         slowPathOnLeaveFrame(cx);
 }
 
 JSTrapStatus
-Debugger::onDebuggerStatement(JSContext *cx, js::Value *vp)
+Debugger::onDebuggerStatement(JSContext *cx, Value *vp)
 {
     return cx->compartment->getDebuggees().empty()
            ? JSTRAP_CONTINUE
            : dispatchHook(cx, vp, OnDebuggerStatement);
 }
 
 JSTrapStatus
-Debugger::onExceptionUnwind(JSContext *cx, js::Value *vp)
+Debugger::onExceptionUnwind(JSContext *cx, Value *vp)
 {
     return cx->compartment->getDebuggees().empty()
            ? JSTRAP_CONTINUE
            : dispatchHook(cx, vp, OnExceptionUnwind);
 }
 
 void
 Debugger::onNewScript(JSContext *cx, JSScript *script, GlobalObject *compileAndGoGlobal)