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

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

Issue 2558673002: Add Kernel Isolate (Closed)
Patch Set: wip Created 4 years 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
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 "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
11 #include "vm/class_finalizer.h" 11 #include "vm/class_finalizer.h"
12 #include "vm/clustered_snapshot.h" 12 #include "vm/clustered_snapshot.h"
13 #include "vm/compiler.h" 13 #include "vm/compiler.h"
14 #include "vm/dart.h" 14 #include "vm/dart.h"
15 #include "vm/dart_api_impl.h" 15 #include "vm/dart_api_impl.h"
16 #include "vm/dart_api_message.h" 16 #include "vm/dart_api_message.h"
17 #include "vm/dart_api_state.h" 17 #include "vm/dart_api_state.h"
18 #include "vm/dart_entry.h" 18 #include "vm/dart_entry.h"
19 #include "vm/debugger.h" 19 #include "vm/debugger.h"
20 #if !defined(DART_PRECOMPILED_RUNTIME) 20 #if !defined(DART_PRECOMPILED_RUNTIME)
21 #include "vm/kernel_reader.h" 21 #include "vm/kernel_reader.h"
22 #endif 22 #endif
23 #include "vm/exceptions.h" 23 #include "vm/exceptions.h"
24 #include "vm/flags.h" 24 #include "vm/flags.h"
25 #include "vm/growable_array.h" 25 #include "vm/growable_array.h"
26 #include "vm/lockers.h" 26 #include "vm/lockers.h"
27 #include "vm/isolate_reload.h" 27 #include "vm/isolate_reload.h"
28 #include "vm/kernel_isolate.h"
28 #include "vm/message.h" 29 #include "vm/message.h"
29 #include "vm/message_handler.h" 30 #include "vm/message_handler.h"
30 #include "vm/native_entry.h" 31 #include "vm/native_entry.h"
31 #include "vm/object.h" 32 #include "vm/object.h"
32 #include "vm/object_store.h" 33 #include "vm/object_store.h"
33 #include "vm/os_thread.h" 34 #include "vm/os_thread.h"
34 #include "vm/os.h" 35 #include "vm/os.h"
35 #include "vm/port.h" 36 #include "vm/port.h"
36 #include "vm/precompiler.h" 37 #include "vm/precompiler.h"
37 #include "vm/profiler.h" 38 #include "vm/profiler.h"
(...skipping 5932 matching lines...) Expand 10 before | Expand all | Expand 10 after
5970 } 5971 }
5971 { 5972 {
5972 NoSafepointScope no_safepoint; 5973 NoSafepointScope no_safepoint;
5973 RawObject* raw_obj = obj.raw(); 5974 RawObject* raw_obj = obj.raw();
5974 thread->isolate()->heap()->SetPeer(raw_obj, peer); 5975 thread->isolate()->heap()->SetPeer(raw_obj, peer);
5975 } 5976 }
5976 return Api::Success(); 5977 return Api::Success();
5977 } 5978 }
5978 5979
5979 5980
5981 // --- Dart Front-End (Kernel) support ---
5982
5983 DART_EXPORT bool Dart_IsKernelIsolate(Dart_Isolate isolate) {
5984 #ifdef DART_PRECOMPILED_RUNTIME
5985 return false;
5986 #else
5987 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
5988 return KernelIsolate::IsKernelIsolate(iso);
5989 #endif
5990 }
5991
5992
5993 DART_EXPORT bool Dart_KernelIsolateIsRunning() {
5994 #ifdef DART_PRECOMPILED_RUNTIME
5995 return false;
5996 #else
5997 return KernelIsolate::IsRunning();
5998 #endif
5999 }
6000
6001
6002 DART_EXPORT Dart_Port Dart_ServiceWaitForKernelPort() {
6003 #ifdef DART_PRECOMPILED_RUNTIME
6004 return ILLEGAL_PORT;
6005 #else
6006 return KernelIsolate::WaitForKernelPort();
6007 #endif
6008 }
6009
6010 DART_EXPORT Dart_Port Dart_KernelPort() {
6011 #ifdef DART_PRECOMPILED_RUNTIME
6012 return false;
6013 #else
6014 return KernelIsolate::KernelPort();
6015 #endif
6016 }
6017
6018
5980 // --- Service support --- 6019 // --- Service support ---
5981 6020
5982 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) { 6021 DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate) {
5983 Isolate* iso = reinterpret_cast<Isolate*>(isolate); 6022 Isolate* iso = reinterpret_cast<Isolate*>(isolate);
5984 return ServiceIsolate::IsServiceIsolate(iso); 6023 return ServiceIsolate::IsServiceIsolate(iso);
5985 } 6024 }
5986 6025
5987 6026
5988 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() { 6027 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort() {
5989 return ServiceIsolate::WaitForLoadPort(); 6028 return ServiceIsolate::WaitForLoadPort();
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
6672 } 6711 }
6673 6712
6674 6713
6675 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6714 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6676 #ifndef PRODUCT 6715 #ifndef PRODUCT
6677 Profiler::DumpStackTrace(context); 6716 Profiler::DumpStackTrace(context);
6678 #endif 6717 #endif
6679 } 6718 }
6680 6719
6681 } // namespace dart 6720 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698