Commit 40ce9f70 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm] Scan stack in foreground code GC

When a WasmGCForegroundTask starts during runMessageLoopOnPause, the
stack may contain Wasm code. In this case we need to scan the stack to
report live code.

This is already caught by some tests when RemoveBreakpoint is
implemented correctly, which will be done in a separate CL, so no
regression test is added here.

R=clemensb@chromium.org

Bug: v8:10337
Change-Id: I308145b9c2cf69f0100853be47ec9e30ce79a876
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2379510Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69724}
parent 1a3cc643
......@@ -117,15 +117,9 @@ class WasmGCForegroundTask : public CancelableTask {
void RunInternal() final {
WasmEngine* engine = isolate_->wasm_engine();
// If the foreground task is executing, there is no wasm code active. Just
// report an empty set of live wasm code.
#ifdef ENABLE_SLOW_DCHECKS
for (StackFrameIterator it(isolate_); !it.done(); it.Advance()) {
DCHECK_NE(StackFrame::WASM, it.frame()->type());
}
#endif
CheckNoArchivedThreads(isolate_);
engine->ReportLiveCodeForGC(isolate_, Vector<WasmCode*>{});
// The stack can contain live frames, for instance when this is invoked
// during a pause or a breakpoint.
engine->ReportLiveCodeFromStackForGC(isolate_);
}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment