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

Unified Diff: vm/bootstrap.cc

Issue 8673002: - Refactor the isolate callback mechanism to also include creation of the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/isolate.cc ('k') | vm/bootstrap_natives.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/bootstrap.cc
===================================================================
--- vm/bootstrap.cc (revision 1955)
+++ vm/bootstrap.cc (working copy)
@@ -6,7 +6,6 @@
#include "include/dart_api.h"
-#include "vm/bootstrap_natives.h"
#include "vm/compiler.h"
#include "vm/dart_api_impl.h"
#include "vm/object.h"
@@ -16,43 +15,7 @@
DEFINE_FLAG(bool, print_bootstrap, false, "Print the bootstrap source.");
-// List all native functions implemented in the vm or core bootstrap dart
-// libraries so that we can resolve the native function to it's entry
-// point.
-static struct NativeEntries {
- const char* name_;
- Dart_NativeFunction function_;
- int argument_count_;
-} BootStrapEntries[] = {
- BOOTSTRAP_NATIVE_LIST(REGISTER_NATIVE_ENTRY)
-};
-
-static Dart_NativeFunction native_lookup(Dart_Handle name,
- int argument_count) {
- const Object& obj = Object::Handle(Api::UnwrapHandle(name));
- if (!obj.IsString()) {
- return NULL;
- }
- const char* function_name = obj.ToCString();
- ASSERT(function_name != NULL);
- int num_entries = sizeof(BootStrapEntries) / sizeof(struct NativeEntries);
- for (int i = 0; i < num_entries; i++) {
- struct NativeEntries* entry = &(BootStrapEntries[i]);
- if (!strncmp(function_name, entry->name_, strlen(entry->name_))) {
- if (entry->argument_count_ == argument_count) {
- return reinterpret_cast<Dart_NativeFunction>(entry->function_);
- } else {
- // Wrong number of arguments.
- // TODO(regis): Should we pass a buffer for error reporting?
- return NULL;
- }
- }
- }
- return NULL;
-}
-
-
RawScript* Bootstrap::LoadScript() {
const String& url = String::Handle(String::New("bootstrap", Heap::kOld));
const String& src = String::Handle(String::New(corelib_source_, Heap::kOld));
@@ -86,16 +49,4 @@
library.SetLoaded();
}
-
-void Bootstrap::SetupNativeResolver() {
- Library& library = Library::Handle(Library::CoreLibrary());
- ASSERT(!library.IsNull());
- library.set_native_entry_resolver(
- reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
- library = Library::CoreImplLibrary();
- ASSERT(!library.IsNull());
- library.set_native_entry_resolver(
- reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
-}
-
} // namespace dart
« no previous file with comments | « lib/isolate.cc ('k') | vm/bootstrap_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698