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

Unified Diff: runtime/vm/bootstrap_natives.cc

Issue 227433004: Add runtime and native entry tags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bootstrap_natives.cc
diff --git a/runtime/vm/bootstrap_natives.cc b/runtime/vm/bootstrap_natives.cc
index 4682e987312524ecd8fe7ae2002ca960ed25b783..9d4e9216717954525479d5c77718b53e9c7cdddf 100644
--- a/runtime/vm/bootstrap_natives.cc
+++ b/runtime/vm/bootstrap_natives.cc
@@ -53,39 +53,62 @@ Dart_NativeFunction BootstrapNatives::Lookup(Dart_Handle name,
}
+const uint8_t* BootstrapNatives::Symbol(Dart_NativeFunction* nf) {
+ int num_entries = sizeof(BootStrapEntries) / sizeof(struct NativeEntries);
+ for (int i = 0; i < num_entries; i++) {
+ struct NativeEntries* entry = &(BootStrapEntries[i]);
+ if (reinterpret_cast<Dart_NativeFunction*>(entry->function_) == nf) {
+ return reinterpret_cast<const uint8_t*>(entry->name_);
+ }
+ }
+ return NULL;
+}
+
+
void Bootstrap::SetupNativeResolver() {
Library& library = Library::Handle();
Dart_NativeEntryResolver resolver =
reinterpret_cast<Dart_NativeEntryResolver>(BootstrapNatives::Lookup);
+ Dart_NativeEntrySymbol symbol_resolver =
+ reinterpret_cast<Dart_NativeEntrySymbol>(
+ BootstrapNatives::Symbol);
+
library = Library::AsyncLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+ library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::CoreLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+ library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::MathLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+ library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::MirrorsLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+ library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::InternalLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+ library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::IsolateLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+ library.set_native_entry_symbol_resolver(symbol_resolver);
library = Library::TypedDataLibrary();
ASSERT(!library.IsNull());
library.set_native_entry_resolver(resolver);
+ library.set_native_entry_symbol_resolver(symbol_resolver);
}
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698