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

Issue 2555243002: [wasm] Fix location for error in asm.js ToNumber conversion (Closed)

Created:
4 years ago by Clemens Hammacher
Modified:
4 years ago
CC:
jgruber, v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Fix location for error in asm.js ToNumber conversion In the asm.js code translated to wasm, we call imported functions via a WASM_TO_JS stub, which first calls the function and then calls ToNumber on the return value. Exceptions can happen in both calls. We were only ever reporting the location of the function call, whereas asm.js code executed via turbofan reported the location of the type coercion operator ("+" on "+foo()" or "|" on "foo()|0"). This CL implements the same behaviour for asm.js code translated to wasm. The following is changed: - the AsmWasmBuilder records the parent node when descending on a binary operator (also "+foo()" is represented by a binary operation). - it stores not one location per call in the source position side table, but two (one for the call, one for the parent which does the type coercion). - the wasm compiler annotates the source positions "0" and "1" to the two calls in the WASM_TO_JS wrapper (only if the module origin is asm.js). - the StackFrame::State struct now also holds the callee_pc_address, which is set in ComputeCallerState. The WASM frame uses this information to determine whether the callee frame is WASM_TO_JS, and whether that frame is at the ToNumber conversion call. - the same information is also stored in the FrameArray which is used to reconstruct the stack trace later. R=titzer@chromium.org, bradnelson@chromium.org CC=jgruber@chromium.org BUG=v8:4203, v8:5724 Committed: https://crrev.com/94cd46b55e24fa2bb7b06b3da4d5ba7f029bc262 Committed: https://crrev.com/890d28f3615769c3aa82b1bdf7df12c55774f909 Cr-Original-Commit-Position: refs/heads/master@{#41599} Cr-Commit-Position: refs/heads/master@{#41613}

Patch Set 1 #

Patch Set 2 : No need to store parent in VisitCall #

Total comments: 6

Patch Set 3 : Address comments #

Total comments: 4

Patch Set 4 : Address Michis comments #

Total comments: 10

Patch Set 5 : Address comments #

Patch Set 6 : Fix gc error by storing callee_pc_address #

