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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 Profiler::InitAllocationSampleBuffer(); | 77 Profiler::InitAllocationSampleBuffer(); |
78 // Zero counters. | 78 // Zero counters. |
79 memset(&counters_, 0, sizeof(counters_)); | 79 memset(&counters_, 0, sizeof(counters_)); |
80 ThreadInterrupter::InitOnce(); | 80 ThreadInterrupter::InitOnce(); |
81 ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period); | 81 ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period); |
82 ThreadInterrupter::Startup(); | 82 ThreadInterrupter::Startup(); |
83 initialized_ = true; | 83 initialized_ = true; |
84 } | 84 } |
85 | 85 |
86 void Profiler::InitAllocationSampleBuffer() { | 86 void Profiler::InitAllocationSampleBuffer() { |
87 if (FLAG_profiler_native_memory && | 87 ASSERT(Profiler::allocation_sample_buffer_ == NULL); |
88 (Profiler::allocation_sample_buffer_ == NULL)) { | 88 if (FLAG_profiler_native_memory) { |
89 Profiler::allocation_sample_buffer_ = new AllocationSampleBuffer(); | 89 Profiler::allocation_sample_buffer_ = new AllocationSampleBuffer(); |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
93 void Profiler::Shutdown() { | 93 void Profiler::Shutdown() { |
94 if (!FLAG_profiler) { | 94 if (!FLAG_profiler) { |
95 return; | 95 return; |
96 } | 96 } |
97 ASSERT(initialized_); | 97 ASSERT(initialized_); |
98 ThreadInterrupter::Shutdown(); | 98 ThreadInterrupter::Shutdown(); |
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 } | 1693 } |
1694 | 1694 |
1695 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1695 ProcessedSampleBuffer::ProcessedSampleBuffer() |
1696 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1696 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
1697 ASSERT(code_lookup_table_ != NULL); | 1697 ASSERT(code_lookup_table_ != NULL); |
1698 } | 1698 } |
1699 | 1699 |
1700 #endif // !PRODUCT | 1700 #endif // !PRODUCT |
1701 | 1701 |
1702 } // namespace dart | 1702 } // namespace dart |
OLD | NEW |