Commit cf382c89 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][debug] Prefer debug code in tiered down mode

We were still occasionally failing tests because sometimes non-debug
Liftoff code was published *after* debug Liftoff code. This would
overwrite the debug code and we would not stop on function entry then.
This fixes this by only preferring Liftoff code in publishing if it has
been compiled for debugging.
As a side effect, this will also prefer TurboFan code which has been
compiled for debugging (i.e. Liftoff bailed out), but this would only
happen for experimental features and in this case we will just overwrite
TurboFan code with TurboFan code, which is fine.

R=thibaudm@chromium.org

Bug: v8:10410
Change-Id: I6516e9f474f6118f0f0c077e6789f604ca128e74
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144122Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67123}
parent f2ea42d6
......@@ -1068,11 +1068,9 @@ WasmCode* NativeModule::PublishCodeLocked(std::unique_ptr<WasmCode> code) {
// tier.
uint32_t slot_idx = declared_function_index(module(), code->index());
WasmCode* prior_code = code_table_[slot_idx];
// TODO(clemensb): Revisit this logic once tier down is fully working.
const bool prefer_liftoff = tier_down_ || debug_info_;
const bool update_code_table =
prefer_liftoff ? !prior_code || code->tier() == ExecutionTier::kLiftoff
: !prior_code || prior_code->tier() < code->tier();
tier_down_ ? !prior_code || code->for_debugging()
: !prior_code || prior_code->tier() < code->tier();
if (update_code_table) {
code_table_[slot_idx] = code.get();
if (prior_code) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment