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

Unified Diff: runtime/vm/debugger.cc

Issue 137003006: Make safe points in generated code invisible to the debugger (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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 | « no previous file | runtime/vm/debugger_api_impl_test.cc » ('j') | runtime/vm/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 31959)
+++ runtime/vm/debugger.cc (working copy)
@@ -690,7 +690,7 @@
}
-static bool IsSafePoint(PcDescriptors::Kind kind) {
+static bool IsSafeDescKind(PcDescriptors::Kind kind) {
return ((kind == PcDescriptors::kIcCall) ||
(kind == PcDescriptors::kOptStaticCall) ||
(kind == PcDescriptors::kUnoptStaticCall) ||
@@ -700,6 +700,12 @@
}
+static bool IsSafePoint(const PcDescriptors& desc, intptr_t i) {
+ return IsSafeDescKind(desc.DescriptorKind(i)) &&
+ (desc.TokenPos(i) != Scanner::kDummyTokenIndex);
+}
+
+
CodeBreakpoint::CodeBreakpoint(const Function& func, intptr_t pc_desc_index)
: function_(func.raw()),
pc_desc_index_(pc_desc_index),
@@ -715,11 +721,11 @@
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
ASSERT(pc_desc_index < desc.Length());
token_pos_ = desc.TokenPos(pc_desc_index);
- ASSERT(token_pos_ >= 0);
+ ASSERT(token_pos_ > 0);
pc_ = desc.PC(pc_desc_index);
ASSERT(pc_ != 0);
breakpoint_kind_ = desc.DescriptorKind(pc_desc_index);
- ASSERT(IsSafePoint(breakpoint_kind_));
+ ASSERT(IsSafeDescKind(breakpoint_kind_));
}
@@ -964,7 +970,7 @@
ASSERT(!code.IsNull());
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
for (intptr_t i = 0; i < desc.Length(); i++) {
- if (IsSafePoint(desc.DescriptorKind(i))) {
+ if (IsSafePoint(desc, i)) {
CodeBreakpoint* bpt = GetCodeBreakpoint(desc.PC(i));
if (bpt != NULL) {
// There is already a breakpoint for this address. Make sure
@@ -1259,7 +1265,7 @@
// This descriptor is before the first acceptable token position.
continue;
}
- if (IsSafePoint(desc.DescriptorKind(i))) {
+ if (IsSafePoint(desc, i)) {
if (desc_token_pos < best_fit_pos) {
// So far, this descriptor has the lowest token position after
// the first acceptable token position.
@@ -1296,8 +1302,7 @@
PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
for (intptr_t i = 0; i < desc.Length(); i++) {
intptr_t desc_token_pos = desc.TokenPos(i);
- if ((desc_token_pos == bpt->token_pos_) &&
- IsSafePoint(desc.DescriptorKind(i))) {
+ if ((desc_token_pos == bpt->token_pos_) && IsSafePoint(desc, i)) {
CodeBreakpoint* code_bpt = GetCodeBreakpoint(desc.PC(i));
if (code_bpt == NULL) {
// No code breakpoint for this code exists; create one.
« no previous file with comments | « no previous file | runtime/vm/debugger_api_impl_test.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698