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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/isolate.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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
11 #include "vm/class_finalizer.h" 11 #include "vm/class_finalizer.h"
12 #include "vm/compiler.h" 12 #include "vm/compiler.h"
13 #include "vm/dart.h" 13 #include "vm/dart.h"
14 #include "vm/dart_api_impl.h" 14 #include "vm/dart_api_impl.h"
15 #include "vm/dart_api_message.h" 15 #include "vm/dart_api_message.h"
16 #include "vm/dart_api_state.h" 16 #include "vm/dart_api_state.h"
17 #include "vm/dart_entry.h" 17 #include "vm/dart_entry.h"
18 #include "vm/debuginfo.h" 18 #include "vm/debuginfo.h"
19 #include "vm/exceptions.h" 19 #include "vm/exceptions.h"
20 #include "vm/flags.h" 20 #include "vm/flags.h"
21 #include "vm/growable_array.h" 21 #include "vm/growable_array.h"
22 #include "vm/message.h" 22 #include "vm/message.h"
23 #include "vm/message_handler.h" 23 #include "vm/message_handler.h"
24 #include "vm/native_entry.h" 24 #include "vm/native_entry.h"
25 #include "vm/object.h" 25 #include "vm/object.h"
26 #include "vm/object_store.h" 26 #include "vm/object_store.h"
27 #include "vm/port.h" 27 #include "vm/port.h"
28 #include "vm/profiler.h"
28 #include "vm/resolver.h" 29 #include "vm/resolver.h"
29 #include "vm/reusable_handles.h" 30 #include "vm/reusable_handles.h"
30 #include "vm/service.h" 31 #include "vm/service.h"
31 #include "vm/stack_frame.h" 32 #include "vm/stack_frame.h"
32 #include "vm/symbols.h" 33 #include "vm/symbols.h"
33 #include "vm/tags.h" 34 #include "vm/tags.h"
34 #include "vm/timer.h" 35 #include "vm/timer.h"
35 #include "vm/unicode.h" 36 #include "vm/unicode.h"
36 #include "vm/verifier.h" 37 #include "vm/verifier.h"
37 #include "vm/version.h" 38 #include "vm/version.h"
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 1307
1307 1308
1308 DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) { 1309 DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) {
1309 CHECK_NO_ISOLATE(Isolate::Current()); 1310 CHECK_NO_ISOLATE(Isolate::Current());
1310 // TODO(16615): Validate isolate parameter. 1311 // TODO(16615): Validate isolate parameter.
1311 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 1312 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
1312 Isolate::SetCurrent(iso); 1313 Isolate::SetCurrent(iso);
1313 } 1314 }
1314 1315
1315 1316
1317 DART_EXPORT void Dart_IsolateBlocked() {
1318 Isolate* isolate = Isolate::Current();
1319 CHECK_ISOLATE(isolate);
1320 IsolateProfilerData* profiler_data = isolate->profiler_data();
1321 if (profiler_data == NULL) {
1322 return;
1323 }
1324 profiler_data->Block();
1325 }
1326
1327
1328 DART_EXPORT void Dart_IsolateUnblocked() {
1329 Isolate* isolate = Isolate::Current();
1330 CHECK_ISOLATE(isolate);
1331 IsolateProfilerData* profiler_data = isolate->profiler_data();
1332 if (profiler_data == NULL) {
1333 return;
1334 }
1335 profiler_data->Unblock();
1336 }
1337
1338
1316 DART_EXPORT void Dart_ExitIsolate() { 1339 DART_EXPORT void Dart_ExitIsolate() {
1317 CHECK_ISOLATE(Isolate::Current()); 1340 CHECK_ISOLATE(Isolate::Current());
1318 Isolate::SetCurrent(NULL); 1341 Isolate::SetCurrent(NULL);
1319 } 1342 }
1320 1343
1321 1344
1322 static uint8_t* ApiReallocate(uint8_t* ptr, 1345 static uint8_t* ApiReallocate(uint8_t* ptr,
1323 intptr_t old_size, 1346 intptr_t old_size,
1324 intptr_t new_size) { 1347 intptr_t new_size) {
1325 return Api::TopScope(Isolate::Current())->zone()->Realloc<uint8_t>( 1348 return Api::TopScope(Isolate::Current())->zone()->Realloc<uint8_t>(
(...skipping 3723 matching lines...) Expand 10 before | Expand all | Expand 10 after
5049 5072
5050 5073
5051 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( 5074 DART_EXPORT void Dart_RegisterRootServiceRequestCallback(
5052 const char* name, 5075 const char* name,
5053 Dart_ServiceRequestCallback callback, 5076 Dart_ServiceRequestCallback callback,
5054 void* user_data) { 5077 void* user_data) {
5055 Service::RegisterRootEmbedderCallback(name, callback, user_data); 5078 Service::RegisterRootEmbedderCallback(name, callback, user_data);
5056 } 5079 }
5057 5080
5058 } // namespace dart 5081 } // namespace dart
OLDNEW
« 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