Index: src/compiler/bytecode-analysis.cc |
diff --git a/src/compiler/bytecode-analysis.cc b/src/compiler/bytecode-analysis.cc |
index e1d425b8d8dfd04e49ed38bbfcbc344bcf897b8f..18aaa71418f1199fe39c33ab774c354297057b2c 100644 |
--- a/src/compiler/bytecode-analysis.cc |
+++ b/src/compiler/bytecode-analysis.cc |
@@ -161,7 +161,10 @@ void BytecodeAnalysis::Analyze() { |
int current_offset = iterator.current_offset(); |
if (bytecode == Bytecode::kJumpLoop) { |
- PushLoop(iterator.GetJumpTargetOffset(), current_offset); |
+ // Every byte up to and including the last byte within the backwards jump |
+ // instruction is considered part of the loop, set loop end accordingly. |
+ int loop_end = current_offset + iterator.current_bytecode_size() - 1; |
Michael Starzinger
2016/12/01 12:49:56
Jaro & Leszek: Please confirm that you are fine wi
Jarin
2016/12/01 13:49:29
lgtm.
Leszek Swirski
2016/12/01 13:50:00
Fine with me. You can remove the -1 if you change
Michael Starzinger
2016/12/01 13:57:44
Done.
|
+ PushLoop(iterator.GetJumpTargetOffset(), loop_end); |
// Save the last offset so that we can do another pass later. |
if (last_invalid_jumploop_offset == -1) { |