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

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

Issue 2518233003: Wire up the stub native resolver for all libraries in gen_snapshot (Closed)
Patch Set: rmacnak in person review Created 4 years, 1 month 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 "platform/assert.h" 9 #include "platform/assert.h"
10 #include "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 5847 matching lines...) Expand 10 before | Expand all | Expand 10 after
5858 const Library& lib = Api::UnwrapLibraryHandle(Z, library); 5858 const Library& lib = Api::UnwrapLibraryHandle(Z, library);
5859 if (lib.IsNull()) { 5859 if (lib.IsNull()) {
5860 RETURN_TYPE_ERROR(Z, library, Library); 5860 RETURN_TYPE_ERROR(Z, library, Library);
5861 } 5861 }
5862 lib.set_native_entry_resolver(resolver); 5862 lib.set_native_entry_resolver(resolver);
5863 lib.set_native_entry_symbol_resolver(symbol); 5863 lib.set_native_entry_symbol_resolver(symbol);
5864 return Api::Success(); 5864 return Api::Success();
5865 } 5865 }
5866 5866
5867 5867
5868 DART_EXPORT Dart_Handle
5869 Dart_GetNativeResolver(Dart_Handle library,
5870 Dart_NativeEntryResolver* resolver) {
siva 2016/11/22 20:48:47 if (resolver == NULL) { RETURN_NULL_ERROR(resolv
5871 *resolver = NULL;
5872 DARTSCOPE(Thread::Current());
5873 const Library& lib = Api::UnwrapLibraryHandle(Z, library);
5874 if (lib.IsNull()) {
5875 RETURN_TYPE_ERROR(Z, library, Library);
5876 }
5877 *resolver = lib.native_entry_resolver();
5878 return Api::Success();
5879 }
5880
5881
5882 DART_EXPORT Dart_Handle Dart_GetNativeSymbol(Dart_Handle library,
5883 Dart_NativeEntrySymbol* resolver) {
siva 2016/11/22 20:48:47 if (resolver == NULL) { RETURN_NULL_ERROR(resolv
5884 *resolver = NULL;
5885 DARTSCOPE(Thread::Current());
5886 const Library& lib = Api::UnwrapLibraryHandle(Z, library);
5887 if (lib.IsNull()) {
5888 RETURN_TYPE_ERROR(Z, library, Library);
5889 }
5890 *resolver = lib.native_entry_symbol_resolver();
5891 return Api::Success();
5892 }
5893
5868 // --- Peer support --- 5894 // --- Peer support ---
5869 5895
5870 DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer) { 5896 DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer) {
5871 if (peer == NULL) { 5897 if (peer == NULL) {
5872 RETURN_NULL_ERROR(peer); 5898 RETURN_NULL_ERROR(peer);
5873 } 5899 }
5874 Thread* thread = Thread::Current(); 5900 Thread* thread = Thread::Current();
5875 CHECK_ISOLATE(thread->isolate()); 5901 CHECK_ISOLATE(thread->isolate());
5876 REUSABLE_OBJECT_HANDLESCOPE(thread); 5902 REUSABLE_OBJECT_HANDLESCOPE(thread);
5877 Object& obj = thread->ObjectHandle(); 5903 Object& obj = thread->ObjectHandle();
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
6598 6624
6599 DART_EXPORT bool Dart_IsPrecompiledRuntime() { 6625 DART_EXPORT bool Dart_IsPrecompiledRuntime() {
6600 #if defined(DART_PRECOMPILED_RUNTIME) 6626 #if defined(DART_PRECOMPILED_RUNTIME)
6601 return true; 6627 return true;
6602 #else 6628 #else
6603 return false; 6629 return false;
6604 #endif 6630 #endif
6605 } 6631 }
6606 6632
6607 } // namespace dart 6633 } // 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