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

Unified Diff: src/debug.cc

Issue 1157543004: Debugger: PreservePositionScope should clear positions inside the scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: only break at inline caches if it owns a statement position. Created 5 years, 7 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.h ('k') | test/mjsunit/regress/regress-crbug-481896.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
diff --git a/src/debug.cc b/src/debug.cc
index b63e99dbd5247ca2ba048641b3162ee5811440ba..9cc4d74939d3b62ffa11d06d1161dd2d2a34935d 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -69,7 +69,8 @@ BreakLocation::Iterator::Iterator(Handle<DebugInfo> debug_info,
~RelocInfo::ModeMask(RelocInfo::CODE_AGE_SEQUENCE)),
break_index_(-1),
position_(1),
- statement_position_(1) {
+ statement_position_(1),
+ has_immediate_position_(false) {
Next();
}
@@ -99,6 +100,8 @@ void BreakLocation::Iterator::Next() {
debug_info_->shared()->start_position());
DCHECK(position_ >= 0);
DCHECK(statement_position_ >= 0);
+ has_immediate_position_ = true;
+ continue;
}
// Check for break at return.
@@ -112,7 +115,7 @@ void BreakLocation::Iterator::Next() {
}
statement_position_ = position_;
break_index_++;
- return;
+ break;
}
if (RelocInfo::IsCodeTarget(rmode())) {
@@ -124,24 +127,26 @@ void BreakLocation::Iterator::Next() {
if (RelocInfo::IsConstructCall(rmode()) || code->is_call_stub()) {
break_index_++;
- return;
+ break;
}
// Skip below if we only want locations for calls and returns.
if (type_ == CALLS_AND_RETURNS) continue;
- if ((code->is_inline_cache_stub() && !code->is_binary_op_stub() &&
+ // Only break at an inline cache if it has an immediate position attached.
+ if (has_immediate_position_ &&
+ (code->is_inline_cache_stub() && !code->is_binary_op_stub() &&
!code->is_compare_ic_stub() && !code->is_to_boolean_ic_stub())) {
break_index_++;
- return;
+ break;
}
if (code->kind() == Code::STUB) {
if (RelocInfo::IsDebuggerStatement(rmode())) {
break_index_++;
- return;
+ break;
} else if (CodeStub::GetMajorKey(code) == CodeStub::CallFunction) {
break_index_++;
- return;
+ break;
}
}
}
@@ -149,9 +154,10 @@ void BreakLocation::Iterator::Next() {
if (RelocInfo::IsDebugBreakSlot(rmode()) && type_ != CALLS_AND_RETURNS) {
// There is always a possible break point at a debug break slot.
break_index_++;
- return;
+ break;
}
}
+ has_immediate_position_ = false;
}
« no previous file with comments | « src/debug.h ('k') | test/mjsunit/regress/regress-crbug-481896.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698