Commit 2e8703aa authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[interpreter] Make JumpLoop kill its block

Add JumpLoop to the list of bytecodes that unconditionally exit a
block, so that bytecodes are not emitted after a JumpLoop until there's
a bound label.

As a drive by, fix the bytecode random iterator's initialisation to use
'done()' directly (the old condition worked for Return, but was failing
for wide JumpLoops that ended the bytecode).

Change-Id: I63910602efbac8ad2b995a8fe6559a9f8f4b83b9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3419919
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78806}
parent 09784fa1
...@@ -20,7 +20,7 @@ BytecodeArrayRandomIterator::BytecodeArrayRandomIterator( ...@@ -20,7 +20,7 @@ BytecodeArrayRandomIterator::BytecodeArrayRandomIterator(
void BytecodeArrayRandomIterator::Initialize() { void BytecodeArrayRandomIterator::Initialize() {
// Run forwards through the bytecode array to determine the offset of each // Run forwards through the bytecode array to determine the offset of each
// bytecode. // bytecode.
while (current_offset() < bytecode_array()->length()) { while (!done()) {
offsets_.push_back(current_offset()); offsets_.push_back(current_offset());
Advance(); Advance();
} }
......
...@@ -238,6 +238,7 @@ void BytecodeArrayWriter::UpdateExitSeenInBlock(Bytecode bytecode) { ...@@ -238,6 +238,7 @@ void BytecodeArrayWriter::UpdateExitSeenInBlock(Bytecode bytecode) {
case Bytecode::kReThrow: case Bytecode::kReThrow:
case Bytecode::kAbort: case Bytecode::kAbort:
case Bytecode::kJump: case Bytecode::kJump:
case Bytecode::kJumpLoop:
case Bytecode::kJumpConstant: case Bytecode::kJumpConstant:
case Bytecode::kSuspendGenerator: case Bytecode::kSuspendGenerator:
exit_seen_in_block_ = true; exit_seen_in_block_ = true;
......
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