| 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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 if (FLAG_profile_vm) { | 705 if (FLAG_profile_vm) { |
| 706 // Always walk the native stack collecting both native and Dart frames. | 706 // Always walk the native stack collecting both native and Dart frames. |
| 707 native_stack_walker->walk(); | 707 native_stack_walker->walk(); |
| 708 } else if (StubCode::HasBeenInitialized() && exited_dart_code) { | 708 } else if (StubCode::HasBeenInitialized() && exited_dart_code) { |
| 709 // We have a valid exit frame info, use the Dart stack walker. | 709 // We have a valid exit frame info, use the Dart stack walker. |
| 710 dart_exit_stack_walker->walk(); | 710 dart_exit_stack_walker->walk(); |
| 711 } else if (StubCode::HasBeenInitialized() && in_dart_code) { | 711 } else if (StubCode::HasBeenInitialized() && in_dart_code) { |
| 712 // We are executing Dart code. We have frame pointers. | 712 // We are executing Dart code. We have frame pointers. |
| 713 dart_stack_walker->walk(); | 713 dart_stack_walker->walk(); |
| 714 } else { | 714 } else { |
| 715 sample->set_vm_tag(VMTag::kEmbedderTagId); | |
| 716 sample->SetAt(0, pc); | 715 sample->SetAt(0, pc); |
| 717 } | 716 } |
| 718 | 717 |
| 719 #if defined(TARGET_OS_WINDOWS) | 718 #if defined(TARGET_OS_WINDOWS) |
| 720 // Use structured exception handling to trap guard page access. | 719 // Use structured exception handling to trap guard page access. |
| 721 } __except(GuardPageExceptionFilter(GetExceptionInformation())) { | 720 } __except(GuardPageExceptionFilter(GetExceptionInformation())) { |
| 722 // Sample collection triggered a guard page fault: | 721 // Sample collection triggered a guard page fault: |
| 723 // 1) discard entire sample. | 722 // 1) discard entire sample. |
| 724 sample->set_ignore_sample(true); | 723 sample->set_ignore_sample(true); |
| 725 | 724 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 ProfilerDartExitStackWalker dart_exit_stack_walker(thread, | 915 ProfilerDartExitStackWalker dart_exit_stack_walker(thread, |
| 917 isolate, | 916 isolate, |
| 918 sample, | 917 sample, |
| 919 sample_buffer); | 918 sample_buffer); |
| 920 dart_exit_stack_walker.walk(); | 919 dart_exit_stack_walker.walk(); |
| 921 } else { | 920 } else { |
| 922 // Fall back. | 921 // Fall back. |
| 923 uintptr_t pc = GetProgramCounter(); | 922 uintptr_t pc = GetProgramCounter(); |
| 924 Sample* sample = SetupSample(thread, sample_buffer, os_thread->id()); | 923 Sample* sample = SetupSample(thread, sample_buffer, os_thread->id()); |
| 925 sample->SetAllocationCid(cid); | 924 sample->SetAllocationCid(cid); |
| 926 sample->set_vm_tag(VMTag::kEmbedderTagId); | |
| 927 sample->SetAt(0, pc); | 925 sample->SetAt(0, pc); |
| 928 } | 926 } |
| 929 } | 927 } |
| 930 | 928 |
| 931 | 929 |
| 932 void Profiler::SampleThread(Thread* thread, | 930 void Profiler::SampleThread(Thread* thread, |
| 933 const InterruptedThreadState& state) { | 931 const InterruptedThreadState& state) { |
| 934 ASSERT(thread != NULL); | 932 ASSERT(thread != NULL); |
| 935 OSThread* os_thread = thread->os_thread(); | 933 OSThread* os_thread = thread->os_thread(); |
| 936 ASSERT(os_thread != NULL); | 934 ASSERT(os_thread != NULL); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1363 } | 1361 } |
| 1364 } | 1362 } |
| 1365 | 1363 |
| 1366 | 1364 |
| 1367 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1365 ProcessedSampleBuffer::ProcessedSampleBuffer() |
| 1368 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1366 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
| 1369 ASSERT(code_lookup_table_ != NULL); | 1367 ASSERT(code_lookup_table_ != NULL); |
| 1370 } | 1368 } |
| 1371 | 1369 |
| 1372 } // namespace dart | 1370 } // namespace dart |
| OLD | NEW |