Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index baa7ed73c9be8152d9801e5f662d8f210b6f20c9..92cdb49a9f6aa1897ea50992808c126bc0f85ec0 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -2714,6 +2714,7 @@ DeoptimizedFrameInfo::DeoptimizedFrameInfo(TranslatedState* state, |
Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { |
+ CHECK(code->instruction_start() <= pc && pc <= code->instruction_end()); |
SourcePosition last_position = SourcePosition::Unknown(); |
DeoptimizeReason last_reason = DeoptimizeReason::kNoReason; |
int last_deopt_id = kNoDeoptimizationId; |
@@ -2723,9 +2724,7 @@ Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { |
RelocInfo::ModeMask(RelocInfo::DEOPT_INLINING_ID); |
for (RelocIterator it(code, mask); !it.done(); it.next()) { |
RelocInfo* info = it.rinfo(); |
- if (info->pc() >= pc) { |
- return DeoptInfo(last_position, last_reason, last_deopt_id); |
- } |
+ if (info->pc() >= pc) break; |
if (info->rmode() == RelocInfo::DEOPT_SCRIPT_OFFSET) { |
int script_offset = static_cast<int>(info->data()); |
it.next(); |
@@ -2738,7 +2737,7 @@ Deoptimizer::DeoptInfo Deoptimizer::GetDeoptInfo(Code* code, Address pc) { |
last_reason = static_cast<DeoptimizeReason>(info->data()); |
} |
} |
- return DeoptInfo(SourcePosition::Unknown(), DeoptimizeReason::kNoReason, -1); |
+ return DeoptInfo(last_position, last_reason, last_deopt_id); |
} |