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/address_sanitizer.h" | 5 #include "platform/address_sanitizer.h" |
6 #include "platform/memory_sanitizer.h" | 6 #include "platform/memory_sanitizer.h" |
7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
8 | 8 |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 sample, | 444 sample, |
445 sample_buffer, | 445 sample_buffer, |
446 skip_count), | 446 skip_count), |
447 pc_(reinterpret_cast<uword*>(pc)), | 447 pc_(reinterpret_cast<uword*>(pc)), |
448 fp_(reinterpret_cast<uword*>(fp)), | 448 fp_(reinterpret_cast<uword*>(fp)), |
449 sp_(reinterpret_cast<uword*>(sp)), | 449 sp_(reinterpret_cast<uword*>(sp)), |
450 stack_upper_(stack_upper), | 450 stack_upper_(stack_upper), |
451 stack_lower_(stack_lower), | 451 stack_lower_(stack_lower), |
452 has_exit_frame_(exited_dart_code) { | 452 has_exit_frame_(exited_dart_code) { |
453 if (exited_dart_code) { | 453 if (exited_dart_code) { |
| 454 // On windows the profiler does not run on the thread being profiled. |
| 455 #if defined(_WIN32) |
| 456 const StackFrameIterator::CrossThreadPolicy cross_thread_policy = |
| 457 StackFrameIterator::kAllowCrossThreadIteration; |
| 458 #else |
| 459 const StackFrameIterator::CrossThreadPolicy cross_thread_policy = |
| 460 StackFrameIterator::kNoCrossThreadIteration; |
| 461 #endif |
454 StackFrameIterator iterator(StackFrameIterator::kDontValidateFrames, | 462 StackFrameIterator iterator(StackFrameIterator::kDontValidateFrames, |
455 thread); | 463 thread, cross_thread_policy); |
456 pc_ = NULL; | 464 pc_ = NULL; |
457 fp_ = NULL; | 465 fp_ = NULL; |
458 sp_ = NULL; | 466 sp_ = NULL; |
459 if (!iterator.HasNextFrame()) { | 467 if (!iterator.HasNextFrame()) { |
460 return; | 468 return; |
461 } | 469 } |
462 // Ensure we are able to get to the exit frame. | 470 // Ensure we are able to get to the exit frame. |
463 StackFrame* frame = iterator.NextFrame(); | 471 StackFrame* frame = iterator.NextFrame(); |
464 if (!frame->IsExitFrame()) { | 472 if (!frame->IsExitFrame()) { |
465 return; | 473 return; |
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 | 1612 |
1605 | 1613 |
1606 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1614 ProcessedSampleBuffer::ProcessedSampleBuffer() |
1607 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1615 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
1608 ASSERT(code_lookup_table_ != NULL); | 1616 ASSERT(code_lookup_table_ != NULL); |
1609 } | 1617 } |
1610 | 1618 |
1611 #endif // !PRODUCT | 1619 #endif // !PRODUCT |
1612 | 1620 |
1613 } // namespace dart | 1621 } // namespace dart |
OLD | NEW |