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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1955453002: - Use a map to lookup libraries by URL. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix precompiler handling. Created 4 years, 7 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
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 9dcaa4b3fee1d0dea533754dbcc75454e53ea837..a1739644e139b6e58a40a9bf0a4e918123194b64 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -2841,8 +2841,8 @@ static RawObject* ThrowArgumentError(const char* exception_message) {
// Lookup the class ArgumentError in dart:core.
const String& lib_url = String::Handle(String::New("dart:core"));
const String& class_name = String::Handle(String::New("ArgumentError"));
- const Library& lib =
- Library::Handle(zone, Library::LookupLibrary(lib_url));
+ const Library& lib = Library::Handle(zone,
+ Library::LookupLibrary(thread, lib_url));
if (lib.IsNull()) {
const String& message = String::Handle(
String::NewFormatted("%s: library '%s' not found.",
@@ -4994,7 +4994,7 @@ RawString* Api::GetEnvironmentValue(Thread* thread, const String& name) {
const String& dart_library_name =
String::Handle(String::Concat(Symbols::DartScheme(), library_name));
const Library& library =
- Library::Handle(Library::LookupLibrary(dart_library_name));
+ Library::Handle(Library::LookupLibrary(thread, dart_library_name));
if (!library.IsNull()) {
return Symbols::True().raw();
}
@@ -5147,7 +5147,7 @@ DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url,
library = Library::New(url_str);
library.set_debuggable(true);
- library.Register();
+ library.Register(T);
I->object_store()->set_root_library(library);
const Script& script = Script::Handle(Z,
@@ -5348,7 +5348,8 @@ DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url) {
if (url_str.IsNull()) {
RETURN_TYPE_ERROR(Z, url, String);
}
- const Library& library = Library::Handle(Z, Library::LookupLibrary(url_str));
+ const Library& library = Library::Handle(Z,
+ Library::LookupLibrary(T, url_str));
if (library.IsNull()) {
return Api::NewError("%s: library '%s' not found.",
CURRENT_FUNC, url_str.ToCString());
@@ -5414,10 +5415,10 @@ DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url,
NoHeapGrowthControlScope no_growth_control;
- Library& library = Library::Handle(Z, Library::LookupLibrary(url_str));
+ Library& library = Library::Handle(Z, Library::LookupLibrary(T, url_str));
if (library.IsNull()) {
library = Library::New(url_str);
- library.Register();
+ library.Register(T);
} else if (library.LoadInProgress() ||
library.Loaded() ||
library.LoadFailed()) {

Powered by Google App Engine
This is Rietveld 408576698