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

Unified Diff: runtime/bin/builtin_gen_snapshot.cc

Issue 11360121: When building standalone Dart executable, put implementation of dart:io natives in a separate libra… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 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 | « runtime/bin/builtin.cc ('k') | runtime/bin/builtin_impl_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin_gen_snapshot.cc
diff --git a/runtime/bin/builtin.cc b/runtime/bin/builtin_gen_snapshot.cc
similarity index 83%
copy from runtime/bin/builtin.cc
copy to runtime/bin/builtin_gen_snapshot.cc
index f6d297e9c8435400cc0f83f30b2803f9a150fdfd..fd64f46bd9cfef863c6eda7adeba2be7ecad3fa4 100644
--- a/runtime/bin/builtin.cc
+++ b/runtime/bin/builtin_gen_snapshot.cc
@@ -30,6 +30,13 @@ Dart_Handle Builtin::Source(BuiltinLibraryId id) {
}
+Dart_NativeFunction Builtin::NativeLookup(Dart_Handle name,
+ int argument_count) {
+ UNREACHABLE();
+ return NULL;
+}
+
+
void Builtin::SetNativeResolver(BuiltinLibraryId id) {
UNREACHABLE();
}
@@ -45,7 +52,10 @@ Dart_Handle Builtin::LoadAndCheckLibrary(BuiltinLibraryId id) {
library = Dart_LoadLibrary(url, Source(id));
if (!Dart_IsError(library) && (builtin_libraries_[id].has_natives_)) {
// Setup the native resolver for built in library functions.
- DART_CHECK_VALID(Dart_SetNativeResolver(library, NativeLookup));
+ // Looks up native functions only in libdart_builtin, not libdart_io.
+ // This is for use in the snapshot generator, which should be
+ // independent of most of the dart:io C++ code.
+ DART_CHECK_VALID(Dart_SetNativeResolver(library, BuiltinNativeLookup));
}
if (builtin_libraries_[id].patch_url_ != NULL) {
ASSERT(builtin_libraries_[id].patch_source_ != NULL);
« no previous file with comments | « runtime/bin/builtin.cc ('k') | runtime/bin/builtin_impl_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698