| 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 14 matching lines...) Expand all Loading... |
| 25 // The stack frame walking code uses the frame pointer to traverse the stack. | 25 // The stack frame walking code uses the frame pointer to traverse the stack. |
| 26 // If the VM is compiled without frame pointers (which is the default on | 26 // If the VM is compiled without frame pointers (which is the default on |
| 27 // recent GCC versions with optimizing enabled) the stack walking code may | 27 // recent GCC versions with optimizing enabled) the stack walking code may |
| 28 // fail (sometimes leading to a crash). | 28 // fail (sometimes leading to a crash). |
| 29 // | 29 // |
| 30 | 30 |
| 31 #if defined(USING_SIMULATOR) || defined(TARGET_OS_WINDOWS) || \ | 31 #if defined(USING_SIMULATOR) || defined(TARGET_OS_WINDOWS) || \ |
| 32 defined(TARGET_OS_MACOS) || defined(TARGET_OS_ANDROID) | 32 defined(TARGET_OS_MACOS) || defined(TARGET_OS_ANDROID) |
| 33 DEFINE_FLAG(bool, profile, false, "Enable Sampling Profiler"); | 33 DEFINE_FLAG(bool, profile, false, "Enable Sampling Profiler"); |
| 34 #else | 34 #else |
| 35 DEFINE_FLAG(bool, profile, true, "Enable Sampling Profiler"); | 35 DEFINE_FLAG(bool, profile, false, "Enable Sampling Profiler"); |
| 36 #endif | 36 #endif |
| 37 DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates."); | 37 DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates."); |
| 38 DEFINE_FLAG(charp, profile_dir, NULL, | 38 DEFINE_FLAG(charp, profile_dir, NULL, |
| 39 "Enable writing profile data into specified directory."); | 39 "Enable writing profile data into specified directory."); |
| 40 DEFINE_FLAG(int, profile_period, 1000, | 40 DEFINE_FLAG(int, profile_period, 1000, |
| 41 "Time between profiler samples in microseconds. Minimum 250."); | 41 "Time between profiler samples in microseconds. Minimum 250."); |
| 42 | 42 |
| 43 bool Profiler::initialized_ = false; | 43 bool Profiler::initialized_ = false; |
| 44 Monitor* Profiler::monitor_ = NULL; | 44 Monitor* Profiler::monitor_ = NULL; |
| 45 SampleBuffer* Profiler::sample_buffer_ = NULL; | 45 SampleBuffer* Profiler::sample_buffer_ = NULL; |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 return false; | 791 return false; |
| 792 } | 792 } |
| 793 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp); | 793 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp); |
| 794 cursor += sizeof(fp); | 794 cursor += sizeof(fp); |
| 795 bool r = cursor >= lower_bound_ && cursor < stack_upper_; | 795 bool r = cursor >= lower_bound_ && cursor < stack_upper_; |
| 796 return r; | 796 return r; |
| 797 } | 797 } |
| 798 | 798 |
| 799 | 799 |
| 800 } // namespace dart | 800 } // namespace dart |
| OLD | NEW |