• Andreas Haas's avatar
    [wasm][liftoff] Delay use counter decrement of PeekToRegister · 48ead1a8
    Andreas Haas authored
    This CL fixes a bug in the code generation for I32AtomicCompareExchange
    in Liftoff on ia32. The problem is the inconsistency that
    LiftoffAssembler::PeekToRegister(...) introduces to the cache state.
    PeekToRegister loads the value from the value stack into a register, but
    does not pop the value off the stack. When the value was already stored
    in a register, the use counter of that register gets decreased, even
    though the value is still on the stack.
    
    The problem arises when this register later gets reused, which is
    necessary unfortunately on ia32. When SpillRegister is called for this
    register, all stack values that are stored in this register get written
    to memory. SpillRegister uses the use counter of the register to detect
    when the register was spilled to all stack slots that were cached by
    this register. However, as described above, the value stack and the use
    counter are inconsistent at that moment, so SpillRegister finishes
    early and does not spill the register to all stack values, and this
    causes the bug later.
    
    With this CL the decrement of the use counter gets delayed until when
    the value actually gets popped off the stack.
    
    R=clemensb@chromium.org
    
    Bug: chromium:1145135
    Change-Id: I07cb256a7e5135dbce41b246c120650635ad2758
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2602464Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#72018}
    48ead1a8
Name
Last commit
Last update
..
api Loading commit data...
asmjs Loading commit data...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...