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

Unified Diff: runtime/vm/dart_api_impl.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/include/dart_api.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 4c04cba04ea5fe673abe48b4a715201a6fefb073..dfcb94cf479630bbd937d5d1a7d9f6017f9a0e7f 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -25,6 +25,7 @@
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/port.h"
+#include "vm/profiler.h"
#include "vm/resolver.h"
#include "vm/reusable_handles.h"
#include "vm/service.h"
@@ -1313,6 +1314,28 @@ DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) {
}
+DART_EXPORT void Dart_IsolateBlocked() {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ IsolateProfilerData* profiler_data = isolate->profiler_data();
+ if (profiler_data == NULL) {
+ return;
+ }
+ profiler_data->Block();
+}
+
+
+DART_EXPORT void Dart_IsolateUnblocked() {
+ Isolate* isolate = Isolate::Current();
+ CHECK_ISOLATE(isolate);
+ IsolateProfilerData* profiler_data = isolate->profiler_data();
+ if (profiler_data == NULL) {
+ return;
+ }
+ profiler_data->Unblock();
+}
+
+
DART_EXPORT void Dart_ExitIsolate() {
CHECK_ISOLATE(Isolate::Current());
Isolate::SetCurrent(NULL);
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698