Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Unified Diff: src/compiler/wasm-compiler.cc

Issue 2555243002: [wasm] Fix location for error in asm.js ToNumber conversion (Closed)
Patch Set: Fix gc error by storing callee_pc_address Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/frames.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index 716e17b34f304bb53bbe5cdeac55350b14e8005e..2e7dcfe9e34a1ac0dace836a6025a2d4d3d105e7 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2451,6 +2451,8 @@ Node* WasmGraphBuilder::BuildJavaScriptToNumber(Node* node, Node* context) {
Node* result = graph()->NewNode(jsgraph()->common()->Call(desc), stub_code,
node, context, *effect_, *control_);
+ SetSourcePosition(result, 1);
+
*effect_ = result;
return result;
@@ -2850,6 +2852,7 @@ void WasmGraphBuilder::BuildWasmToJSWrapper(Handle<JSReceiver> target,
}
*effect_ = call;
+ SetSourcePosition(call, 0);
// Convert the return value back.
Node* i32_zero = jsgraph()->Int32Constant(0);
@@ -3324,7 +3327,8 @@ Handle<Code> CompileJSToWasmWrapper(Isolate* isolate,
Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<JSReceiver> target,
wasm::FunctionSig* sig, uint32_t index,
Handle<String> module_name,
- MaybeHandle<String> import_name) {
+ MaybeHandle<String> import_name,
+ wasm::ModuleOrigin origin) {
//----------------------------------------------------------------------------
// Create the Graph
//----------------------------------------------------------------------------
@@ -3337,7 +3341,11 @@ Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<JSReceiver> target,
Node* control = nullptr;
Node* effect = nullptr;
- WasmGraphBuilder builder(&zone, &jsgraph, sig);
+ SourcePositionTable* source_position_table =
+ origin == wasm::kAsmJsOrigin ? new (&zone) SourcePositionTable(&graph)
+ : nullptr;
+
+ WasmGraphBuilder builder(&zone, &jsgraph, sig, source_position_table);
builder.set_control_ptr(&control);
builder.set_effect_ptr(&effect);
builder.BuildWasmToJSWrapper(target, sig);
@@ -3373,7 +3381,8 @@ Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, Handle<JSReceiver> target,
}
CompilationInfo info(func_name, isolate, &zone, flags);
- code = Pipeline::GenerateCodeForTesting(&info, incoming, &graph, nullptr);
+ code = Pipeline::GenerateCodeForTesting(&info, incoming, &graph, nullptr,
+ source_position_table);
#ifdef ENABLE_DISASSEMBLER
if (FLAG_print_opt_code && !code.is_null()) {
OFStream os(stdout);
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698