v8/test/unittests/wasm
Clemens Hammacher 25d8a157b1 [wasm] Split adding code from publishing it
This prepares a refactoring to add and publish compilation results in
batches. For this, we need to separate the two phases, so that we can
lock the module, allocate all the code space, release the lock, copy
the code, lock the module, publish the code, and release the lock
again.
In particular, this CL does the following:
1) It removes the {AddOwnedCode} method. The functionality of creating
   the {WasmCode} and memcpy'ing the instruction into that is done in
   the other {Add*Code} methods. Adding to {owned_code_} is done in
   {PublishCode}.
2) {PublishInterpreterEntry} is now functionally equivalent to
   {PublishCode}, so it's removed.
3) After {AddCode}, the caller has to call {PublishCode}. In a
   follow-up CL, this will be called in batches (first {AddCode} them
   all, then {PublishCode} them all).
4) {AddCompiledCode} now assumes that the {WasmCompilationResult}
   succeeded. Otherwise, the caller should directly call {SetError} on
   the {CompilationState}.
5) {PublishCode} is now the chokepoint for installing code to the code
   table, the owned code vector, the jump table, and setting interpreter
   redirections. It replaces previous direct calls to {InstallCode} or
   explicitly adding to {owned_code_}.
6) Increasing the {generated_code_size_} counter is now done in
   {AllocateForCode}, which is the chokepoint for allocating space for
   generated code. This way, we will only increase this counter once
   once we allocate in batches.

R=titzer@chromium.org

Bug: v8:8916
Change-Id: I71e02e3a838f21797915cee3ebd373804fb12237
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1530817
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60369}
2019-03-20 13:39:11 +00:00
..
control-transfer-unittest.cc [wasm] [test] [cleanup] Add missing undefs 2017-09-11 12:09:50 +00:00
decoder-unittest.cc [ubsan] Fix numerical overflows in wasm 2019-01-10 12:24:51 +00:00
function-body-decoder-unittest.cc Revert "[wasm][anyref] Add support of call-indirect for multiple tables" 2019-03-20 11:52:37 +00:00
leb-helper-unittest.cc Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
loop-assignment-analysis-unittest.cc Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
module-decoder-unittest.cc [wasm-hint] Unit Test for Wasm Compilation Hints Decoder 2019-03-20 10:49:46 +00:00
OWNERS Reduce wasm OWNERS to current team members 2018-10-15 14:47:49 +00:00
streaming-decoder-unittest.cc [wasm][streaming] Report deterministic error location 2019-03-06 17:30:48 +00:00
trap-handler-posix-unittest.cc [wasm] Implement trap handler on Windows 2018-10-30 10:25:37 +00:00
trap-handler-win-unittest.cc [wasm] Implement trap handler on Windows 2018-10-30 10:25:37 +00:00
trap-handler-x64-unittest.cc test: Replace _TEST_CASE_ with _TEST_SUITE_. 2019-02-18 21:36:56 +00:00
wasm-code-manager-unittest.cc [wasm] Split adding code from publishing it 2019-03-20 13:39:11 +00:00
wasm-compiler-unittest.cc [wasm] Group anyref parameter 2018-12-12 10:45:01 +00:00
wasm-macro-gen-unittest.cc Normalize casing of hexadecimal digits 2017-12-02 01:24:40 +00:00
wasm-module-builder-unittest.cc Fix building with GCC 7.x and 8.x 2018-09-21 01:12:25 +00:00
wasm-opcodes-unittest.cc [wasm] [test] [cleanup] Add missing undefs 2017-09-11 12:09:50 +00:00