Commit cbc34149 authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[wasm] Add WasmCodeRefScope for printing

Add a WasmCodeRefScope around _v8_internal_Print_Code() because that
is needed for debugging.

R=clemensh@chromium.org

Change-Id: Ifdb7a32695163e0a109567ec00a52196e79e03db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1585844Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61047}
parent 6ccec5ce
......@@ -2741,12 +2741,15 @@ V8_EXPORT_PRIVATE extern void _v8_internal_Print_Code(void* object) {
i::Address address = reinterpret_cast<i::Address>(object);
i::Isolate* isolate = i::Isolate::Current();
i::wasm::WasmCode* wasm_code =
isolate->wasm_engine()->code_manager()->LookupCode(address);
if (wasm_code) {
i::StdoutStream os;
wasm_code->Disassemble(nullptr, os, address);
return;
{
i::wasm::WasmCodeRefScope scope;
i::wasm::WasmCode* wasm_code =
isolate->wasm_engine()->code_manager()->LookupCode(address);
if (wasm_code) {
i::StdoutStream os;
wasm_code->Disassemble(nullptr, os, address);
return;
}
}
if (!isolate->heap()->InSpaceSlow(address, i::CODE_SPACE) &&
......
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