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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 328923002: Lazy loading of deferred libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 37317)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -4977,7 +4977,9 @@
if (library.IsNull()) {
library = Library::New(url_str);
library.Register();
- } else if (!library.LoadNotStarted()) {
+ } else if (library.LoadInProgress() ||
+ library.Loaded() ||
+ library.LoadError()) {
// The source for this library has either been loaded or is in the
// process of loading. Return an error.
return Api::NewError("%s: library '%s' has already been loaded.",
@@ -4992,8 +4994,8 @@
return result;
}
- // If this is the dart:builtin library, register it with the VM.
- if (url_str.Equals("dart:builtin")) {
+ // If this is the dart:_builtin library, register it with the VM.
+ if (url_str.Equals("dart:_builtin")) {
isolate->object_store()->set_builtin_library(library);
Dart_Handle state = Api::CheckIsolateState(isolate);
if (::Dart_IsError(state)) {
@@ -5039,7 +5041,8 @@
if (!library_prefix.IsNull()) {
library_prefix.AddImport(import_ns);
} else {
- library_prefix = LibraryPrefix::New(prefix_symbol, import_ns, false);
+ library_prefix =
+ LibraryPrefix::New(prefix_symbol, import_ns, false, library_vm);
library_vm.AddObject(library_prefix, prefix_symbol);
}
}
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698