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

Side by Side 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 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();
530 Namespace& ns = Namespace::Handle(); 529 Namespace& ns = Namespace::Handle();
531 Library& target = Library::Handle(); 530 Library& target = Library::Handle();
532 531
533 // Unprefixed imports. 532 // Unprefixed imports.
534 ports = imports(); 533 Array& imports = Array::Handle(this->imports());
535 for (intptr_t i = 0; i < ports.Length(); i++) { 534 for (intptr_t i = 0; i < imports.Length(); i++) {
536 ns ^= ports.At(i); 535 ns ^= imports.At(i);
537 if (ns.IsNull()) continue; 536 if (ns.IsNull()) continue;
538 537
539 JSONObject jsdep(&jsarr); 538 JSONObject jsdep(&jsarr);
540 jsdep.AddProperty("isDeferred", false); 539 jsdep.AddProperty("isDeferred", false);
541 jsdep.AddProperty("isExport", false); 540 jsdep.AddProperty("isExport", false);
542 jsdep.AddProperty("isImport", true); 541 jsdep.AddProperty("isImport", true);
543 target = ns.library(); 542 target = ns.library();
544 jsdep.AddProperty("target", target); 543 jsdep.AddProperty("target", target);
545 } 544 }
546 545
547 // Exports. 546 // Exports.
548 ports = exports(); 547 const Array& exports = Array::Handle(this->exports());
549 for (intptr_t i = 0; i < ports.Length(); i++) { 548 for (intptr_t i = 0; i < exports.Length(); i++) {
550 ns ^= ports.At(i); 549 ns ^= exports.At(i);
551 if (ns.IsNull()) continue; 550 if (ns.IsNull()) continue;
552 551
553 JSONObject jsdep(&jsarr); 552 JSONObject jsdep(&jsarr);
554 jsdep.AddProperty("isDeferred", false); 553 jsdep.AddProperty("isDeferred", false);
555 jsdep.AddProperty("isExport", true); 554 jsdep.AddProperty("isExport", true);
556 jsdep.AddProperty("isImport", false); 555 jsdep.AddProperty("isImport", false);
557 target = ns.library(); 556 target = ns.library();
558 jsdep.AddProperty("target", target); 557 jsdep.AddProperty("target", target);
559 } 558 }
560 559
561 // Prefixed imports. 560 // Prefixed imports.
562 DictionaryIterator entries(*this); 561 DictionaryIterator entries(*this);
563 Object& entry = Object::Handle(); 562 Object& entry = Object::Handle();
564 LibraryPrefix& prefix = LibraryPrefix::Handle(); 563 LibraryPrefix& prefix = LibraryPrefix::Handle();
565 String& prefixName = String::Handle(); 564 String& prefixName = String::Handle();
566 while (entries.HasNext()) { 565 while (entries.HasNext()) {
567 entry = entries.GetNext(); 566 entry = entries.GetNext();
568 if (entry.IsLibraryPrefix()) { 567 if (entry.IsLibraryPrefix()) {
569 prefix ^= entry.raw(); 568 prefix ^= entry.raw();
570 ports = prefix.imports(); 569 imports = prefix.imports();
571 for (intptr_t i = 0; i < ports.Length(); i++) { 570 if (!imports.IsNull()) {
572 ns ^= ports.At(i); 571 for (intptr_t i = 0; i < imports.Length(); i++) {
573 if (ns.IsNull()) continue; 572 ns ^= imports.At(i);
573 if (ns.IsNull()) continue;
574 574
575 JSONObject jsdep(&jsarr); 575 JSONObject jsdep(&jsarr);
576 jsdep.AddProperty("isDeferred", prefix.is_deferred_load()); 576 jsdep.AddProperty("isDeferred", prefix.is_deferred_load());
577 jsdep.AddProperty("isExport", false); 577 jsdep.AddProperty("isExport", false);
578 jsdep.AddProperty("isImport", true); 578 jsdep.AddProperty("isImport", true);
579 prefixName = prefix.name(); 579 prefixName = prefix.name();
580 ASSERT(!prefixName.IsNull()); 580 ASSERT(!prefixName.IsNull());
581 jsdep.AddProperty("prefix", prefixName.ToCString()); 581 jsdep.AddProperty("prefix", prefixName.ToCString());
582 target = ns.library(); 582 target = ns.library();
583 jsdep.AddProperty("target", target); 583 jsdep.AddProperty("target", target);
584 }
584 } 585 }
585 } 586 }
586 } 587 }
587 } 588 }
588 { 589 {
589 JSONArray jsarr(&jsobj, "variables"); 590 JSONArray jsarr(&jsobj, "variables");
590 DictionaryIterator entries(*this); 591 DictionaryIterator entries(*this);
591 Object& entry = Object::Handle(); 592 Object& entry = Object::Handle();
592 while (entries.HasNext()) { 593 while (entries.HasNext()) {
593 entry = entries.GetNext(); 594 entry = entries.GetNext();
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 jsobj.AddProperty("mirrorReferent", referent_handle); 1582 jsobj.AddProperty("mirrorReferent", referent_handle);
1582 } 1583 }
1583 1584
1584 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 1585 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
1585 Instance::PrintJSONImpl(stream, ref); 1586 Instance::PrintJSONImpl(stream, ref);
1586 } 1587 }
1587 1588
1588 #endif 1589 #endif
1589 1590
1590 } // namespace dart 1591 } // 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