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

Unified Diff: src/compiler/bytecode-analysis.cc

Issue 2465913002: [turbofan] Move OSR BailoutId translation into graph builder. (Closed)
Patch Set: Addressed comments. Created 4 years 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 | « no previous file | src/compiler/bytecode-graph-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-analysis.cc
diff --git a/src/compiler/bytecode-analysis.cc b/src/compiler/bytecode-analysis.cc
index e1d425b8d8dfd04e49ed38bbfcbc344bcf897b8f..8d077abc9f519eb0090726be60b9705e73f484e2 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();
+ PushLoop(iterator.GetJumpTargetOffset(), loop_end);
// Save the last offset so that we can do another pass later.
if (last_invalid_jumploop_offset == -1) {
@@ -296,7 +299,7 @@ bool BytecodeAnalysis::IsLoopHeader(int offset) const {
}
int BytecodeAnalysis::GetLoopOffsetFor(int offset) const {
- auto loop_end_to_header = end_to_header_.lower_bound(offset);
+ auto loop_end_to_header = end_to_header_.upper_bound(offset);
// If there is no next end => offset is not in a loop.
if (loop_end_to_header == end_to_header_.end()) {
return -1;
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698