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

Unified Diff: src/debug.cc

Issue 1232803002: Debugger: refactor reloc info. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix mips Created 5 years, 5 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') | src/heap/mark-compact.cc » ('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 6a445f036b46a0fbf9e7b00759d386aa1ea861f6..1098f608c4c227cc752b36900892191581062a53 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -76,16 +76,27 @@ BreakLocation::BreakLocation(Handle<DebugInfo> debug_info, RelocInfo* rinfo,
BreakLocation::Iterator::Iterator(Handle<DebugInfo> debug_info,
BreakLocatorType type)
: debug_info_(debug_info),
- type_(type),
- reloc_iterator_(debug_info->code(),
- ~RelocInfo::ModeMask(RelocInfo::CODE_AGE_SEQUENCE)),
- reloc_iterator_original_(
- debug_info->original_code(),
- ~RelocInfo::ModeMask(RelocInfo::CODE_AGE_SEQUENCE)),
+ reloc_iterator_(debug_info->code(), GetModeMask(type)),
+ reloc_iterator_original_(debug_info->original_code(), GetModeMask(type)),
break_index_(-1),
position_(1),
statement_position_(1) {
- Next();
+ if (!RinfoDone()) Next();
+}
+
+
+int BreakLocation::Iterator::GetModeMask(BreakLocatorType type) {
+ int mask = 0;
+ mask |= RelocInfo::ModeMask(RelocInfo::POSITION);
+ mask |= RelocInfo::ModeMask(RelocInfo::STATEMENT_POSITION);
+ mask |= RelocInfo::ModeMask(RelocInfo::JS_RETURN);
+ mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CALL);
+ mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL);
+ if (type == ALL_BREAK_LOCATIONS) {
+ mask |= RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT_AT_POSITION);
+ mask |= RelocInfo::ModeMask(RelocInfo::DEBUGGER_STATEMENT);
+ }
+ return mask;
}
@@ -129,16 +140,9 @@ void BreakLocation::Iterator::Next() {
break;
}
- if (RelocInfo::IsDebugBreakSlot(rmode()) &&
- (type_ == ALL_BREAK_LOCATIONS ||
- RelocInfo::DebugBreakIsCall(rinfo()->data()))) {
- break;
- }
-
- if (RelocInfo::IsDebuggerStatement(rmode()) &&
- type_ == ALL_BREAK_LOCATIONS) {
- break;
- }
+ DCHECK(RelocInfo::IsDebugBreakSlot(rmode()) ||
+ RelocInfo::IsDebuggerStatement(rmode()));
+ break;
}
break_index_++;
}
@@ -1277,7 +1281,7 @@ bool Debug::StepNextContinue(BreakLocation* break_location,
// object.
bool Debug::IsDebugBreak(Address addr) {
Code* code = Code::GetCodeFromTargetAddress(addr);
- return code->is_debug_stub() && code->extra_ic_state() == DEBUG_BREAK;
+ return code->is_debug_stub();
}
@@ -1462,7 +1466,7 @@ static int ComputeCodeOffsetFromPcOffset(Code *code, int pc_offset) {
static int ComputePcOffsetFromCodeOffset(Code *code, int code_offset) {
DCHECK_EQ(code->kind(), Code::FUNCTION);
- int mask = RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
+ int mask = RelocInfo::kDebugBreakSlotMask |
RelocInfo::ModeMask(RelocInfo::CONST_POOL) |
RelocInfo::ModeMask(RelocInfo::VENEER_POOL);
int reloc = 0;
« no previous file with comments | « src/debug.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698