Commit 1e7bd2e2 authored by Mircea Trofin's avatar Mircea Trofin Committed by Commit Bot

[wasm] Fix WasmCompiledFrame::Print

The function wasn't off-the-heap aware.

Bug: chromium:795020
Change-Id: I133dce54e570ff74b1475192882761d2bc377d6f
Reviewed-on: https://chromium-review.googlesource.com/830819Reviewed-by: 's avatarEric Holk <eholk@chromium.org>
Commit-Queue: Mircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50142}
parent 674ec087
...@@ -1693,7 +1693,15 @@ void WasmCompiledFrame::Print(StringStream* accumulator, PrintMode mode, ...@@ -1693,7 +1693,15 @@ void WasmCompiledFrame::Print(StringStream* accumulator, PrintMode mode,
accumulator->Add("WASM ["); accumulator->Add("WASM [");
Script* script = this->script(); Script* script = this->script();
accumulator->PrintName(script->name()); accumulator->PrintName(script->name());
int pc = static_cast<int>(this->pc() - LookupCode()->instruction_start()); Address instruction_start = FLAG_wasm_jit_to_native
? isolate()
->wasm_engine()
->code_manager()
->LookupCode(pc())
->instructions()
.start()
: LookupCode()->instruction_start();
int pc = static_cast<int>(this->pc() - instruction_start);
Object* instance = this->wasm_instance(); Object* instance = this->wasm_instance();
Vector<const uint8_t> raw_func_name = Vector<const uint8_t> raw_func_name =
WasmInstanceObject::cast(instance)->compiled_module()->GetRawFunctionName( WasmInstanceObject::cast(instance)->compiled_module()->GetRawFunctionName(
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --expose-wasm // Flags: --expose-wasm --allow-natives-syntax
'use strict'; 'use strict';
...@@ -170,3 +170,19 @@ function assertConversionError(bytes, imports, msg) { ...@@ -170,3 +170,19 @@ function assertConversionError(bytes, imports, msg) {
kExprI64Const, 0 kExprI64Const, 0
]).exportFunc().end().toBuffer(), {}, "invalid type"); ]).exportFunc().end().toBuffer(), {}, "invalid type");
})(); })();
(function InternalDebugTrace() {
var builder = new WasmModuleBuilder();
var sig = builder.addType(kSig_i_dd);
builder.addImport("mod", "func", sig);
builder.addFunction("main", sig)
.addBody([kExprGetLocal, 0, kExprGetLocal, 1, kExprCallFunction, 0])
.exportAs("main")
var main = builder.instantiate({
mod: {
func: ()=>{%DebugTrace();}
}
}).exports.main;
main();
})();
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