|
[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}
Total comments: 3
|
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:
Total messages: 18 (12 generated)
|