Bug 1564170: Make Debugger.Script referent variant matcher classes into member classes of DebuggerScript. r=jorendorff
authorJim Blandy <jimb@mozilla.com>
Wed, 17 Jul 2019 07:13:30 +0000
changeset 483061 fe088addd88ae54284eefa8f6f06ae0d41530c6d
parent 483060 61c49c2a77f7f3a6078a25c0c5ed5e2d8c6f02e5
child 483062 0f741c61e16bf1197dccbfad16cdd34b5bab4717
push id36304
push userdvarga@mozilla.com
push dateWed, 17 Jul 2019 15:47:02 +0000
treeherdermozilla-central@15c45a5c2337 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1564170
milestone70.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 1564170: Make Debugger.Script referent variant matcher classes into member classes of DebuggerScript. r=jorendorff No intended change in behavior; just re-scoping and renaming. Differential Revision: https://phabricator.services.mozilla.com/D37528
js/src/dbg/Debugger.cpp
js/src/dbg/Debugger.h
--- a/js/src/dbg/Debugger.cpp
+++ b/js/src/dbg/Debugger.cpp
@@ -5868,21 +5868,21 @@ void DebuggerScript::trace(JSTracer* trc
 /* static */
 NativeObject* DebuggerScript::initClass(JSContext* cx,
                                         Handle<GlobalObject*> global,
                                         HandleObject debugCtor) {
   return InitClass(cx, debugCtor, nullptr, &class_, construct, 0, properties_,
                    methods_, nullptr, nullptr);
 }
 
-class DebuggerScriptSetPrivateMatcher {
+class DebuggerScript::SetPrivateMatcher {
   DebuggerScript* obj_;
 
  public:
-  explicit DebuggerScriptSetPrivateMatcher(DebuggerScript* obj) : obj_(obj) {}
+  explicit SetPrivateMatcher(DebuggerScript* obj) : obj_(obj) {}
   using ReturnType = void;
   ReturnType match(HandleScript script) { obj_->setPrivateGCThing(script); }
   ReturnType match(Handle<LazyScript*> lazyScript) {
     obj_->setPrivateGCThing(lazyScript);
   }
   ReturnType match(Handle<WasmInstanceObject*> instance) {
     obj_->setPrivateGCThing(instance);
   }
@@ -5895,17 +5895,17 @@ DebuggerScript* DebuggerScript::create(J
   DebuggerScript* scriptobj =
       NewObjectWithGivenProto<DebuggerScript>(cx, proto, TenuredObject);
   if (!scriptobj) {
     return nullptr;
   }
 
   scriptobj->setReservedSlot(DebuggerScript::OWNER_SLOT,
                              ObjectValue(*debugger));
-  DebuggerScriptSetPrivateMatcher matcher(scriptobj);
+  SetPrivateMatcher matcher(scriptobj);
   referent.match(matcher);
 
   return scriptobj;
 }
 
 static JSScript* DelazifyScript(JSContext* cx, Handle<LazyScript*> lazyScript) {
   if (lazyScript->maybeScript()) {
     return lazyScript->maybeScript();
@@ -6223,41 +6223,40 @@ bool DebuggerScript::getUrl(JSContext* c
     RootedScript script(cx, obj->getReferent().as<JSScript*>());
     return getUrlImpl<JSScript>(cx, args, script);
   }
 
   Rooted<LazyScript*> lazyScript(cx, obj->getReferent().as<LazyScript*>());
   return getUrlImpl<LazyScript>(cx, args, lazyScript);
 }
 
-struct DebuggerScriptGetStartLineMatcher {
+struct DebuggerScript::GetStartLineMatcher {
   using ReturnType = uint32_t;
 
   ReturnType match(HandleScript script) { return script->lineno(); }
   ReturnType match(Handle<LazyScript*> lazyScript) {
     return lazyScript->lineno();
   }
   ReturnType match(Handle<WasmInstanceObject*> wasmInstance) { return 1; }
 };
 
 /* static */
 bool DebuggerScript::getStartLine(JSContext* cx, unsigned argc, Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "(get startLine)", args, obj,
                             referent);
-  DebuggerScriptGetStartLineMatcher matcher;
+  GetStartLineMatcher matcher;
   args.rval().setNumber(referent.match(matcher));
   return true;
 }
 
-struct DebuggerScriptGetLineCountMatcher {
+struct DebuggerScript::GetLineCountMatcher {
   JSContext* cx_;
   double totalLines;
 
-  explicit DebuggerScriptGetLineCountMatcher(JSContext* cx)
-      : cx_(cx), totalLines(0.0) {}
+  explicit GetLineCountMatcher(JSContext* cx) : cx_(cx), totalLines(0.0) {}
   using ReturnType = bool;
 
   ReturnType match(HandleScript script) {
     totalLines = double(GetScriptLineExtent(script));
     return true;
   }
   ReturnType match(Handle<LazyScript*> lazyScript) {
     RootedScript script(cx_, DelazifyScript(cx_, lazyScript));
@@ -6276,31 +6275,30 @@ struct DebuggerScriptGetLineCountMatcher
     return true;
   }
 };
 
 /* static */
 bool DebuggerScript::getLineCount(JSContext* cx, unsigned argc, Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "(get lineCount)", args, obj,
                             referent);
-  DebuggerScriptGetLineCountMatcher matcher(cx);
+  GetLineCountMatcher matcher(cx);
   if (!referent.match(matcher)) {
     return false;
   }
   args.rval().setNumber(matcher.totalLines);
   return true;
 }
 
-class DebuggerScriptGetSourceMatcher {
+class DebuggerScript::GetSourceMatcher {
   JSContext* cx_;
   Debugger* dbg_;
 
  public:
-  DebuggerScriptGetSourceMatcher(JSContext* cx, Debugger* dbg)
-      : cx_(cx), dbg_(dbg) {}
+  GetSourceMatcher(JSContext* cx, Debugger* dbg) : cx_(cx), dbg_(dbg) {}
 
   using ReturnType = JSObject*;
 
   ReturnType match(HandleScript script) {
     // JSScript holds the refefence to possibly wrapped ScriptSourceObject.
     // It's wrapped when the script is cloned.
     // See CreateEmptyScriptForClone for more info.
     RootedScriptSourceObject source(
@@ -6318,17 +6316,17 @@ class DebuggerScriptGetSourceMatcher {
   }
 };
 
 /* static */
 bool DebuggerScript::getSource(JSContext* cx, unsigned argc, Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "(get source)", args, obj, referent);
   Debugger* dbg = Debugger::fromChildJSObject(obj);
 
-  DebuggerScriptGetSourceMatcher matcher(cx, dbg);
+  GetSourceMatcher matcher(cx, dbg);
   RootedObject sourceObject(cx, referent.match(matcher));
   if (!sourceObject) {
     return false;
   }
 
   args.rval().setObject(*sourceObject);
   return true;
 }
@@ -6368,34 +6366,33 @@ bool DebuggerScript::getGlobal(JSContext
   RootedValue v(cx, ObjectValue(script->global()));
   if (!dbg->wrapDebuggeeValue(cx, &v)) {
     return false;
   }
   args.rval().set(v);
   return true;
 }
 
-class DebuggerScriptGetFormatMatcher {
+class DebuggerScript::GetFormatMatcher {
   const JSAtomState& names_;
 
  public:
-  explicit DebuggerScriptGetFormatMatcher(const JSAtomState& names)
-      : names_(names) {}
+  explicit GetFormatMatcher(const JSAtomState& names) : names_(names) {}
   using ReturnType = JSAtom*;
   ReturnType match(HandleScript script) { return names_.js; }
   ReturnType match(Handle<LazyScript*> lazyScript) { return names_.js; }
   ReturnType match(Handle<WasmInstanceObject*> wasmInstance) {
     return names_.wasm;
   }
 };
 
 /* static */
 bool DebuggerScript::getFormat(JSContext* cx, unsigned argc, Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "(get format)", args, obj, referent);
-  DebuggerScriptGetFormatMatcher matcher(cx->names());
+  GetFormatMatcher matcher(cx->names());
   args.rval().setString(referent.match(matcher));
   return true;
 }
 
 /* static */
 bool DebuggerScript::getChildScripts(JSContext* cx, unsigned argc, Value* vp) {
   THIS_DEBUGSCRIPT_SCRIPT_DELAZIFY(cx, argc, vp, "getChildScripts", args, obj,
                                    script);
@@ -6460,17 +6457,17 @@ static bool EnsureScriptOffsetIsValid(JS
     return true;
   }
   JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                             JSMSG_DEBUG_BAD_OFFSET);
   return false;
 }
 
 template <bool OnlyOffsets>
-class DebuggerScriptGetPossibleBreakpointsMatcher {
+class DebuggerScript::GetPossibleBreakpointsMatcher {
   JSContext* cx_;
   MutableHandleObject result_;
 
   Maybe<size_t> minOffset;
   Maybe<size_t> maxOffset;
 
   Maybe<size_t> minLine;
   size_t minColumn;
@@ -6564,18 +6561,18 @@ class DebuggerScriptGetPossibleBreakpoin
       return false;
     }
 
     *result = Some(result_);
     return true;
   }
 
  public:
-  explicit DebuggerScriptGetPossibleBreakpointsMatcher(
-      JSContext* cx, MutableHandleObject result)
+  explicit GetPossibleBreakpointsMatcher(JSContext* cx,
+                                         MutableHandleObject result)
       : cx_(cx),
         result_(result),
         minOffset(),
         maxOffset(),
         minLine(),
         minColumn(0),
         maxLine(),
         maxColumn(0) {}
@@ -6775,17 +6772,17 @@ class DebuggerScriptGetPossibleBreakpoin
 
 /* static */
 bool DebuggerScript::getPossibleBreakpoints(JSContext* cx, unsigned argc,
                                             Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "getPossibleBreakpoints", args, obj,
                             referent);
 
   RootedObject result(cx);
-  DebuggerScriptGetPossibleBreakpointsMatcher<false> matcher(cx, &result);
+  GetPossibleBreakpointsMatcher<false> matcher(cx, &result);
   if (args.length() >= 1 && !args[0].isUndefined()) {
     RootedObject queryObject(cx, RequireObject(cx, args[0]));
     if (!queryObject || !matcher.parseQuery(queryObject)) {
       return false;
     }
   }
   if (!referent.match(matcher)) {
     return false;
@@ -6797,39 +6794,39 @@ bool DebuggerScript::getPossibleBreakpoi
 
 /* static */
 bool DebuggerScript::getPossibleBreakpointOffsets(JSContext* cx, unsigned argc,
                                                   Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "getPossibleBreakpointOffsets", args,
                             obj, referent);
 
   RootedObject result(cx);
-  DebuggerScriptGetPossibleBreakpointsMatcher<true> matcher(cx, &result);
+  GetPossibleBreakpointsMatcher<true> matcher(cx, &result);
   if (args.length() >= 1 && !args[0].isUndefined()) {
     RootedObject queryObject(cx, RequireObject(cx, args[0]));
     if (!queryObject || !matcher.parseQuery(queryObject)) {
       return false;
     }
   }
   if (!referent.match(matcher)) {
     return false;
   }
 
   args.rval().setObject(*result);
   return true;
 }
 
-class DebuggerScriptGetOffsetMetadataMatcher {
+class DebuggerScript::GetOffsetMetadataMatcher {
   JSContext* cx_;
   size_t offset_;
   MutableHandlePlainObject result_;
 
  public:
-  explicit DebuggerScriptGetOffsetMetadataMatcher(
-      JSContext* cx, size_t offset, MutableHandlePlainObject result)
+  explicit GetOffsetMetadataMatcher(JSContext* cx, size_t offset,
+                                    MutableHandlePlainObject result)
       : cx_(cx), offset_(offset), result_(result) {}
   using ReturnType = bool;
   ReturnType match(HandleScript script) {
     if (!EnsureScriptOffsetIsValid(cx_, script, offset_)) {
       return false;
     }
 
     result_.set(NewBuiltinClassInstance<PlainObject>(cx_));
@@ -6925,17 +6922,17 @@ bool DebuggerScript::getOffsetMetadata(J
     return false;
   }
   size_t offset;
   if (!ScriptOffset(cx, args[0], &offset)) {
     return false;
   }
 
   RootedPlainObject result(cx);
-  DebuggerScriptGetOffsetMetadataMatcher matcher(cx, offset, &result);
+  GetOffsetMetadataMatcher matcher(cx, offset, &result);
   if (!referent.match(matcher)) {
     return false;
   }
 
   args.rval().setObject(*result);
   return true;
 }
 
@@ -7100,24 +7097,24 @@ class FlowGraphSummary {
     }
   }
 
   Vector<Entry> entries_;
 };
 
 } /* anonymous namespace */
 
-class DebuggerScriptGetOffsetLocationMatcher {
+class DebuggerScript::GetOffsetLocationMatcher {
   JSContext* cx_;
   size_t offset_;
   MutableHandlePlainObject result_;
 
  public:
-  explicit DebuggerScriptGetOffsetLocationMatcher(
-      JSContext* cx, size_t offset, MutableHandlePlainObject result)
+  explicit GetOffsetLocationMatcher(JSContext* cx, size_t offset,
+                                    MutableHandlePlainObject result)
       : cx_(cx), offset_(offset), result_(result) {}
   using ReturnType = bool;
   ReturnType match(HandleScript script) {
     if (!EnsureScriptOffsetIsValid(cx_, script, offset_)) {
       return false;
     }
 
     FlowGraphSummary flowData(cx_);
@@ -7238,34 +7235,35 @@ bool DebuggerScript::getOffsetLocation(J
     return false;
   }
   size_t offset;
   if (!ScriptOffset(cx, args[0], &offset)) {
     return false;
   }
 
   RootedPlainObject result(cx);
-  DebuggerScriptGetOffsetLocationMatcher matcher(cx, offset, &result);
+  GetOffsetLocationMatcher matcher(cx, offset, &result);
   if (!referent.match(matcher)) {
     return false;
   }
 
   args.rval().setObject(*result);
   return true;
 }
 
-class DebuggerScriptGetSuccessorOrPredecessorOffsetsMatcher {
+class DebuggerScript::GetSuccessorOrPredecessorOffsetsMatcher {
   JSContext* cx_;
   size_t offset_;
   bool successor_;
   MutableHandleObject result_;
 
  public:
-  DebuggerScriptGetSuccessorOrPredecessorOffsetsMatcher(
-      JSContext* cx, size_t offset, bool successor, MutableHandleObject result)
+  GetSuccessorOrPredecessorOffsetsMatcher(JSContext* cx, size_t offset,
+                                          bool successor,
+                                          MutableHandleObject result)
       : cx_(cx), offset_(offset), successor_(successor), result_(result) {}
 
   using ReturnType = bool;
 
   ReturnType match(HandleScript script) {
     if (!EnsureScriptOffsetIsValid(cx_, script, offset_)) {
       return false;
     }
@@ -7323,18 +7321,18 @@ bool DebuggerScript::getSuccessorOrPrede
     return false;
   }
   size_t offset;
   if (!ScriptOffset(cx, args[0], &offset)) {
     return false;
   }
 
   RootedObject result(cx);
-  DebuggerScriptGetSuccessorOrPredecessorOffsetsMatcher matcher(
-      cx, offset, successor, &result);
+  GetSuccessorOrPredecessorOffsetsMatcher matcher(cx, offset, successor,
+                                                  &result);
   if (!referent.match(matcher)) {
     return false;
   }
 
   args.rval().setObject(*result);
   return true;
 }
 
@@ -7420,17 +7418,17 @@ bool DebuggerScript::getAllOffsets(JSCon
       }
     }
   }
 
   args.rval().setObject(*result);
   return true;
 }
 
-class DebuggerScriptGetAllColumnOffsetsMatcher {
+class DebuggerScript::GetAllColumnOffsetsMatcher {
   JSContext* cx_;
   MutableHandleObject result_;
 
   bool appendColumnOffsetEntry(size_t lineno, size_t column, size_t offset) {
     RootedPlainObject entry(cx_, NewBuiltinClassInstance<PlainObject>(cx_));
     if (!entry) {
       return false;
     }
@@ -7449,18 +7447,17 @@ class DebuggerScriptGetAllColumnOffsetsM
     if (!DefineDataProperty(cx_, entry, cx_->names().offset, value)) {
       return false;
     }
 
     return NewbornArrayPush(cx_, result_, ObjectValue(*entry));
   }
 
  public:
-  explicit DebuggerScriptGetAllColumnOffsetsMatcher(JSContext* cx,
-                                                    MutableHandleObject result)
+  explicit GetAllColumnOffsetsMatcher(JSContext* cx, MutableHandleObject result)
       : cx_(cx), result_(result) {}
   using ReturnType = bool;
   ReturnType match(HandleScript script) {
     // First pass: determine which offsets in this script are jump targets
     // and which positions jump to them.
     FlowGraphSummary flowData(cx_);
     if (!flowData.populate(cx_, script)) {
       return false;
@@ -7524,33 +7521,33 @@ class DebuggerScriptGetAllColumnOffsetsM
 
 /* static */
 bool DebuggerScript::getAllColumnOffsets(JSContext* cx, unsigned argc,
                                          Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "getAllColumnOffsets", args, obj,
                             referent);
 
   RootedObject result(cx);
-  DebuggerScriptGetAllColumnOffsetsMatcher matcher(cx, &result);
+  GetAllColumnOffsetsMatcher matcher(cx, &result);
   if (!referent.match(matcher)) {
     return false;
   }
 
   args.rval().setObject(*result);
   return true;
 }
 
-class DebuggerScriptGetLineOffsetsMatcher {
+class DebuggerScript::GetLineOffsetsMatcher {
   JSContext* cx_;
   size_t lineno_;
   MutableHandleObject result_;
 
  public:
-  explicit DebuggerScriptGetLineOffsetsMatcher(JSContext* cx, size_t lineno,
-                                               MutableHandleObject result)
+  explicit GetLineOffsetsMatcher(JSContext* cx, size_t lineno,
+                                 MutableHandleObject result)
       : cx_(cx), lineno_(lineno), result_(result) {}
   using ReturnType = bool;
   ReturnType match(HandleScript script) {
     // First pass: determine which offsets in this script are jump targets and
     // which line numbers jump to them.
     FlowGraphSummary flowData(cx_);
     if (!flowData.populate(cx_, script)) {
       return false;
@@ -7630,17 +7627,17 @@ bool DebuggerScript::getLineOffsets(JSCo
     if (lineno != d) {
       JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                 JSMSG_DEBUG_BAD_LINE);
       return false;
     }
   }
 
   RootedObject result(cx);
-  DebuggerScriptGetLineOffsetsMatcher matcher(cx, lineno, &result);
+  GetLineOffsetsMatcher matcher(cx, lineno, &result);
   if (!referent.match(matcher)) {
     return false;
   }
 
   args.rval().setObject(*result);
   return true;
 }
 
@@ -7863,26 +7860,25 @@ void Debugger::propagateForcedReturn(JSC
   // The interrupt handler then returns false with no exception set,
   // signaling an uncatchable exception. In the exception handlers, we then
   // check for the special propagating-forced-return flag.
   MOZ_ASSERT(!cx->isExceptionPending());
   cx->setPropagatingForcedReturn();
   frame.setReturnValue(rval);
 }
 
-struct DebuggerScriptSetBreakpointMatcher {
+struct DebuggerScript::SetBreakpointMatcher {
   JSContext* cx_;
   Debugger* dbg_;
   size_t offset_;
   RootedObject handler_;
 
  public:
-  explicit DebuggerScriptSetBreakpointMatcher(JSContext* cx, Debugger* dbg,
-                                              size_t offset,
-                                              HandleObject handler)
+  explicit SetBreakpointMatcher(JSContext* cx, Debugger* dbg, size_t offset,
+                                HandleObject handler)
       : cx_(cx), dbg_(dbg), offset_(offset), handler_(cx, handler) {}
 
   using ReturnType = bool;
 
   ReturnType match(HandleScript script) {
     if (!dbg_->observesScript(script)) {
       JS_ReportErrorNumberASCII(cx_, GetErrorMessage, nullptr,
                                 JSMSG_DEBUG_NOT_DEBUGGING);
@@ -7960,17 +7956,17 @@ bool DebuggerScript::setBreakpoint(JSCon
     return false;
   }
 
   RootedObject handler(cx, RequireObject(cx, args[1]));
   if (!handler) {
     return false;
   }
 
-  DebuggerScriptSetBreakpointMatcher matcher(cx, dbg, offset, handler);
+  SetBreakpointMatcher matcher(cx, dbg, offset, handler);
   if (!referent.match(matcher)) {
     return false;
   }
   args.rval().setUndefined();
   return true;
 }
 
 /* static */
@@ -8011,24 +8007,23 @@ bool DebuggerScript::getBreakpoints(JSCo
         }
       }
     }
   }
   args.rval().setObject(*arr);
   return true;
 }
 
-class DebuggerScriptClearBreakpointMatcher {
+class DebuggerScript::ClearBreakpointMatcher {
   JSContext* cx_;
   Debugger* dbg_;
   JSObject* handler_;
 
  public:
-  DebuggerScriptClearBreakpointMatcher(JSContext* cx, Debugger* dbg,
-                                       JSObject* handler)
+  ClearBreakpointMatcher(JSContext* cx, Debugger* dbg, JSObject* handler)
       : cx_(cx), dbg_(dbg), handler_(handler) {}
   using ReturnType = bool;
 
   ReturnType match(HandleScript script) {
     script->clearBreakpointsIn(cx_->runtime()->defaultFreeOp(), dbg_, handler_);
     return true;
   }
   ReturnType match(Handle<LazyScript*> lazyScript) {
@@ -8058,46 +8053,46 @@ bool DebuggerScript::clearBreakpoint(JSC
   }
   Debugger* dbg = Debugger::fromChildJSObject(obj);
 
   JSObject* handler = RequireObject(cx, args[0]);
   if (!handler) {
     return false;
   }
 
-  DebuggerScriptClearBreakpointMatcher matcher(cx, dbg, handler);
+  ClearBreakpointMatcher matcher(cx, dbg, handler);
   if (!referent.match(matcher)) {
     return false;
   }
 
   args.rval().setUndefined();
   return true;
 }
 
 /* static */
 bool DebuggerScript::clearAllBreakpoints(JSContext* cx, unsigned argc,
                                          Value* vp) {
   THIS_DEBUGSCRIPT_REFERENT(cx, argc, vp, "clearAllBreakpoints", args, obj,
                             referent);
   Debugger* dbg = Debugger::fromChildJSObject(obj);
-  DebuggerScriptClearBreakpointMatcher matcher(cx, dbg, nullptr);
+  ClearBreakpointMatcher matcher(cx, dbg, nullptr);
   if (!referent.match(matcher)) {
     return false;
   }
   args.rval().setUndefined();
   return true;
 }
 
-class DebuggerScriptIsInCatchScopeMatcher {
+class DebuggerScript::IsInCatchScopeMatcher {
   JSContext* cx_;
   size_t offset_;
   bool isInCatch_;
 
  public:
-  explicit DebuggerScriptIsInCatchScopeMatcher(JSContext* cx, size_t offset)
+  explicit IsInCatchScopeMatcher(JSContext* cx, size_t offset)
       : cx_(cx), offset_(offset), isInCatch_(false) {}
   using ReturnType = bool;
 
   inline bool isInCatch() const { return isInCatch_; }
 
   ReturnType match(HandleScript script) {
     if (!EnsureScriptOffsetIsValid(cx_, script, offset_)) {
       return false;
@@ -8135,17 +8130,17 @@ bool DebuggerScript::isInCatchScope(JSCo
     return false;
   }
 
   size_t offset;
   if (!ScriptOffset(cx, args[0], &offset)) {
     return false;
   }
 
-  DebuggerScriptIsInCatchScopeMatcher matcher(cx, offset);
+  IsInCatchScopeMatcher matcher(cx, offset);
   if (!referent.match(matcher)) {
     return false;
   }
   args.rval().setBoolean(matcher.isInCatch());
   return true;
 }
 
 /* static */
--- a/js/src/dbg/Debugger.h
+++ b/js/src/dbg/Debugger.h
@@ -1436,16 +1436,32 @@ class DebuggerScript : public NativeObje
                                                Value* vp, const char* name,
                                                bool successor);
 
  private:
   static const ClassOps classOps_;
 
   static const JSPropertySpec properties_[];
   static const JSFunctionSpec methods_[];
+
+  class SetPrivateMatcher;
+  struct GetStartLineMatcher;
+  struct GetLineCountMatcher;
+  class GetSourceMatcher;
+  class GetFormatMatcher;
+  template <bool OnlyOffsets>
+  class GetPossibleBreakpointsMatcher;
+  class GetOffsetMetadataMatcher;
+  class GetOffsetLocationMatcher;
+  class GetSuccessorOrPredecessorOffsetsMatcher;
+  class GetAllColumnOffsetsMatcher;
+  class GetLineOffsetsMatcher;
+  struct SetBreakpointMatcher;
+  class ClearBreakpointMatcher;
+  class IsInCatchScopeMatcher;
 };
 
 /*
  * A Handler represents a reference to a handler function. These handler
  * functions are called by the Debugger API to notify the user of certain
  * events. For each event type, we define a separate subclass of Handler. This
  * allows users to define a single reference to an object that implements
  * multiple handlers, by inheriting from the appropriate subclasses.