| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "vm/bootstrap.h" | 5 #include "vm/bootstrap.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/bootstrap_natives.h" | 9 #include "vm/bootstrap_natives.h" |
| 10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
| 11 #include "vm/object.h" | 11 #include "vm/object.h" |
| 12 #include "vm/object_store.h" | 12 #include "vm/object_store.h" |
| 13 #include "vm/service_isolate.h" |
| 13 | 14 |
| 14 namespace dart { | 15 namespace dart { |
| 15 | 16 |
| 16 // Helper macros for declaring and defining native entries. | 17 // Helper macros for declaring and defining native entries. |
| 17 #define REGISTER_NATIVE_ENTRY(name, count) \ | 18 #define REGISTER_NATIVE_ENTRY(name, count) \ |
| 18 { ""#name, BootstrapNatives::DN_##name, count }, | 19 { ""#name, BootstrapNatives::DN_##name, count }, |
| 19 | 20 |
| 20 | 21 |
| 21 // List all native functions implemented in the vm or core bootstrap dart | 22 // List all native functions implemented in the vm or core bootstrap dart |
| 22 // libraries so that we can resolve the native function to it's entry | 23 // libraries so that we can resolve the native function to it's entry |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 123 |
| 123 library = Library::ProfilerLibrary(); | 124 library = Library::ProfilerLibrary(); |
| 124 ASSERT(!library.IsNull()); | 125 ASSERT(!library.IsNull()); |
| 125 library.set_native_entry_resolver(resolver); | 126 library.set_native_entry_resolver(resolver); |
| 126 library.set_native_entry_symbol_resolver(symbol_resolver); | 127 library.set_native_entry_symbol_resolver(symbol_resolver); |
| 127 | 128 |
| 128 library = Library::TypedDataLibrary(); | 129 library = Library::TypedDataLibrary(); |
| 129 ASSERT(!library.IsNull()); | 130 ASSERT(!library.IsNull()); |
| 130 library.set_native_entry_resolver(resolver); | 131 library.set_native_entry_resolver(resolver); |
| 131 library.set_native_entry_symbol_resolver(symbol_resolver); | 132 library.set_native_entry_symbol_resolver(symbol_resolver); |
| 133 |
| 134 library = Library::VMServiceLibrary(); |
| 135 ASSERT(!library.IsNull()); |
| 136 library.set_native_entry_resolver( |
| 137 reinterpret_cast<Dart_NativeEntryResolver>( |
| 138 &ServiceIsolate::NativeResolver)); |
| 132 } | 139 } |
| 133 | 140 |
| 134 | 141 |
| 135 bool Bootstrap::IsBootstapResolver(Dart_NativeEntryResolver resolver) { | 142 bool Bootstrap::IsBootstapResolver(Dart_NativeEntryResolver resolver) { |
| 136 return (resolver == | 143 return (resolver == |
| 137 reinterpret_cast<Dart_NativeEntryResolver>(BootstrapNatives::Lookup)); | 144 reinterpret_cast<Dart_NativeEntryResolver>(BootstrapNatives::Lookup)); |
| 138 } | 145 } |
| 139 | 146 |
| 140 } // namespace dart | 147 } // namespace dart |
| OLD | NEW |