Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: src/interpreter/control-flow-builders.h

Issue 1943383003: [interpreter] Always 'continue' loops by jumping forward to end of body. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/control-flow-builders.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/control-flow-builders.h
diff --git a/src/interpreter/control-flow-builders.h b/src/interpreter/control-flow-builders.h
index 7cccd701536dbb3279766b9159d63e03f796cc5d..8778b2656568080095728455d5e13bb9bda2db97 100644
--- a/src/interpreter/control-flow-builders.h
+++ b/src/interpreter/control-flow-builders.h
@@ -88,26 +88,21 @@ class LoopBuilder final : public BreakableControlFlowBuilder {
~LoopBuilder();
void LoopHeader(ZoneVector<BytecodeLabel>* additional_labels);
- void Condition() { builder()->Bind(&condition_); }
- void Next() { builder()->Bind(&next_); }
void JumpToHeader() { builder()->Jump(&loop_header_); }
void JumpToHeaderIfTrue() { builder()->JumpIfTrue(&loop_header_); }
+ void SetContinueTarget();
void EndLoop();
// This method is called when visiting continue statements in the AST.
- // Inserts a jump to a unbound label that is patched when the corresponding
- // SetContinueTarget is called.
+ // Inserts a jump to an unbound label that is patched when SetContinueTarget
+ // is called.
void Continue() { EmitJump(&continue_sites_); }
void ContinueIfTrue() { EmitJumpIfTrue(&continue_sites_); }
void ContinueIfUndefined() { EmitJumpIfUndefined(&continue_sites_); }
void ContinueIfNull() { EmitJumpIfNull(&continue_sites_); }
private:
- void SetContinueTarget(const BytecodeLabel& continue_target);
-
BytecodeLabel loop_header_;
- BytecodeLabel condition_;
- BytecodeLabel next_;
BytecodeLabel loop_end_;
// Unbound labels that identify jumps for continue statements in the code.
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/control-flow-builders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698