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

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

Issue 2998513002: [vm] Add a stub Dart_NotifyIdle() for the embedder to suggest a good time to do GC. (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/include/dart_api.h ('k') | no next file » | 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 "lib/stacktrace.h" 9 #include "lib/stacktrace.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1446 Isolate* I = T->isolate(); 1446 Isolate* I = T->isolate();
1447 CHECK_ISOLATE(I); 1447 CHECK_ISOLATE(I);
1448 NoSafepointScope no_safepoint_scope; 1448 NoSafepointScope no_safepoint_scope;
1449 if (I->sticky_error() != Error::null()) { 1449 if (I->sticky_error() != Error::null()) {
1450 Dart_Handle error = Api::NewHandle(T, I->sticky_error()); 1450 Dart_Handle error = Api::NewHandle(T, I->sticky_error());
1451 return error; 1451 return error;
1452 } 1452 }
1453 return Dart_Null(); 1453 return Dart_Null();
1454 } 1454 }
1455 1455
1456 DART_EXPORT void Dart_NotifyIdle(int64_t deadline) {
1457 Thread* T = Thread::Current();
1458 CHECK_ISOLATE(T->isolate());
1459 API_TIMELINE_BEGIN_END;
1460 }
1461
1456 DART_EXPORT void Dart_ExitIsolate() { 1462 DART_EXPORT void Dart_ExitIsolate() {
1457 Thread* T = Thread::Current(); 1463 Thread* T = Thread::Current();
1458 CHECK_ISOLATE(T->isolate()); 1464 CHECK_ISOLATE(T->isolate());
1459 // The Thread structure is disassociated from the isolate, we do the 1465 // The Thread structure is disassociated from the isolate, we do the
1460 // safepoint transition explicitly here instead of using the TransitionXXX 1466 // safepoint transition explicitly here instead of using the TransitionXXX
1461 // scope objects as the original transition happened outside this scope in 1467 // scope objects as the original transition happened outside this scope in
1462 // Dart_EnterIsolate/Dart_CreateIsolate. 1468 // Dart_EnterIsolate/Dart_CreateIsolate.
1463 ASSERT(T->execution_state() == Thread::kThreadInNative); 1469 ASSERT(T->execution_state() == Thread::kThreadInNative);
1464 T->ExitSafepoint(); 1470 T->ExitSafepoint();
1465 T->set_execution_state(Thread::kThreadInVM); 1471 T->set_execution_state(Thread::kThreadInVM);
(...skipping 5304 matching lines...) Expand 10 before | Expand all | Expand 10 after
6770 #endif 6776 #endif
6771 } 6777 }
6772 6778
6773 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6779 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6774 #ifndef PRODUCT 6780 #ifndef PRODUCT
6775 Profiler::DumpStackTrace(context); 6781 Profiler::DumpStackTrace(context);
6776 #endif 6782 #endif
6777 } 6783 }
6778 6784
6779 } // namespace dart 6785 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698