Skip to content

Commit 95d3566

Browse files
committed
Rename LoopContinue to IncrementLoopIteration
1 parent 04b7b21 commit 95d3566

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

boa_engine/src/bytecompiler/statement/loop.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl ByteCompiler<'_, '_> {
7979
}
8080
}
8181

82-
self.emit_opcode(Opcode::LoopContinue);
82+
self.emit_opcode(Opcode::IncrementLoopIteration);
8383

8484
if let Some(final_expr) = for_loop.final_expr() {
8585
self.compile_expr(final_expr, false);
@@ -154,7 +154,7 @@ impl ByteCompiler<'_, '_> {
154154

155155
let start_address = self.next_opcode_location();
156156
self.push_loop_control_info_for_of_in_loop(label, start_address, use_expr);
157-
self.emit_opcode(Opcode::LoopContinue);
157+
self.emit_opcode(Opcode::IncrementLoopIteration);
158158

159159
self.emit_opcode(Opcode::IteratorNext);
160160
self.emit_opcode(Opcode::IteratorDone);
@@ -277,7 +277,7 @@ impl ByteCompiler<'_, '_> {
277277
} else {
278278
self.push_loop_control_info_for_of_in_loop(label, start_address, use_expr);
279279
}
280-
self.emit_opcode(Opcode::LoopContinue);
280+
self.emit_opcode(Opcode::IncrementLoopIteration);
281281

282282
self.emit_opcode(Opcode::IteratorNext);
283283
if for_of_loop.r#await() {
@@ -409,7 +409,7 @@ impl ByteCompiler<'_, '_> {
409409
use_expr: bool,
410410
) {
411411
let start_address = self.next_opcode_location();
412-
self.emit_opcode(Opcode::LoopContinue);
412+
self.emit_opcode(Opcode::IncrementLoopIteration);
413413
self.push_loop_control_info(label, start_address, use_expr);
414414

415415
self.compile_expr(while_loop.condition(), true);
@@ -436,7 +436,7 @@ impl ByteCompiler<'_, '_> {
436436
self.push_loop_control_info(label, start_address, use_expr);
437437

438438
let condition_label_address = self.next_opcode_location();
439-
self.emit_opcode(Opcode::LoopContinue);
439+
self.emit_opcode(Opcode::IncrementLoopIteration);
440440
self.compile_expr(do_while_loop.cond(), true);
441441
let exit = self.jump_if_false();
442442

boa_engine/src/vm/code_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ impl CodeBlock {
571571
| Opcode::Super
572572
| Opcode::Return
573573
| Opcode::PopEnvironment
574-
| Opcode::LoopContinue
574+
| Opcode::IncrementLoopIteration
575575
| Opcode::CreateForInIterator
576576
| Opcode::GetIterator
577577
| Opcode::GetAsyncIterator

boa_engine/src/vm/flowgraph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl CodeBlock {
492492
| Opcode::ToBoolean
493493
| Opcode::This
494494
| Opcode::Super
495-
| Opcode::LoopContinue
495+
| Opcode::IncrementLoopIteration
496496
| Opcode::CreateForInIterator
497497
| Opcode::GetIterator
498498
| Opcode::GetAsyncIterator

boa_engine/src/vm/opcode/iteration/loop_ops.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ use crate::{
44
Context, JsResult,
55
};
66

7-
/// `LoopContinue` implements the Opcode Operation for `Opcode::LoopContinue`.
7+
/// `IncrementLoopIteration` implements the Opcode Operation for `Opcode::IncrementLoopIteration`.
88
///
99
/// Operation:
1010
/// - Pushes a clean environment onto the frame's `EnvEntryStack`.
1111
#[derive(Debug, Clone, Copy)]
12-
pub(crate) struct LoopContinue;
12+
pub(crate) struct IncrementLoopIteration;
1313

14-
impl Operation for LoopContinue {
15-
const NAME: &'static str = "LoopContinue";
16-
const INSTRUCTION: &'static str = "INST - LoopContinue";
14+
impl Operation for IncrementLoopIteration {
15+
const NAME: &'static str = "IncrementLoopIteration";
16+
const INSTRUCTION: &'static str = "INST - IncrementLoopIteration";
1717

1818
fn execute(context: &mut Context<'_>) -> JsResult<CompletionType> {
1919
let previous_iteration_count = context.vm.frame_mut().loop_iteration_count;

boa_engine/src/vm/opcode/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,12 +1368,14 @@ generate_impl! {
13681368
/// Stack: **=>**
13691369
PopEnvironment,
13701370

1371-
/// Clean up environments when a loop continues.
1371+
/// Increment loop itearation count.
1372+
///
1373+
/// Used for limiting the loop iteration.
13721374
///
13731375
/// Operands:
13741376
///
13751377
/// Stack: **=>**
1376-
LoopContinue,
1378+
IncrementLoopIteration,
13771379

13781380
/// Creates the ForInIterator of an object.
13791381
///

0 commit comments

Comments
 (0)