[maglev] Only create phis for contexts of resumable loops
We need them there due to how they are restored on resume, but don't need them at all for other loops. Bug: v8:7700 Change-Id: I28a13ccf05d4fcd7bcf5fb8abef4dedd64f990f4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4197096 Commit-Queue: Victor Gomes <victorgomes@chromium.org> Auto-Submit: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Victor Gomes <victorgomes@chromium.org> Cr-Commit-Position: refs/heads/main@{#85498}
This commit is contained in:
parent
c97e61eaa3
commit
f2ceafb732
@ -106,9 +106,14 @@ MergePointInterpreterFrameState* MergePointInterpreterFrameState::NewForLoop(
|
||||
}
|
||||
++i;
|
||||
});
|
||||
// TODO(v8:7700): Add contexts into assignment analysis.
|
||||
frame_state.context(info) = state->NewLoopPhi(
|
||||
info.zone(), interpreter::Register::current_context(), merge_offset);
|
||||
frame_state.context(info) = nullptr;
|
||||
if (state->is_resumable_loop_) {
|
||||
// While contexts are always the same at specific locations, resumable loops
|
||||
// do have different nodes to set the context across resume points. Create a
|
||||
// phi for them.
|
||||
frame_state.context(info) = state->NewLoopPhi(
|
||||
info.zone(), interpreter::Register::current_context(), merge_offset);
|
||||
}
|
||||
frame_state.ForEachLocal(
|
||||
info, [&](ValueNode*& entry, interpreter::Register reg) {
|
||||
entry = nullptr;
|
||||
|
19
test/mjsunit/maglev/resumable-loop-context.js
Normal file
19
test/mjsunit/maglev/resumable-loop-context.js
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright 2023 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --maglev
|
||||
|
||||
async function __f_20() {
|
||||
try {
|
||||
for (let __v_58 = 0; __v_58 < 8; __v_58++) {
|
||||
}
|
||||
} catch (e) {}
|
||||
for (let __v_59 = 1; __v_59 < 1337; __v_59++) {
|
||||
function* __f_21() {}
|
||||
const __v_66 = __f_21();
|
||||
const __v_69 = await "-4294967296";
|
||||
}
|
||||
}
|
||||
|
||||
__f_20();
|
Loading…
Reference in New Issue
Block a user