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

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2205513002: Pay attention to exports when determine which libraries to reload. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Pay attention to exports when determine which libraries to reload. Created 4 years, 5 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 | « no previous file | runtime/vm/isolate_reload_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_reload.cc
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index f1744069b084e244b4a4214e5c3873600ae23a55..30ca1c9cbf537276fc142b02f6764d5997408a8a 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -714,7 +714,7 @@ BitVector* IsolateReloadContext::FindModifiedLibraries(bool force_reload) {
for (intptr_t i = 0; i < num_libs; i++) {
(*imported_by)[i] = new ZoneGrowableArray<intptr_t>();
}
- Array& imports = Array::Handle();
+ Array& ports = Array::Handle();
Namespace& ns = Namespace::Handle();
Library& target = Library::Handle();
@@ -727,9 +727,19 @@ BitVector* IsolateReloadContext::FindModifiedLibraries(bool force_reload) {
}
// Add imports to the import-by graph.
- imports = lib.imports();
- for (intptr_t import_idx = 0; import_idx < imports.Length(); import_idx++) {
- ns ^= imports.At(import_idx);
+ ports = lib.imports();
+ for (intptr_t import_idx = 0; import_idx < ports.Length(); import_idx++) {
+ ns ^= ports.At(import_idx);
+ if (!ns.IsNull()) {
+ target = ns.library();
+ (*imported_by)[target.index()]->Add(lib.index());
+ }
+ }
+
+ // Add exports to the import-by graph.
+ ports = lib.exports();
+ for (intptr_t export_idx = 0; export_idx < ports.Length(); export_idx++) {
+ ns ^= ports.At(export_idx);
if (!ns.IsNull()) {
target = ns.library();
(*imported_by)[target.index()]->Add(lib.index());
@@ -744,10 +754,10 @@ BitVector* IsolateReloadContext::FindModifiedLibraries(bool force_reload) {
entry = entries.GetNext();
if (entry.IsLibraryPrefix()) {
prefix ^= entry.raw();
- imports = prefix.imports();
- for (intptr_t import_idx = 0; import_idx < imports.Length();
+ ports = prefix.imports();
+ for (intptr_t import_idx = 0; import_idx < ports.Length();
import_idx++) {
- ns ^= imports.At(import_idx);
+ ns ^= ports.At(import_idx);
if (!ns.IsNull()) {
target = ns.library();
(*imported_by)[target.index()]->Add(lib.index());
« no previous file with comments | « no previous file | runtime/vm/isolate_reload_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698