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

Side by Side Diff: runtime/vm/object_service.cc

Issue 2822843002: Use to_snapshot when cluster serializing LibraryPrefixes. (Closed)
Patch Set: . 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/clustered_snapshot.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/debugger.h" 5 #include "vm/debugger.h"
6 #include "vm/disassembler.h" 6 #include "vm/disassembler.h"
7 #include "vm/object.h" 7 #include "vm/object.h"
8 #include "vm/object_store.h" 8 #include "vm/object_store.h"
9 #include "vm/stub_code.h" 9 #include "vm/stub_code.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 while (class_iter.HasNext()) { 519 while (class_iter.HasNext()) {
520 klass = class_iter.GetNextClass(); 520 klass = class_iter.GetNextClass();
521 if (!klass.IsMixinApplication()) { 521 if (!klass.IsMixinApplication()) {
522 jsarr.AddValue(klass); 522 jsarr.AddValue(klass);
523 } 523 }
524 } 524 }
525 } 525 }
526 { 526 {
527 JSONArray jsarr(&jsobj, "dependencies"); 527 JSONArray jsarr(&jsobj, "dependencies");
528 528
529 Array& ports = Array::Handle(); 529 Array& ports = Array::Handle();
siva 2017/04/15 00:56:51 Using the name ports for imports/exports is really
rmacnak 2017/04/17 16:02:58 Renamed.
530 Namespace& ns = Namespace::Handle(); 530 Namespace& ns = Namespace::Handle();
531 Library& target = Library::Handle(); 531 Library& target = Library::Handle();
532 532
533 // Unprefixed imports. 533 // Unprefixed imports.
534 ports = imports(); 534 ports = imports();
535 for (intptr_t i = 0; i < ports.Length(); i++) { 535 for (intptr_t i = 0; i < ports.Length(); i++) {
536 ns ^= ports.At(i); 536 ns ^= ports.At(i);
537 if (ns.IsNull()) continue; 537 if (ns.IsNull()) continue;
538 538
539 JSONObject jsdep(&jsarr); 539 JSONObject jsdep(&jsarr);
(...skipping 21 matching lines...) Expand all
561 // Prefixed imports. 561 // Prefixed imports.
562 DictionaryIterator entries(*this); 562 DictionaryIterator entries(*this);
563 Object& entry = Object::Handle(); 563 Object& entry = Object::Handle();
564 LibraryPrefix& prefix = LibraryPrefix::Handle(); 564 LibraryPrefix& prefix = LibraryPrefix::Handle();
565 String& prefixName = String::Handle(); 565 String& prefixName = String::Handle();
566 while (entries.HasNext()) { 566 while (entries.HasNext()) {
567 entry = entries.GetNext(); 567 entry = entries.GetNext();
568 if (entry.IsLibraryPrefix()) { 568 if (entry.IsLibraryPrefix()) {
569 prefix ^= entry.raw(); 569 prefix ^= entry.raw();
570 ports = prefix.imports(); 570 ports = prefix.imports();
571 for (intptr_t i = 0; i < ports.Length(); i++) { 571 if (!ports.IsNull()) {
572 ns ^= ports.At(i); 572 for (intptr_t i = 0; i < ports.Length(); i++) {
573 if (ns.IsNull()) continue; 573 ns ^= ports.At(i);
574 if (ns.IsNull()) continue;
574 575
575 JSONObject jsdep(&jsarr); 576 JSONObject jsdep(&jsarr);
576 jsdep.AddProperty("isDeferred", prefix.is_deferred_load()); 577 jsdep.AddProperty("isDeferred", prefix.is_deferred_load());
577 jsdep.AddProperty("isExport", false); 578 jsdep.AddProperty("isExport", false);
578 jsdep.AddProperty("isImport", true); 579 jsdep.AddProperty("isImport", true);
579 prefixName = prefix.name(); 580 prefixName = prefix.name();
580 ASSERT(!prefixName.IsNull()); 581 ASSERT(!prefixName.IsNull());
581 jsdep.AddProperty("prefix", prefixName.ToCString()); 582 jsdep.AddProperty("prefix", prefixName.ToCString());
582 target = ns.library(); 583 target = ns.library();
583 jsdep.AddProperty("target", target); 584 jsdep.AddProperty("target", target);
585 }
584 } 586 }
585 } 587 }
586 } 588 }
587 } 589 }
588 { 590 {
589 JSONArray jsarr(&jsobj, "variables"); 591 JSONArray jsarr(&jsobj, "variables");
590 DictionaryIterator entries(*this); 592 DictionaryIterator entries(*this);
591 Object& entry = Object::Handle(); 593 Object& entry = Object::Handle();
592 while (entries.HasNext()) { 594 while (entries.HasNext()) {
593 entry = entries.GetNext(); 595 entry = entries.GetNext();
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 jsobj.AddProperty("mirrorReferent", referent_handle); 1583 jsobj.AddProperty("mirrorReferent", referent_handle);
1582 } 1584 }
1583 1585
1584 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 1586 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
1585 Instance::PrintJSONImpl(stream, ref); 1587 Instance::PrintJSONImpl(stream, ref);
1586 } 1588 }
1587 1589
1588 #endif 1590 #endif
1589 1591
1590 } // namespace dart 1592 } // namespace dart
OLDNEW
« 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