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

Issue 2540133002: [wasm] Remove raw byte pointers from WasmModule (Closed)

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

Description

[wasm] Remove raw byte pointers from WasmModule These byte pointers (module_start and module_end) were only valid during decoding. During instantiation or execution, they can get invalidated by garbage collection. This CL removes them from the WasmModule struct, and introduces a new ModuleStorage struct as interface to the wasm wire bytes. Since the storage is often needed together with the ModuleEnv, a new ModuleStorageEnv struct holds both a ModuleEnv and a ModuleStorage. The pointers in the ModuleStorage should never escape the live range of this struct, as they might point into a SeqOneByteString or ArrayBuffer. Therefore, the WasmInterpreter needs to create its own copy of the whole module. Runtime functions that previously used the raw pointers in WasmModule (leading to memory errors) now have to use the SeqOneByteString in the WasmCompiledModule. R=titzer@chromium.org BUG=chromium:669518 Committed: https://crrev.com/6572b5622ecb5311d05787a8e5c08795e0a50b57 Cr-Commit-Position: refs/heads/master@{#41388}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Address comments #

Patch Set 3 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -240 lines) Patch
M src/compiler/wasm-compiler.h View 1 5 chunks +7 lines, -4 lines 0 comments Download
M src/compiler/wasm-compiler.cc View 1 10 chunks +27 lines, -27 lines 0 comments Download
M src/vector.h View 1 chunk +1 line, -1 line 0 comments Download
M src/wasm/ast-decoder.cc View 4 chunks +10 lines, -10 lines 0 comments Download
M src/wasm/module-decoder.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/wasm/module-decoder.cc View 1 9 chunks +12 lines, -17 lines 0 comments Download
M src/wasm/wasm-interpreter.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/wasm/wasm-interpreter.cc View 1 6 chunks +18 lines, -15 lines 0 comments Download
M src/wasm/wasm-module.h View 1 7 chunks +71 lines, -44 lines 0 comments Download
M src/wasm/wasm-module.cc View 1 13 chunks +40 lines, -50 lines 0 comments Download
M src/wasm/wasm-text.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M src/wasm/wasm-text.cc View 1 3 chunks +7 lines, -8 lines 0 comments Download
M src/zone/zone-containers.h View 1 chunk +7 lines, -0 lines 0 comments Download
M test/cctest/wasm/test-run-wasm-asmjs.cc View 18 chunks +18 lines, -18 lines 0 comments Download
M test/cctest/wasm/test-run-wasm-module.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M test/cctest/wasm/wasm-run-utils.h View 1 4 chunks +10 lines, -8 lines 0 comments Download
M test/common/wasm/wasm-module-runner.h View 1 2 chunks +6 lines, -3 lines 0 comments Download
M test/common/wasm/wasm-module-runner.cc View 1 5 chunks +15 lines, -11 lines 0 comments Download
M test/fuzzer/wasm-call.cc View 1 1 chunk +4 lines, -3 lines 0 comments Download
M test/fuzzer/wasm-code.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M test/unittests/wasm/ast-decoder-unittest.cc View 7 chunks +6 lines, -12 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 18 (12 generated)
Clemens Hammacher
4 years ago (2016-11-30 12:41:45 UTC) #3
titzer
lgtm I like this refactoring, as it now makes everything explicit on where the bytes ...
4 years ago (2016-11-30 13:13:42 UTC) #6
Clemens Hammacher
https://codereview.chromium.org/2540133002/diff/1/src/wasm/wasm-module.h File src/wasm/wasm-module.h (right): https://codereview.chromium.org/2540133002/diff/1/src/wasm/wasm-module.h#newcode180 src/wasm/wasm-module.h:180: struct ModuleStorage; On 2016/11/30 at 13:13:42, titzer wrote: > ...
4 years ago (2016-11-30 14:28:45 UTC) #12
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/2540133002/40001
4 years ago (2016-11-30 14:28:50 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years ago (2016-11-30 15:02:50 UTC) #16
commit-bot: I haz the power
4 years ago (2016-11-30 15:03:22 UTC) #18
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/6572b5622ecb5311d05787a8e5c08795e0a50b57
Cr-Commit-Position: refs/heads/master@{#41388}

Powered by Google App Engine
This is Rietveld 408576698