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

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

Issue 2989093002: [vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later … (Closed)
Patch Set: . Created 3 years, 4 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
« no previous file with comments | « runtime/observatory/tests/service/test_helper.dart ('k') | runtime/vm/flag_list.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 "vm/dart.h" 5 #include "vm/dart.h"
6 6
7 #include "vm/become.h" 7 #include "vm/become.h"
8 #include "vm/clustered_snapshot.h" 8 #include "vm/clustered_snapshot.h"
9 #include "vm/code_observers.h" 9 #include "vm/code_observers.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 Timeline::InitOnce(); 143 Timeline::InitOnce();
144 } 144 }
145 NOT_IN_PRODUCT( 145 NOT_IN_PRODUCT(
146 TimelineDurationScope tds(Timeline::GetVMStream(), "Dart::InitOnce")); 146 TimelineDurationScope tds(Timeline::GetVMStream(), "Dart::InitOnce"));
147 Isolate::InitOnce(); 147 Isolate::InitOnce();
148 PortMap::InitOnce(); 148 PortMap::InitOnce();
149 FreeListElement::InitOnce(); 149 FreeListElement::InitOnce();
150 ForwardingCorpse::InitOnce(); 150 ForwardingCorpse::InitOnce();
151 Api::InitOnce(); 151 Api::InitOnce();
152 NOT_IN_PRODUCT(CodeObservers::InitOnce()); 152 NOT_IN_PRODUCT(CodeObservers::InitOnce());
153 if (FLAG_profiler) { 153 NOT_IN_PRODUCT(Profiler::InitOnce());
154 ThreadInterrupter::InitOnce();
155 Profiler::InitOnce();
156 }
157 SemiSpace::InitOnce(); 154 SemiSpace::InitOnce();
158 NOT_IN_PRODUCT(Metric::InitOnce()); 155 NOT_IN_PRODUCT(Metric::InitOnce());
159 StoreBuffer::InitOnce(); 156 StoreBuffer::InitOnce();
160 MarkingStack::InitOnce(); 157 MarkingStack::InitOnce();
161 158
162 #if defined(USING_SIMULATOR) 159 #if defined(USING_SIMULATOR)
163 Simulator::InitOnce(); 160 Simulator::InitOnce();
164 #endif 161 #endif
165 // Create the read-only handles area. 162 // Create the read-only handles area.
166 ASSERT(predefined_handles_ == NULL); 163 ASSERT(predefined_handles_ == NULL);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 ASSERT(Isolate::Current() == NULL); 344 ASSERT(Isolate::Current() == NULL);
348 if (vm_isolate_ == NULL) { 345 if (vm_isolate_ == NULL) {
349 return "VM already terminated."; 346 return "VM already terminated.";
350 } 347 }
351 348
352 if (FLAG_trace_shutdown) { 349 if (FLAG_trace_shutdown) {
353 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Starting shutdown\n", 350 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Starting shutdown\n",
354 UptimeMillis()); 351 UptimeMillis());
355 } 352 }
356 353
357 if (FLAG_profiler) { 354 #if !defined(PRODUCT)
358 // Shut down profiling. 355 if (FLAG_trace_shutdown) {
359 if (FLAG_trace_shutdown) { 356 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Shutting down profiling\n",
360 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Shutting down profiling\n", 357 UptimeMillis());
361 UptimeMillis());
362 }
363 Profiler::Shutdown();
364 } 358 }
359 Profiler::Shutdown();
360 #endif // !defined(PRODUCT)
365 361
366 { 362 {
367 // Set the VM isolate as current isolate when shutting down 363 // Set the VM isolate as current isolate when shutting down
368 // Metrics so that we can use a StackZone. 364 // Metrics so that we can use a StackZone.
369 if (FLAG_trace_shutdown) { 365 if (FLAG_trace_shutdown) {
370 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Entering vm isolate\n", 366 OS::PrintErr("[+%" Pd64 "ms] SHUTDOWN: Entering vm isolate\n",
371 UptimeMillis()); 367 UptimeMillis());
372 } 368 }
373 bool result = Thread::EnterIsolate(vm_isolate_); 369 bool result = Thread::EnterIsolate(vm_isolate_);
374 ASSERT(result); 370 ASSERT(result);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 ASSERT(predefined_handles_ != NULL); 745 ASSERT(predefined_handles_ != NULL);
750 return predefined_handles_->handles_.IsValidScopedHandle(address); 746 return predefined_handles_->handles_.IsValidScopedHandle(address);
751 } 747 }
752 748
753 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 749 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
754 ASSERT(predefined_handles_ != NULL); 750 ASSERT(predefined_handles_ != NULL);
755 return predefined_handles_->api_handles_.IsValidHandle(handle); 751 return predefined_handles_->api_handles_.IsValidHandle(handle);
756 } 752 }
757 753
758 } // namespace dart 754 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/test_helper.dart ('k') | runtime/vm/flag_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698