| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 287 } |
| 288 | 288 |
| 289 void AddTick(bool exclusive) { | 289 void AddTick(bool exclusive) { |
| 290 if (exclusive) { | 290 if (exclusive) { |
| 291 exclusive_ticks_++; | 291 exclusive_ticks_++; |
| 292 } else { | 292 } else { |
| 293 inclusive_ticks_++; | 293 inclusive_ticks_++; |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 void DebugPrint() { |
| 298 printf("%s [%" Px ", %" Px ") %s\n", name_, start(), end(), |
| 299 KindToCString(kind_)); |
| 300 } |
| 301 |
| 297 void AddTickAtAddress(uintptr_t pc) { | 302 void AddTickAtAddress(uintptr_t pc) { |
| 298 const intptr_t length = address_table_->length(); | 303 const intptr_t length = address_table_->length(); |
| 299 intptr_t i = 0; | 304 intptr_t i = 0; |
| 300 for (; i < length; i++) { | 305 for (; i < length; i++) { |
| 301 AddressEntry& entry = (*address_table_)[i]; | 306 AddressEntry& entry = (*address_table_)[i]; |
| 302 if (entry.pc == pc) { | 307 if (entry.pc == pc) { |
| 303 entry.ticks++; | 308 entry.ticks++; |
| 304 return; | 309 return; |
| 305 } | 310 } |
| 306 if (entry.pc > pc) { | 311 if (entry.pc > pc) { |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 return false; | 778 return false; |
| 774 } | 779 } |
| 775 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp); | 780 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp); |
| 776 cursor += sizeof(fp); | 781 cursor += sizeof(fp); |
| 777 bool r = cursor >= lower_bound_ && cursor < stack_upper_; | 782 bool r = cursor >= lower_bound_ && cursor < stack_upper_; |
| 778 return r; | 783 return r; |
| 779 } | 784 } |
| 780 | 785 |
| 781 | 786 |
| 782 } // namespace dart | 787 } // namespace dart |
| OLD | NEW |