• Clemens Hammacher's avatar
    [wasm] Split adding code from publishing it · 25d8a157
    Clemens Hammacher authored
    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: 's avatarBen Titzer <titzer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#60369}
    25d8a157
Name
Last commit
Last update
..
api Loading commit data...
asmjs Loading commit data...
assembler Loading commit data...
base Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
heap Loading commit data...
interpreter Loading commit data...
libplatform Loading commit data...
parser Loading commit data...
regress Loading commit data...
torque Loading commit data...
wasm Loading commit data...
zone Loading commit data...
BUILD.gn Loading commit data...
DEPS Loading commit data...
allocation-unittest.cc Loading commit data...
background-compile-task-unittest.cc Loading commit data...
bigint-unittest.cc Loading commit data...
cancelable-tasks-unittest.cc Loading commit data...
char-predicates-unittest.cc Loading commit data...
code-stub-assembler-unittest.cc Loading commit data...
code-stub-assembler-unittest.h Loading commit data...
conversions-unittest.cc Loading commit data...
counters-unittest.cc Loading commit data...
detachable-vector-unittest.cc Loading commit data...
eh-frame-iterator-unittest.cc Loading commit data...
eh-frame-writer-unittest.cc Loading commit data...
locked-queue-unittest.cc Loading commit data...
microtask-queue-unittest.cc Loading commit data...
object-unittest.cc Loading commit data...
register-configuration-unittest.cc Loading commit data...
run-all-unittests.cc Loading commit data...
source-position-table-unittest.cc Loading commit data...
strings-storage-unittest.cc Loading commit data...
test-helpers.cc Loading commit data...
test-helpers.h Loading commit data...
test-utils.cc Loading commit data...
test-utils.h Loading commit data...
testcfg.py Loading commit data...
unicode-unittest.cc Loading commit data...
unittests.status Loading commit data...
utils-unittest.cc Loading commit data...
value-serializer-unittest.cc Loading commit data...