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

Issue 2964943002: [wasm] Introduce instance types for WebAssembly.* objects. (Closed)

Created:
3 years, 5 months ago by titzer
Modified:
3 years, 5 months ago
CC:
Hannes Payer (out of office), jbroman+watch_chromium.org, v8-reviews_googlegroups.com, wasm-v8_google.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Introduce instance types for WebAssembly.* objects. This CL refactors the internal representation of JavaScript-exposed WebAssembly objects to be more like other such objects in V8. By introducing a new instance type for each of the JS-exposed types, we get more robust typechecking without using embedder fields (which were previously used when these objects where instance type JS_API_OBJECT). In addition to the new instance types, the subclasses X of JSObject (WasmInstanceObject, WasmMemoryObject, WasmModuleObject, WasmTableObject) now have appropriate Is##X() methods on Object and are now robust. BUG=v8:6547 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng Review-Url: https://codereview.chromium.org/2964943002 Cr-Commit-Position: refs/heads/master@{#46475} Committed: https://chromium.googlesource.com/v8/v8/+/17001a05c8ca848b75f3c667192bcf99bdcd42fd

Patch Set 1 #

Patch Set 2 : Fix stray semicolon issue #

Patch Set 3 : Fix instance type for WasmMemoryObject map. #

Total comments: 24

Patch Set 4 : Update v8heapconst.py #

Patch Set 5 : Define offsets for WebAssembly fields too. #

Patch Set 6 : Update v8heapconst.py again #

Total comments: 13

Patch Set 7 : Address rossberg comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+537 lines, -548 lines) Patch
M src/api.cc View 1 2 3 4 5 6 2 chunks +6 lines, -6 lines 0 comments Download
M src/compiler/types.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M src/deoptimizer.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M src/heap/heap.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 6 6 chunks +19 lines, -1 line 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 2 chunks +80 lines, -0 lines 0 comments Download
M src/objects-body-descriptors-inl.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 2 chunks +7 lines, -70 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M src/runtime/runtime-test.cc View 1 2 3 4 5 6 6 chunks +6 lines, -16 lines 0 comments Download
M src/runtime/runtime-wasm.cc View 1 chunk +1 line, -4 lines 0 comments Download
M src/value-serializer.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/value-serializer.cc View 1 2 3 4 5 6 4 chunks +11 lines, -10 lines 0 comments Download
M src/wasm/module-compiler.cc View 1 2 3 4 5 6 4 chunks +3 lines, -4 lines 0 comments Download
M src/wasm/wasm-debug.cc View 4 chunks +14 lines, -15 lines 0 comments Download
M src/wasm/wasm-interpreter.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/wasm/wasm-js.cc View 1 2 3 4 8 chunks +13 lines, -19 lines 0 comments Download
M src/wasm/wasm-module.h View 1 chunk +0 lines, -7 lines 0 comments Download
M src/wasm/wasm-module.cc View 5 chunks +12 lines, -13 lines 0 comments Download
M src/wasm/wasm-objects.h View 1 2 3 4 13 chunks +262 lines, -135 lines 0 comments Download
M src/wasm/wasm-objects.cc View 1 2 3 4 22 chunks +66 lines, -239 lines 0 comments Download
M test/cctest/wasm/test-run-wasm-module.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M tools/v8heapconst.py View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 48 (38 generated)
Igor Sheludko
I like the new approach. https://codereview.chromium.org/2964943002/diff/40001/src/wasm/wasm-objects.cc File src/wasm/wasm-objects.cc (right): https://codereview.chromium.org/2964943002/diff/40001/src/wasm/wasm-objects.cc#newcode19 src/wasm/wasm-objects.cc:19: #include "src/objects/object-macros.h" Same here ...
3 years, 5 months ago (2017-07-05 09:56:35 UTC) #20
titzer
https://codereview.chromium.org/2964943002/diff/40001/src/wasm/wasm-objects.cc File src/wasm/wasm-objects.cc (right): https://codereview.chromium.org/2964943002/diff/40001/src/wasm/wasm-objects.cc#newcode19 src/wasm/wasm-objects.cc:19: #include "src/objects/object-macros.h" On 2017/07/05 09:56:33, Igor Sheludko wrote: > ...
3 years, 5 months ago (2017-07-06 14:10:30 UTC) #25
titzer
PTAL On 2017/07/06 14:10:30, titzer wrote: > https://codereview.chromium.org/2964943002/diff/40001/src/wasm/wasm-objects.cc > File src/wasm/wasm-objects.cc (right): > > https://codereview.chromium.org/2964943002/diff/40001/src/wasm/wasm-objects.cc#newcode19 ...
3 years, 5 months ago (2017-07-06 14:26:19 UTC) #27
Igor Sheludko
lgtm
3 years, 5 months ago (2017-07-06 14:34:19 UTC) #28
ulan
lgtm
3 years, 5 months ago (2017-07-07 08:31:10 UTC) #33
rossberg
LGTM with comments https://codereview.chromium.org/2964943002/diff/100001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/2964943002/diff/100001/src/objects.h#newcode76 src/objects.h:76: // - WebAssemblyInstance These names don't ...
3 years, 5 months ago (2017-07-07 09:33:22 UTC) #35
titzer
https://codereview.chromium.org/2964943002/diff/100001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/2964943002/diff/100001/src/objects.h#newcode76 src/objects.h:76: // - WebAssemblyInstance On 2017/07/07 09:33:21, rossberg wrote: > ...
3 years, 5 months ago (2017-07-07 11:32:49 UTC) #36
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/2964943002/120001
3 years, 5 months ago (2017-07-07 12:26:08 UTC) #43
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/v8/v8/+/17001a05c8ca848b75f3c667192bcf99bdcd42fd
3 years, 5 months ago (2017-07-07 12:28:12 UTC) #46
ahaas
3 years, 5 months ago (2017-07-10 10:48:22 UTC) #48
Message was sent while issue was closed.
https://codereview.chromium.org/2964943002/diff/40001/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/2964943002/diff/40001/src/objects.h#newcode76
src/objects.h:76: //         - WebAssemblyInstance
I think this should be WasmInstance, for consistency.

https://codereview.chromium.org/2964943002/diff/100001/src/wasm/wasm-objects.h
File src/wasm/wasm-objects.h (right):

https://codereview.chromium.org/2964943002/diff/100001/src/wasm/wasm-objects....
src/wasm/wasm-objects.h:92: DEF_OFFSET(Functions)
Could you interleave the DEF_OFFSET lines with the DECL_ACCESSORS lines above? I
think it easier to have the same order for both of them.

Powered by Google App Engine
This is Rietveld 408576698