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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 077e7745dff9e9e04af947878e194e542b90d72f..d95cac55a5b90503b5fedee3ccd0c23f98da7dea 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1004,15 +1004,24 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
}
-void Isolate::ProfileInterrupt() {
+intptr_t Isolate::ProfileInterrupt() {
+ if (profiler_data() == NULL) {
+ // Profiler not setup for isolate.
+ return 0;
+ }
+ if (profiler_data()->blocked()) {
+ // Profiler blocked for this isolate.
+ return 0;
+ }
InterruptableThreadState* state = thread_state();
if (state == NULL) {
// Isolate is not scheduled on a thread.
ProfileIdle();
- return;
+ return 1;
}
ASSERT(state->id != Thread::kInvalidThreadId);
ThreadInterrupter::InterruptThread(state);
+ return 1;
}
« 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