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

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

Issue 297183003: Reduce CPU usage when no isolates need to be profiled. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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.h ('k') | runtime/vm/profiler.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/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "lib/mirrors.h" 10 #include "lib/mirrors.h"
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 } 997 }
998 { 998 {
999 JSONArray features_array(&jsobj, "features"); 999 JSONArray features_array(&jsobj, "features");
1000 if (is_io_enabled) { 1000 if (is_io_enabled) {
1001 features_array.AddValue("io"); 1001 features_array.AddValue("io");
1002 } 1002 }
1003 } 1003 }
1004 } 1004 }
1005 1005
1006 1006
1007 void Isolate::ProfileInterrupt() { 1007 intptr_t Isolate::ProfileInterrupt() {
1008 if (profiler_data() == NULL) {
1009 // Profiler not setup for isolate.
1010 return 0;
1011 }
1012 if (profiler_data()->blocked()) {
1013 // Profiler blocked for this isolate.
1014 return 0;
1015 }
1008 InterruptableThreadState* state = thread_state(); 1016 InterruptableThreadState* state = thread_state();
1009 if (state == NULL) { 1017 if (state == NULL) {
1010 // Isolate is not scheduled on a thread. 1018 // Isolate is not scheduled on a thread.
1011 ProfileIdle(); 1019 ProfileIdle();
1012 return; 1020 return 1;
1013 } 1021 }
1014 ASSERT(state->id != Thread::kInvalidThreadId); 1022 ASSERT(state->id != Thread::kInvalidThreadId);
1015 ThreadInterrupter::InterruptThread(state); 1023 ThreadInterrupter::InterruptThread(state);
1024 return 1;
1016 } 1025 }
1017 1026
1018 1027
1019 void Isolate::ProfileIdle() { 1028 void Isolate::ProfileIdle() {
1020 vm_tag_counters_.Increment(vm_tag()); 1029 vm_tag_counters_.Increment(vm_tag());
1021 } 1030 }
1022 1031
1023 1032
1024 void Isolate::set_tag_table(const GrowableObjectArray& value) { 1033 void Isolate::set_tag_table(const GrowableObjectArray& value) {
1025 tag_table_ = value.raw(); 1034 tag_table_ = value.raw();
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 return func.raw(); 1204 return func.raw();
1196 } 1205 }
1197 1206
1198 1207
1199 void IsolateSpawnState::Cleanup() { 1208 void IsolateSpawnState::Cleanup() {
1200 SwitchIsolateScope switch_scope(isolate()); 1209 SwitchIsolateScope switch_scope(isolate());
1201 Dart::ShutdownIsolate(); 1210 Dart::ShutdownIsolate();
1202 } 1211 }
1203 1212
1204 } // namespace dart 1213 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698