Bug 1590874 - Rely on per-WasmInstance WasmBreakpointSite objects. r=jimb
authorLogan Smyth <loganfsmyth@gmail.com>
Mon, 11 Nov 2019 17:58:29 +0000
changeset 501707 373ebff70ac21d0a39944739b4573c3f2d30ded9
parent 501706 10992479f249f70907e688b5c5622deb042d9ba7
child 501708 aad72f40920e95b959c193e919269cba49bbd358
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimb
bugs1590874
milestone72.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 1590874 - Rely on per-WasmInstance WasmBreakpointSite objects. r=jimb Differential Revision: https://phabricator.services.mozilla.com/D52277
js/src/debugger/Debugger.cpp
js/src/debugger/Debugger.h
--- a/js/src/debugger/Debugger.cpp
+++ b/js/src/debugger/Debugger.cpp
@@ -412,17 +412,17 @@ WasmBreakpointSite::WasmBreakpointSite(W
 }
 
 void WasmBreakpointSite::trace(JSTracer* trc) {
   BreakpointSite::trace(trc);
   TraceEdge(trc, &instanceObject, "breakpoint Wasm instance");
 }
 
 void WasmBreakpointSite::remove(JSFreeOp* fop) {
-  instance().destroyBreakpointSite(fop, offset);
+  instanceObject->instance().destroyBreakpointSite(fop, offset);
 }
 
 void WasmBreakpointSite::delete_(JSFreeOp* fop) {
   BreakpointSite::finalize(fop);
 
   fop->delete_(instanceObject, this, MemoryUse::BreakpointSite);
 }
 
@@ -2394,21 +2394,16 @@ ResumeMode DebugAPI::onTrap(JSContext* c
 
   // Build list of breakpoint handlers.
   //
   // This does not need to be rooted: since the JSScript/WasmInstance is on the
   // stack, the Breakpoints will not be GC'd. However, they may be deleted, and
   // we check for that case below.
   Vector<Breakpoint*> triggered(cx);
   for (Breakpoint* bp = site->firstBreakpoint(); bp; bp = bp->nextInSite()) {
-    // Skip a breakpoint that is not set for the current wasm::Instance --
-    // single wasm::Code can handle breakpoints for mutiple instances.
-    if (!isJS && &bp->site->asWasm()->instance() != iter.wasmInstance()) {
-      continue;
-    }
     if (!triggered.append(bp)) {
       return ResumeMode::Terminate;
     }
   }
 
   if (triggered.length() > 0) {
     // Preserve the debuggee's microtask event queue while we run the hooks, so
     // the debugger's microtask checkpoints don't run from the debuggee's
--- a/js/src/debugger/Debugger.h
+++ b/js/src/debugger/Debugger.h
@@ -1391,18 +1391,16 @@ class WasmBreakpointSite : public Breakp
   uint32_t offset;
 
  public:
   WasmBreakpointSite(WasmInstanceObject* instanceObject, uint32_t offset);
 
   void trace(JSTracer* trc) override;
   void delete_(JSFreeOp* fop);
   void remove(JSFreeOp* fop) override;
-
-  wasm::Instance& instance() { return instanceObject->instance(); }
 };
 
 inline WasmBreakpointSite* BreakpointSite::asWasm() {
   MOZ_ASSERT(type() == Type::Wasm);
   return static_cast<WasmBreakpointSite*>(this);
 }
 
 Breakpoint* Debugger::firstBreakpoint() const {