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

Unified Diff: runtime/bin/builtin.cc

Issue 9422019: isolates refactor: this change introduces 'dart:isolate' as a library. This is a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: '' Created 8 years, 10 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 | « lib/isolate/isolate_frog.dart ('k') | runtime/bin/dartutils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/builtin.cc
diff --git a/runtime/bin/builtin.cc b/runtime/bin/builtin.cc
index 8fa1d0e2f21d58950244fc554d747c834c377727..94c44e34d2295a94f3bb01d688b8af209c37fb4c 100644
--- a/runtime/bin/builtin.cc
+++ b/runtime/bin/builtin.cc
@@ -9,17 +9,12 @@
#include "bin/builtin.h"
#include "bin/dartutils.h"
-static void SetupCorelibImports(Dart_Handle builtin_lib) {
- // Lookup the core libraries and import the builtin library into them.
- Dart_Handle url = Dart_NewString(DartUtils::kCoreLibURL);
- Dart_Handle core_lib = Dart_LookupLibrary(url);
- DART_CHECK_VALID(core_lib);
- DART_CHECK_VALID(Dart_LibraryImportLibrary(core_lib, builtin_lib));
-
- url = Dart_NewString(DartUtils::kCoreImplLibURL);
- Dart_Handle coreimpl_lib = Dart_LookupLibrary(url);
- DART_CHECK_VALID(coreimpl_lib);
- DART_CHECK_VALID(Dart_LibraryImportLibrary(coreimpl_lib, builtin_lib));
+static void ImportBuiltinLibIntoLib(
+ const char* liburl, Dart_Handle builtin_lib) {
+ Dart_Handle url = Dart_NewString(liburl);
+ Dart_Handle lib = Dart_LookupLibrary(url);
+ DART_CHECK_VALID(lib);
+ DART_CHECK_VALID(Dart_LibraryImportLibrary(lib, builtin_lib));
}
@@ -53,8 +48,10 @@ void Builtin::SetupLibrary(Dart_Handle library, BuiltinLibraryId id) {
// No native resolver for these pure Dart libraries.
return;
} else if (id == kBuiltinLibrary) {
- // Setup core lib, builtin import structure.
- SetupCorelibImports(library);
+ // Import the builtin library into the core and isolate libraries.
+ ImportBuiltinLibIntoLib(DartUtils::kCoreLibURL, library);
+ ImportBuiltinLibIntoLib(DartUtils::kCoreImplLibURL, library);
+ ImportBuiltinLibIntoLib(DartUtils::kIsolateLibURL, library);
}
// Setup the native resolver for built in library functions.
DART_CHECK_VALID(Dart_SetNativeResolver(library, NativeLookup));
« no previous file with comments | « lib/isolate/isolate_frog.dart ('k') | runtime/bin/dartutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698