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

Issue 2137993003: [wasm] Adding feature to JIT a wasm function at runtime and hook up the compiled code into the indi… (Closed)

Created:
4 years, 5 months ago by ritesht
Modified:
4 years, 5 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Adding feature to JIT a wasm function at runtime and hook up the compiled code into the indirect function table The runtime JIT function is passed in the function table to hook up the compiled code and the starting address of the memory to locate the bytes to be compiled. BUG=5044 Committed: https://crrev.com/de33e4bad271ec2f5cbfc0b040b15465b0a2d778 Cr-Commit-Position: refs/heads/master@{#37735}

Patch Set 1 #

Patch Set 2 : fixed compilation error #

Patch Set 3 : Fixing casting #

Patch Set 4 : Fixing test #

Patch Set 5 : Changed casting #

Total comments: 39

Patch Set 6 : Addresssing comments #

Patch Set 7 : Fixing comparison error #

Patch Set 8 : Fixing unit test- #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+346 lines, -8 lines) Patch
M src/compiler/wasm-compiler.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M src/compiler/wasm-compiler.cc View 1 2 3 4 5 2 chunks +98 lines, -0 lines 2 comments Download
M src/messages.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 2 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M src/runtime/runtime-utils.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M src/runtime/runtime-wasm.cc View 1 2 3 4 5 6 4 chunks +81 lines, -1 line 2 comments Download
M src/wasm/ast-decoder.h View 1 chunk +10 lines, -0 lines 0 comments Download
M src/wasm/ast-decoder.cc View 1 2 3 4 5 5 chunks +45 lines, -0 lines 0 comments Download
M src/wasm/wasm-module.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M src/wasm/wasm-opcodes.h View 1 2 3 4 5 3 chunks +7 lines, -2 lines 0 comments Download
A test/mjsunit/wasm/jit-single-function.js View 1 2 3 4 5 6 7 1 chunk +79 lines, -0 lines 2 comments Download
M test/mjsunit/wasm/wasm-constants.js View 1 2 3 4 5 3 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 27 (12 generated)
ritesht
4 years, 5 months ago (2016-07-12 00:06:58 UTC) #4
ritesht
4 years, 5 months ago (2016-07-12 01:50:27 UTC) #7
Mircea Trofin
On 2016/07/12 01:50:27, ritesht wrote: I'm not sure I understand the scope of the feature. ...
4 years, 5 months ago (2016-07-12 02:48:59 UTC) #8
Mircea Trofin
https://codereview.chromium.org/2137993003/diff/80001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2137993003/diff/80001/src/compiler/wasm-compiler.cc#newcode2102 src/compiler/wasm-compiler.cc:2102: uint32_t sig_index, looks like base, length, index, and sig ...
4 years, 5 months ago (2016-07-12 02:49:13 UTC) #9
John
all optional https://codereview.chromium.org/2137993003/diff/80001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2137993003/diff/80001/src/compiler/wasm-compiler.cc#newcode2102 src/compiler/wasm-compiler.cc:2102: uint32_t sig_index, On 2016/07/12 02:49:12, Mircea Trofin ...
4 years, 5 months ago (2016-07-13 19:56:59 UTC) #11
ritesht
https://codereview.chromium.org/2137993003/diff/80001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2137993003/diff/80001/src/compiler/wasm-compiler.cc#newcode2102 src/compiler/wasm-compiler.cc:2102: uint32_t sig_index, On 2016/07/12 02:49:12, Mircea Trofin wrote: > ...
4 years, 5 months ago (2016-07-13 23:58:45 UTC) #12
ritesht
On 2016/07/12 02:48:59, Mircea Trofin wrote: > On 2016/07/12 01:50:27, ritesht wrote: > > I'm ...
4 years, 5 months ago (2016-07-14 00:00:57 UTC) #14
Mircea Trofin
On 2016/07/14 00:00:57, ritesht wrote: > On 2016/07/12 02:48:59, Mircea Trofin wrote: > > On ...
4 years, 5 months ago (2016-07-14 00:15:59 UTC) #15
Mircea Trofin
lgtm, one nit https://codereview.chromium.org/2137993003/diff/80001/test/mjsunit/wasm/jit-single-function.js File test/mjsunit/wasm/jit-single-function.js (right): https://codereview.chromium.org/2137993003/diff/80001/test/mjsunit/wasm/jit-single-function.js#newcode5 test/mjsunit/wasm/jit-single-function.js:5: // Flags: --wasm-jit-prototype On 2016/07/13 23:58:45, ...
4 years, 5 months ago (2016-07-14 00:16:15 UTC) #16
ritesht
https://codereview.chromium.org/2137993003/diff/80001/test/mjsunit/wasm/jit-single-function.js File test/mjsunit/wasm/jit-single-function.js (right): https://codereview.chromium.org/2137993003/diff/80001/test/mjsunit/wasm/jit-single-function.js#newcode5 test/mjsunit/wasm/jit-single-function.js:5: // Flags: --wasm-jit-prototype On 2016/07/14 00:16:15, Mircea Trofin wrote: ...
4 years, 5 months ago (2016-07-14 00:18:38 UTC) #17
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/2137993003/140001
4 years, 5 months ago (2016-07-14 01:10:35 UTC) #20
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 5 months ago (2016-07-14 01:12:52 UTC) #22
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/de33e4bad271ec2f5cbfc0b040b15465b0a2d778 Cr-Commit-Position: refs/heads/master@{#37735}
4 years, 5 months ago (2016-07-14 01:13:58 UTC) #24
titzer
https://codereview.chromium.org/2137993003/diff/140001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/2137993003/diff/140001/src/compiler/wasm-compiler.cc#newcode2101 src/compiler/wasm-compiler.cc:2101: Node* WasmGraphBuilder::JITSingleFunction(Node* const base, Node* const length, This should ...
4 years, 5 months ago (2016-07-14 08:59:44 UTC) #26
ritesht
4 years, 5 months ago (2016-07-14 18:10:00 UTC) #27
Message was sent while issue was closed.
https://codereview.chromium.org/2137993003/diff/140001/src/compiler/wasm-comp...
File src/compiler/wasm-compiler.cc (right):

https://codereview.chromium.org/2137993003/diff/140001/src/compiler/wasm-comp...
src/compiler/wasm-compiler.cc:2101: Node*
WasmGraphBuilder::JITSingleFunction(Node* const base, Node* const length,
On 2016/07/14 08:59:43, titzer wrote:
> This should have been named BuildXXX, since it builds the graph that does
> JITing, it itself doesn't do JITing.

I think in this module, they don't seem to use "Build" as the name for anything.
'CallIndirect' also builds a graph but doesn't do the indirect call. Should I
keep this for the sake of consistency or change it?

https://codereview.chromium.org/2137993003/diff/140001/src/messages.h
File src/messages.h (right):

https://codereview.chromium.org/2137993003/diff/140001/src/messages.h#newcode496
src/messages.h:496: T(WasmTrapInvalidIndex, "invalid index into function table")
On 2016/07/14 08:59:43, titzer wrote:
> This is the same condition as TrapFuncInvalid.

The point of this is to draw the distinction between calling a function that is
already hooked to the table and a slot in the table where a potential compiled
code would be hooked to. I thought this would be more appropriate as the
function doesn't exist yet at that particular index.

https://codereview.chromium.org/2137993003/diff/140001/src/runtime/runtime-wa...
File src/runtime/runtime-wasm.cc (right):

https://codereview.chromium.org/2137993003/diff/140001/src/runtime/runtime-wa...
src/runtime/runtime-wasm.cc:118: const int fixed_args = 6;
On 2016/07/14 08:59:43, titzer wrote:
> Most of this functionality should somehow be in src/wasm, since it uses lots
of
> internal details.

Acknowledged.

https://codereview.chromium.org/2137993003/diff/140001/test/mjsunit/wasm/jit-...
File test/mjsunit/wasm/jit-single-function.js (right):

https://codereview.chromium.org/2137993003/diff/140001/test/mjsunit/wasm/jit-...
test/mjsunit/wasm/jit-single-function.js:11: var module = (function () {
On 2016/07/14 08:59:44, titzer wrote:
> There should be additional cctests for this functionality, to keep the JS API
> out of the system under test.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698