| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 "vm/profiler_service.h" | 5 #include "vm/profiler_service.h" |
| 6 | 6 |
| 7 #include "vm/growable_array.h" | 7 #include "vm/growable_array.h" |
| 8 #include "vm/native_symbol.h" | 8 #include "vm/native_symbol.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/os.h" | 10 #include "vm/os.h" |
| 11 #include "vm/profiler.h" | 11 #include "vm/profiler.h" |
| 12 #include "vm/reusable_handles.h" | 12 #include "vm/reusable_handles.h" |
| 13 #include "vm/scope_timer.h" | 13 #include "vm/scope_timer.h" |
| 14 | 14 |
| 15 namespace dart { | 15 namespace dart { |
| 16 | 16 |
| 17 DECLARE_FLAG(int, max_profile_depth); | 17 DECLARE_FLAG(int, max_profile_depth); |
| 18 DECLARE_FLAG(int, profile_period); | 18 DECLARE_FLAG(int, profile_period); |
| 19 | 19 |
| 20 DEFINE_FLAG(bool, trace_profiler, false, "Trace profiler."); | 20 DEFINE_FLAG(bool, trace_profiler, false, "Trace profiler."); |
| 21 | 21 |
| 22 #ifndef PRODUCT |
| 23 |
| 22 class DeoptimizedCodeSet : public ZoneAllocated { | 24 class DeoptimizedCodeSet : public ZoneAllocated { |
| 23 public: | 25 public: |
| 24 explicit DeoptimizedCodeSet(Isolate* isolate) | 26 explicit DeoptimizedCodeSet(Isolate* isolate) |
| 25 : previous_( | 27 : previous_( |
| 26 GrowableObjectArray::ZoneHandle(isolate->deoptimized_code_array())), | 28 GrowableObjectArray::ZoneHandle(isolate->deoptimized_code_array())), |
| 27 current_(GrowableObjectArray::ZoneHandle( | 29 current_(GrowableObjectArray::ZoneHandle( |
| 28 previous_.IsNull() ? GrowableObjectArray::null() : | 30 previous_.IsNull() ? GrowableObjectArray::null() : |
| 29 GrowableObjectArray::New())) { | 31 GrowableObjectArray::New())) { |
| 30 } | 32 } |
| 31 | 33 |
| (...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2400 Thread* thread = Thread::Current(); | 2402 Thread* thread = Thread::Current(); |
| 2401 Isolate* isolate = thread->isolate(); | 2403 Isolate* isolate = thread->isolate(); |
| 2402 | 2404 |
| 2403 // Disable thread interrupts while processing the buffer. | 2405 // Disable thread interrupts while processing the buffer. |
| 2404 DisableThreadInterruptsScope dtis(thread); | 2406 DisableThreadInterruptsScope dtis(thread); |
| 2405 | 2407 |
| 2406 ClearProfileVisitor clear_profile(isolate); | 2408 ClearProfileVisitor clear_profile(isolate); |
| 2407 sample_buffer->VisitSamples(&clear_profile); | 2409 sample_buffer->VisitSamples(&clear_profile); |
| 2408 } | 2410 } |
| 2409 | 2411 |
| 2412 #endif // !PRODUCT |
| 2413 |
| 2410 } // namespace dart | 2414 } // namespace dart |
| OLD | NEW |