Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: runtime/vm/profiler.cc

Issue 128653004: Use list of isolates in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread_interrupter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 const int kMaximumDepth = 128; 43 const int kMaximumDepth = 128;
44 // Place some sane restrictions on user controlled flags. 44 // Place some sane restrictions on user controlled flags.
45 if (FLAG_profile_period < kMinimumProfilePeriod) { 45 if (FLAG_profile_period < kMinimumProfilePeriod) {
46 FLAG_profile_period = kMinimumProfilePeriod; 46 FLAG_profile_period = kMinimumProfilePeriod;
47 } 47 }
48 if (FLAG_profile_depth < kMinimumDepth) { 48 if (FLAG_profile_depth < kMinimumDepth) {
49 FLAG_profile_depth = kMinimumDepth; 49 FLAG_profile_depth = kMinimumDepth;
50 } else if (FLAG_profile_depth > kMaximumDepth) { 50 } else if (FLAG_profile_depth > kMaximumDepth) {
51 FLAG_profile_depth = kMaximumDepth; 51 FLAG_profile_depth = kMaximumDepth;
52 } 52 }
53 // We must always initialize the Sample, even when the profiler is disabled.
53 Sample::InitOnce(); 54 Sample::InitOnce();
54 if (!FLAG_profile) { 55 if (!FLAG_profile) {
55 return; 56 return;
56 } 57 }
57 ASSERT(!initialized_); 58 ASSERT(!initialized_);
58 sample_buffer_ = new SampleBuffer(); 59 sample_buffer_ = new SampleBuffer();
59 NativeSymbolResolver::InitOnce(); 60 NativeSymbolResolver::InitOnce();
60 ThreadInterrupter::InitOnce();
61 ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period); 61 ThreadInterrupter::SetInterruptPeriod(FLAG_profile_period);
62 ThreadInterrupter::Startup();
62 initialized_ = true; 63 initialized_ = true;
63 } 64 }
64 65
65 66
66 void Profiler::Shutdown() { 67 void Profiler::Shutdown() {
67 if (!FLAG_profile) { 68 if (!FLAG_profile) {
68 return; 69 return;
69 } 70 }
70 ASSERT(initialized_); 71 ASSERT(initialized_);
71 ThreadInterrupter::Shutdown(); 72 ThreadInterrupter::Shutdown();
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 return false; 836 return false;
836 } 837 }
837 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp); 838 uintptr_t cursor = reinterpret_cast<uintptr_t>(fp);
838 cursor += sizeof(fp); 839 cursor += sizeof(fp);
839 bool r = cursor >= lower_bound_ && cursor < stack_upper_; 840 bool r = cursor >= lower_bound_ && cursor < stack_upper_;
840 return r; 841 return r;
841 } 842 }
842 843
843 844
844 } // namespace dart 845 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread_interrupter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698