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

[wasm] Always use new Liftoff code in debugging mode

If new Liftoff code is generated but we already have either Liftoff or
TurboFan code, we still want to install and use the new Liftoff code if
we are in debugging.

This logic can probably be simplified again when the "tier down to
liftoff on Debugger.enable" logic is fully implemented. I left a TODO to
revisit the logic later.

R=thibaudm@chromium.org

Bug: v8:10147
Change-Id: Ie3a6bdf1cde4f1af884edc8cf1f1b5a507283a5c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2036089
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66129}
parent 7e364f12
......@@ -2587,6 +2587,7 @@ WasmCompilationResult ExecuteLiftoffCompilation(
result.protected_instructions = compiler->GetProtectedInstructions();
result.frame_slot_count = compiler->GetTotalFrameSlotCount();
result.tagged_parameter_slots = call_descriptor->GetTaggedParameterSlots();
result.func_index = func_index;
result.result_tier = ExecutionTier::kLiftoff;
if (debug_sidetable) {
*debug_sidetable = debug_sidetable_builder->GenerateDebugSideTable();
......
......@@ -1040,9 +1040,11 @@ 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];
bool update_code_table =
tier_down_ ? !prior_code || code->tier() == ExecutionTier::kLiftoff
: !prior_code || prior_code->tier() < code->tier();
// 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 ? code->tier() == ExecutionTier::kLiftoff
: !prior_code || prior_code->tier() < code->tier();
if (update_code_table) {
code_table_[slot_idx] = code.get();
if (prior_code) {
......
......@@ -8,5 +8,31 @@ Setting breakpoint at offset 49 on script wasm://wasm/18214bfe
Setting breakpoint at offset 45 on script wasm://wasm/18214bfe
Setting breakpoint at offset 47 on script wasm://wasm/18214bfe
Calling main(4)
Breaking on byte offset 45
Breaking on byte offset 47
Breaking on byte offset 49
Breaking on byte offset 51
Breaking on byte offset 53
Breaking on byte offset 54
Breaking on byte offset 45
Breaking on byte offset 47
Breaking on byte offset 49
Breaking on byte offset 51
Breaking on byte offset 53
Breaking on byte offset 54
Breaking on byte offset 45
Breaking on byte offset 47
Breaking on byte offset 49
Breaking on byte offset 51
Breaking on byte offset 53
Breaking on byte offset 54
Breaking on byte offset 45
Breaking on byte offset 47
Breaking on byte offset 49
Breaking on byte offset 51
Breaking on byte offset 53
Breaking on byte offset 54
Breaking on byte offset 45
Breaking on byte offset 47
exports.main returned!
Finished!
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