aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/interpreter/control-flow-builders.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/interpreter/control-flow-builders.cc')
-rw-r--r--deps/v8/src/interpreter/control-flow-builders.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/deps/v8/src/interpreter/control-flow-builders.cc b/deps/v8/src/interpreter/control-flow-builders.cc
index 56cd481f9c..0e71b96cce 100644
--- a/deps/v8/src/interpreter/control-flow-builders.cc
+++ b/deps/v8/src/interpreter/control-flow-builders.cc
@@ -60,18 +60,14 @@ void LoopBuilder::LoopHeader(ZoneVector<BytecodeLabel>* additional_labels) {
}
}
-void LoopBuilder::JumpToHeader() {
+void LoopBuilder::JumpToHeader(int loop_depth) {
+ // Pass the proper loop nesting level to the backwards branch, to trigger
+ // on-stack replacement when armed for the given loop nesting depth.
+ int level = Min(loop_depth, AbstractCode::kMaxLoopNestingMarker - 1);
// Loop must have closed form, i.e. all loop elements are within the loop,
// the loop header precedes the body and next elements in the loop.
DCHECK(loop_header_.is_bound());
- builder()->Jump(&loop_header_);
-}
-
-void LoopBuilder::JumpToHeaderIfTrue() {
- // Loop must have closed form, i.e. all loop elements are within the loop,
- // the loop header precedes the body and next elements in the loop.
- DCHECK(loop_header_.is_bound());
- builder()->JumpIfTrue(&loop_header_);
+ builder()->JumpLoop(&loop_header_, level);
}
void LoopBuilder::EndLoop() {