Unified diffs Side-by-side diffs Delta from patch set Stats (+283 lines, -72 lines) Patch
M src/asmjs/asm-wasm-builder.cc View 1 2 3 4 6 chunks +21 lines, -4 lines 0 comments Download
M src/compiler/pipeline.h View 1 chunk +4 lines, -4 lines 0 comments Download
M src/compiler/pipeline.cc View 1 2 3 4 5 3 chunks +12 lines, -8 lines 0 comments Download
M src/compiler/wasm-compiler.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/compiler/wasm-compiler.cc View 1 2 5 chunks +12 lines, -3 lines 0 comments Download
M src/frames.h View 1 2 3 4 5 3 chunks +7 lines, -6 lines 0 comments Download
M src/frames.cc View 1 2 3 4 5 6 chunks +21 lines, -4 lines 0 comments Download
M src/isolate.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/isolate.cc View 1 2 3 4 5 3 chunks +13 lines, -5 lines 0 comments Download
M src/messages.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M src/messages.cc View 2 chunks +11 lines, -1 line 0 comments Download
M src/objects.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/wasm/module-decoder.h View 1 chunk +6 lines, -1 line 0 comments Download
M src/wasm/module-decoder.cc View 2 chunks +9 lines, -4 lines 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 chunks +5 lines, -3 lines 0 comments Download
M src/wasm/wasm-module-builder.h View 1 chunk +1 line, -1 line 0 comments Download
M src/wasm/wasm-module-builder.cc View 2 chunks +8 lines, -4 lines 0 comments Download
M src/wasm/wasm-objects.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/wasm/wasm-objects.cc View 1 2 6 chunks +32 lines, -18 lines 0 comments Download
M test/cctest/wasm/wasm-run-utils.h View 1 chunk +3 lines, -3 lines 0 comments Download
A test/mjsunit/wasm/asm-wasm-exception-in-tonumber.js View 1 2 1 chunk +105 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (40 generated)
Clemens Hammacher
This is a rather big change for just fixing some slightly wrong locations on the ...
4 years ago (2016-12-07 19:00:07 UTC) #9
bradnelson
lgtm https://codereview.chromium.org/2555243002/diff/20001/src/asmjs/asm-wasm-builder.cc File src/asmjs/asm-wasm-builder.cc (right): https://codereview.chromium.org/2555243002/diff/20001/src/asmjs/asm-wasm-builder.cc#newcode40 src/asmjs/asm-wasm-builder.cc:40: bool IsChild(Expression* parent, Expression* child) { IsBinOpChild ? ...
4 years ago (2016-12-07 19:19:06 UTC) #12
Clemens Hammacher
https://codereview.chromium.org/2555243002/diff/20001/src/asmjs/asm-wasm-builder.cc File src/asmjs/asm-wasm-builder.cc (right): https://codereview.chromium.org/2555243002/diff/20001/src/asmjs/asm-wasm-builder.cc#newcode40 src/asmjs/asm-wasm-builder.cc:40: bool IsChild(Expression* parent, Expression* child) { On 2016/12/07 at ...
4 years ago (2016-12-08 10:50:23 UTC) #15
titzer
On 2016/12/08 10:50:23, Clemens Hammacher wrote: > https://codereview.chromium.org/2555243002/diff/20001/src/asmjs/asm-wasm-builder.cc > File src/asmjs/asm-wasm-builder.cc (right): > > https://codereview.chromium.org/2555243002/diff/20001/src/asmjs/asm-wasm-builder.cc#newcode40 ...
4 years ago (2016-12-08 10:51:07 UTC) #19
Michael Starzinger
LGTM with comments to address. Mostly looked at the gluing code, not so much at ...
4 years ago (2016-12-08 11:38:05 UTC) #22
Clemens Hammacher
BTW, the Ignition fix landed, so we are also green now :) https://codereview.chromium.org/2555243002/diff/40001/src/compiler/pipeline.cc File src/compiler/pipeline.cc ...
4 years ago (2016-12-08 12:15:37 UTC) #25
titzer
On 2016/12/08 12:15:37, Clemens Hammacher wrote: > BTW, the Ignition fix landed, so we are ...
4 years ago (2016-12-08 14:07:44 UTC) #28
titzer
lgtm This needs to have some comments sprinkled around so we don't lose the context ...
4 years ago (2016-12-08 14:08:51 UTC) #29
Clemens Hammacher
https://codereview.chromium.org/2555243002/diff/60001/src/asmjs/asm-wasm-builder.cc File src/asmjs/asm-wasm-builder.cc (right): https://codereview.chromium.org/2555243002/diff/60001/src/asmjs/asm-wasm-builder.cc#newcode1404 src/asmjs/asm-wasm-builder.cc:1404: BinaryOperation* this_parent = bin_op_parent_; On 2016/12/08 at 14:08:50, titzer ...
4 years ago (2016-12-08 15:26:21 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2555243002/80001
4 years ago (2016-12-08 16:45:57 UTC) #37
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years ago (2016-12-08 16:47:42 UTC) #40
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/94cd46b55e24fa2bb7b06b3da4d5ba7f029bc262 Cr-Commit-Position: refs/heads/master@{#41599}
4 years ago (2016-12-08 16:48:17 UTC) #42
Clemens Hammacher
A revert of this CL (patchset #5 id:80001) has been created in https://codereview.chromium.org/2563613003/ by clemensh@chromium.org. ...
4 years ago (2016-12-08 17:33:59 UTC) #43
Clemens Hammacher
Fixed GC failures by not touching the source position table during stack walk. Instead, FrameArray::State ...
4 years ago (2016-12-09 10:15:30 UTC) #47
Michael Starzinger
LGTM on patch set 6.
4 years ago (2016-12-09 10:27:01 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2555243002/90001
4 years ago (2016-12-09 10:27:56 UTC) #53
commit-bot: I haz the power
Committed patchset #6 (id:90001)
4 years ago (2016-12-09 10:29:58 UTC) #56
commit-bot: I haz the power
4 years ago (2016-12-09 10:30:24 UTC) #58
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/890d28f3615769c3aa82b1bdf7df12c55774f909
Cr-Commit-Position: refs/heads/master@{#41613}

Powered by Google App Engine
This is Rietveld 408576698