Commit d173de89 authored by Pan, Tao's avatar Pan, Tao Committed by V8 LUCI CQ

[compiler] Add out of bytecode array to break condition of removing OSR

code cache logic

Previous break condition is meeting JumpLoop to loop nesting level 0,
this is probably a JumpLoop getting removed if it's dead code. Add out
of bytecode array to break condition for avoiding dead loop in the case
of the JumpLoop to loop nesting level 0 getting removed.

Bug: v8:12927
Change-Id: I854187a6e226c4537981ffbbb7e88f1584cf70e0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3686589Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Tao Pan <tao.pan@intel.com>
Cr-Commit-Position: refs/heads/main@{#80909}
parent 01fa999d
......@@ -281,7 +281,7 @@ void DeoptAllOsrLoopsContainingDeoptExit(Isolate* isolate, JSFunction function,
osr_codes[i].set_marked_for_deoptimization(true);
}
// Visit after the first loop-with-deopt is found
for (;; it.Advance()) {
for (; !it.done(); it.Advance()) {
// We're only interested in loop ranges.
if (it.current_bytecode() != interpreter::Bytecode::kJumpLoop) continue;
if (TryGetOptimizedOsrCode(isolate, vector, it, &code)) {
......@@ -293,7 +293,7 @@ void DeoptAllOsrLoopsContainingDeoptExit(Isolate* isolate, JSFunction function,
const int loop_nesting_level = it.GetImmediateOperand(1);
if (loop_nesting_level == 0) break;
}
DCHECK(!it.done());
if (it.done()) return;
// Revisit from start of outermost loop to deopt
DCHECK_LE(it.GetJumpTargetOffset(), deopt_exit_offset.ToInt());
for (it.SetOffset(it.GetJumpTargetOffset());
......
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