| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/utils.h" | 5 #include "platform/utils.h" |
| 6 | 6 |
| 7 #include "vm/allocation.h" | 7 #include "vm/allocation.h" |
| 8 #include "vm/atomic.h" | 8 #include "vm/atomic.h" |
| 9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 } | 285 } |
| 286 | 286 |
| 287 void AddTick(bool exclusive) { | 287 void AddTick(bool exclusive) { |
| 288 if (exclusive) { | 288 if (exclusive) { |
| 289 exclusive_ticks_++; | 289 exclusive_ticks_++; |
| 290 } else { | 290 } else { |
| 291 inclusive_ticks_++; | 291 inclusive_ticks_++; |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| 295 void DebugPrint() { |
| 296 printf("%s [%" Px ", %" Px ") %s\n", name_, start(), end(), |
| 297 KindToCString(kind_)); |
| 298 } |
| 299 |
| 295 void AddTickAtAddress(uintptr_t pc) { | 300 void AddTickAtAddress(uintptr_t pc) { |
| 296 const intptr_t length = address_table_->length(); | 301 const intptr_t length = address_table_->length(); |
| 297 intptr_t i = 0; | 302 intptr_t i = 0; |
| 298 for (; i < length; i++) { | 303 for (; i < length; i++) { |
| 299 AddressEntry& entry = (*address_table_)[i]; | 304 AddressEntry& entry = (*address_table_)[i]; |
| 300 if (entry.pc == pc) { | 305 if (entry.pc == pc) { |
| 301 entry.ticks++; | 306 entry.ticks++; |
| 302 return; | 307 return; |
| 303 } | 308 } |
| 304 if (entry.pc > pc) { | 309 if (entry.pc > pc) { |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 return false; | 834 return false; |
| 830 } | 835 } |
| 831 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp); | 836 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp); |
| 832 cursor += sizeof(fp); | 837 cursor += sizeof(fp); |
| 833 bool r = cursor >= lower_bound_ && cursor < stack_upper_; | 838 bool r = cursor >= lower_bound_ && cursor < stack_upper_; |
| 834 return r; | 839 return r; |
| 835 } | 840 } |
| 836 | 841 |
| 837 | 842 |
| 838 } // namespace dart | 843 } // namespace dart |
| OLD | NEW |