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

Unified Diff: runtime/vm/object_service.cc

Issue 2822843002: Use to_snapshot when cluster serializing LibraryPrefixes. (Closed)
Patch Set: ports -> imports/exports Created 3 years, 8 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/clustered_snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_service.cc
diff --git a/runtime/vm/object_service.cc b/runtime/vm/object_service.cc
index baace752527f97a1292392981e207ac6dc7f0618..bbddcda535b36a18b9b84d2c619b936ae0afb597 100644
--- a/runtime/vm/object_service.cc
+++ b/runtime/vm/object_service.cc
@@ -526,14 +526,13 @@ void Library::PrintJSONImpl(JSONStream* stream, bool ref) const {
{
JSONArray jsarr(&jsobj, "dependencies");
- Array& ports = Array::Handle();
Namespace& ns = Namespace::Handle();
Library& target = Library::Handle();
// Unprefixed imports.
- ports = imports();
- for (intptr_t i = 0; i < ports.Length(); i++) {
- ns ^= ports.At(i);
+ Array& imports = Array::Handle(this->imports());
+ for (intptr_t i = 0; i < imports.Length(); i++) {
+ ns ^= imports.At(i);
if (ns.IsNull()) continue;
JSONObject jsdep(&jsarr);
@@ -545,9 +544,9 @@ void Library::PrintJSONImpl(JSONStream* stream, bool ref) const {
}
// Exports.
- ports = exports();
- for (intptr_t i = 0; i < ports.Length(); i++) {
- ns ^= ports.At(i);
+ const Array& exports = Array::Handle(this->exports());
+ for (intptr_t i = 0; i < exports.Length(); i++) {
+ ns ^= exports.At(i);
if (ns.IsNull()) continue;
JSONObject jsdep(&jsarr);
@@ -567,20 +566,22 @@ void Library::PrintJSONImpl(JSONStream* stream, bool ref) const {
entry = entries.GetNext();
if (entry.IsLibraryPrefix()) {
prefix ^= entry.raw();
- ports = prefix.imports();
- for (intptr_t i = 0; i < ports.Length(); i++) {
- ns ^= ports.At(i);
- if (ns.IsNull()) continue;
-
- JSONObject jsdep(&jsarr);
- jsdep.AddProperty("isDeferred", prefix.is_deferred_load());
- jsdep.AddProperty("isExport", false);
- jsdep.AddProperty("isImport", true);
- prefixName = prefix.name();
- ASSERT(!prefixName.IsNull());
- jsdep.AddProperty("prefix", prefixName.ToCString());
- target = ns.library();
- jsdep.AddProperty("target", target);
+ imports = prefix.imports();
+ if (!imports.IsNull()) {
+ for (intptr_t i = 0; i < imports.Length(); i++) {
+ ns ^= imports.At(i);
+ if (ns.IsNull()) continue;
+
+ JSONObject jsdep(&jsarr);
+ jsdep.AddProperty("isDeferred", prefix.is_deferred_load());
+ jsdep.AddProperty("isExport", false);
+ jsdep.AddProperty("isImport", true);
+ prefixName = prefix.name();
+ ASSERT(!prefixName.IsNull());
+ jsdep.AddProperty("prefix", prefixName.ToCString());
+ target = ns.library();
+ jsdep.AddProperty("target", target);
+ }
}
}
}
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698