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

Unified Diff: src/debug/debug.cc

Issue 2095893002: Use source position table for unoptimized code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 6 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/debug/debug.h ('k') | src/debug/liveedit.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index c69b04b0c8327f5dd95a90a8b8ddb945b2ecbe07..3eea5a12a7316103eff1988bb1c47702de85b155 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -96,7 +96,10 @@ BreakLocation::CodeIterator::CodeIterator(Handle<DebugInfo> debug_info,
BreakLocatorType type)
: Iterator(debug_info),
reloc_iterator_(debug_info->abstract_code()->GetCode(),
- GetModeMask(type)) {
+ GetModeMask(type)),
+ source_position_iterator_(
+ debug_info->abstract_code()->GetCode()->source_position_table()),
+ start_position_(debug_info_->shared()->start_position()) {
// There is at least one break location.
DCHECK(!Done());
Next();
@@ -104,8 +107,6 @@ BreakLocation::CodeIterator::CodeIterator(Handle<DebugInfo> debug_info,
int BreakLocation::CodeIterator::GetModeMask(BreakLocatorType type) {
int mask = 0;
- mask |= RelocInfo::ModeMask(RelocInfo::POSITION);
- mask |= RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION);
mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_RETURN);
mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CALL);
if (isolate()->is_tail_call_elimination_enabled()) {
@@ -129,30 +130,19 @@ void BreakLocation::CodeIterator::Next() {
first = false;
if (Done()) return;
- // Whenever a statement position or (plain) position is passed update the
- // current value of these.
- if (RelocInfo::IsPosition(rmode())) {
- if (RelocInfo::IsStatementPosition(rmode())) {
- statement_position_ = static_cast<int>(
- rinfo()->data() - debug_info_->shared()->start_position());
+ int offset = code_offset();
+ while (!source_position_iterator_.done() &&
+ source_position_iterator_.code_offset() <= offset) {
+ position_ = source_position_iterator_.source_position() - start_position_;
+ if (source_position_iterator_.is_statement()) {
+ statement_position_ = position_;
}
- // Always update the position as we don't want that to be before the
- // statement position.
- position_ = static_cast<int>(rinfo()->data() -
- debug_info_->shared()->start_position());
- DCHECK(position_ >= 0);
- DCHECK(statement_position_ >= 0);
- continue;
+ source_position_iterator_.Advance();
}
DCHECK(RelocInfo::IsDebugBreakSlot(rmode()) ||
RelocInfo::IsDebuggerStatement(rmode()));
- if (RelocInfo::IsDebugBreakSlotAtReturn(rmode())) {
jgruber 2016/06/27 09:32:42 Just for my understanding, why is this not needed
Yang 2016/06/27 10:30:22 We already have the correct source position attach
- // Set the positions to the end of the function.
- statement_position_ = position_ = ReturnPosition();
- }
-
break;
}
break_index_++;
« no previous file with comments | « src/debug/debug.h ('k') | src/debug/liveedit.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698