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

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

Issue 2326483005: Shrink AOT snapshot size and memory usage. (Closed)
Patch Set: . Created 4 years, 3 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
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/clustered_snapshot.h" 5 #include "vm/clustered_snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 objects_.Add(func); 513 objects_.Add(func);
514 514
515 RawObject** from = func->from(); 515 RawObject** from = func->from();
516 RawObject** to = func->to_snapshot(); 516 RawObject** to = func->to_snapshot();
517 for (RawObject** p = from; p <= to; p++) { 517 for (RawObject** p = from; p <= to; p++) {
518 s->Push(*p); 518 s->Push(*p);
519 } 519 }
520 if (s->kind() == Snapshot::kAppNoJIT) { 520 if (s->kind() == Snapshot::kAppNoJIT) {
521 s->Push(func->ptr()->code_); 521 s->Push(func->ptr()->code_);
522 } else if (s->kind() == Snapshot::kAppWithJIT) { 522 } else if (s->kind() == Snapshot::kAppWithJIT) {
523 s->Push(func->ptr()->unoptimized_code_); 523 NOT_IN_PRECOMPILED(s->Push(func->ptr()->unoptimized_code_));
524 s->Push(func->ptr()->ic_data_array_); 524 s->Push(func->ptr()->ic_data_array_);
525 } 525 }
526 } 526 }
527 527
528 void WriteAlloc(Serializer* s) { 528 void WriteAlloc(Serializer* s) {
529 s->WriteCid(kFunctionCid); 529 s->WriteCid(kFunctionCid);
530 intptr_t count = objects_.length(); 530 intptr_t count = objects_.length();
531 s->Write<int32_t>(count); 531 s->Write<int32_t>(count);
532 for (intptr_t i = 0; i < count; i++) { 532 for (intptr_t i = 0; i < count; i++) {
533 RawFunction* func = objects_[i]; 533 RawFunction* func = objects_[i];
534 s->AssignRef(func); 534 s->AssignRef(func);
535 } 535 }
536 } 536 }
537 537
538 void WriteFill(Serializer* s) { 538 void WriteFill(Serializer* s) {
539 Snapshot::Kind kind = s->kind(); 539 Snapshot::Kind kind = s->kind();
540 intptr_t count = objects_.length(); 540 intptr_t count = objects_.length();
541 for (intptr_t i = 0; i < count; i++) { 541 for (intptr_t i = 0; i < count; i++) {
542 RawFunction* func = objects_[i]; 542 RawFunction* func = objects_[i];
543 RawObject** from = func->from(); 543 RawObject** from = func->from();
544 RawObject** to = func->to_snapshot(); 544 RawObject** to = func->to_snapshot();
545 for (RawObject** p = from; p <= to; p++) { 545 for (RawObject** p = from; p <= to; p++) {
546 s->WriteRef(*p); 546 s->WriteRef(*p);
547 } 547 }
548 if (kind == Snapshot::kAppNoJIT) { 548 if (kind == Snapshot::kAppNoJIT) {
549 s->WriteRef(func->ptr()->code_); 549 s->WriteRef(func->ptr()->code_);
550 } else if (s->kind() == Snapshot::kAppWithJIT) { 550 } else if (s->kind() == Snapshot::kAppWithJIT) {
551 s->WriteRef(func->ptr()->unoptimized_code_); 551 NOT_IN_PRECOMPILED(s->WriteRef(func->ptr()->unoptimized_code_));
552 s->WriteRef(func->ptr()->ic_data_array_); 552 s->WriteRef(func->ptr()->ic_data_array_);
553 } 553 }
554 554
555 s->WriteTokenPosition(func->ptr()->token_pos_); 555 #if !defined(DART_PRECOMPILED_RUNTIME)
556 s->WriteTokenPosition(func->ptr()->end_token_pos_); 556 if (kind != Snapshot::kAppNoJIT) {
557 s->WriteTokenPosition(func->ptr()->token_pos_);
558 s->WriteTokenPosition(func->ptr()->end_token_pos_);
559 }
560 #endif
557 s->Write<int16_t>(func->ptr()->num_fixed_parameters_); 561 s->Write<int16_t>(func->ptr()->num_fixed_parameters_);
558 s->Write<int16_t>(func->ptr()->num_optional_parameters_); 562 s->Write<int16_t>(func->ptr()->num_optional_parameters_);
559 s->Write<uint32_t>(func->ptr()->kind_tag_); 563 s->Write<uint32_t>(func->ptr()->kind_tag_);
560 if (kind == Snapshot::kAppNoJIT) { 564 if (kind == Snapshot::kAppNoJIT) {
561 // Omit fields used to support de/reoptimization. 565 // Omit fields used to support de/reoptimization.
562 } else { 566 } else {
567 #if !defined(DART_PRECOMPILED_RUNTIME)
563 bool is_optimized = Code::IsOptimized(func->ptr()->code_); 568 bool is_optimized = Code::IsOptimized(func->ptr()->code_);
564 if (is_optimized) { 569 if (is_optimized) {
565 s->Write<int32_t>(FLAG_optimization_counter_threshold); 570 s->Write<int32_t>(FLAG_optimization_counter_threshold);
566 } else { 571 } else {
567 s->Write<int32_t>(0); 572 s->Write<int32_t>(0);
568 } 573 }
569 s->Write<int8_t>(func->ptr()->deoptimization_counter_); 574 s->Write<int8_t>(func->ptr()->deoptimization_counter_);
570 s->Write<uint16_t>(func->ptr()->optimized_instruction_count_); 575 s->Write<uint16_t>(func->ptr()->optimized_instruction_count_);
571 s->Write<uint16_t>(func->ptr()->optimized_call_site_count_); 576 s->Write<uint16_t>(func->ptr()->optimized_call_site_count_);
577 #endif
572 } 578 }
573 } 579 }
574 } 580 }
575 581
576 private: 582 private:
577 GrowableArray<RawFunction*> objects_; 583 GrowableArray<RawFunction*> objects_;
578 }; 584 };
579 #endif // !DART_PRECOMPILED_RUNTIME 585 #endif // !DART_PRECOMPILED_RUNTIME
580 586
581 587
(...skipping 26 matching lines...) Expand all
608 RawObject** to = func->to(); 614 RawObject** to = func->to();
609 for (RawObject** p = from; p <= to_snapshot; p++) { 615 for (RawObject** p = from; p <= to_snapshot; p++) {
610 *p = d->ReadRef(); 616 *p = d->ReadRef();
611 } 617 }
612 for (RawObject** p = to_snapshot + 1; p <= to; p++) { 618 for (RawObject** p = to_snapshot + 1; p <= to; p++) {
613 *p = Object::null(); 619 *p = Object::null();
614 } 620 }
615 if (kind == Snapshot::kAppNoJIT) { 621 if (kind == Snapshot::kAppNoJIT) {
616 func->ptr()->code_ = reinterpret_cast<RawCode*>(d->ReadRef()); 622 func->ptr()->code_ = reinterpret_cast<RawCode*>(d->ReadRef());
617 } else if (kind == Snapshot::kAppWithJIT) { 623 } else if (kind == Snapshot::kAppWithJIT) {
618 func->ptr()->unoptimized_code_ = 624 NOT_IN_PRECOMPILED(func->ptr()->unoptimized_code_ =
619 reinterpret_cast<RawCode*>(d->ReadRef()); 625 reinterpret_cast<RawCode*>(d->ReadRef()));
620 func->ptr()->ic_data_array_ = reinterpret_cast<RawArray*>(d->ReadRef()); 626 func->ptr()->ic_data_array_ = reinterpret_cast<RawArray*>(d->ReadRef());
621 } 627 }
622 628
623 #if defined(DEBUG) 629 #if defined(DEBUG)
624 func->ptr()->entry_point_ = 0; 630 func->ptr()->entry_point_ = 0;
625 #endif 631 #endif
626 632
627 func->ptr()->token_pos_ = d->ReadTokenPosition(); 633 #if !defined(DART_PRECOMPILED_RUNTIME)
628 func->ptr()->end_token_pos_ = d->ReadTokenPosition(); 634 if (kind != Snapshot::kAppNoJIT) {
635 func->ptr()->token_pos_ = d->ReadTokenPosition();
636 func->ptr()->end_token_pos_ = d->ReadTokenPosition();
637 }
638 #endif
629 func->ptr()->num_fixed_parameters_ = d->Read<int16_t>(); 639 func->ptr()->num_fixed_parameters_ = d->Read<int16_t>();
630 func->ptr()->num_optional_parameters_ = d->Read<int16_t>(); 640 func->ptr()->num_optional_parameters_ = d->Read<int16_t>();
631 func->ptr()->kind_tag_ = d->Read<uint32_t>(); 641 func->ptr()->kind_tag_ = d->Read<uint32_t>();
632 if (kind == Snapshot::kAppNoJIT) { 642 if (kind == Snapshot::kAppNoJIT) {
633 // Omit fields used to support de/reoptimization. 643 // Omit fields used to support de/reoptimization.
634 } else { 644 } else {
645 #if !defined(DART_PRECOMPILED_RUNTIME)
635 func->ptr()->usage_counter_ = d->Read<int32_t>(); 646 func->ptr()->usage_counter_ = d->Read<int32_t>();
636 func->ptr()->deoptimization_counter_ = d->Read<int8_t>(); 647 func->ptr()->deoptimization_counter_ = d->Read<int8_t>();
637 func->ptr()->optimized_instruction_count_ = d->Read<uint16_t>(); 648 func->ptr()->optimized_instruction_count_ = d->Read<uint16_t>();
638 func->ptr()->optimized_call_site_count_ = d->Read<uint16_t>(); 649 func->ptr()->optimized_call_site_count_ = d->Read<uint16_t>();
650 #endif
639 } 651 }
640 } 652 }
641 } 653 }
642 654
643 void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) { 655 void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) {
644 NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(), 656 NOT_IN_PRODUCT(TimelineDurationScope tds(Thread::Current(),
645 Timeline::GetIsolateStream(), "PostLoadFunction")); 657 Timeline::GetIsolateStream(), "PostLoadFunction"));
646 658
647 if (kind == Snapshot::kAppNoJIT) { 659 if (kind == Snapshot::kAppNoJIT) {
648 Function& func = Function::Handle(zone); 660 Function& func = Function::Handle(zone);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 #if !defined(DART_PRECOMPILED_RUNTIME) 695 #if !defined(DART_PRECOMPILED_RUNTIME)
684 class ClosureDataSerializationCluster : public SerializationCluster { 696 class ClosureDataSerializationCluster : public SerializationCluster {
685 public: 697 public:
686 ClosureDataSerializationCluster() { } 698 ClosureDataSerializationCluster() { }
687 virtual ~ClosureDataSerializationCluster() { } 699 virtual ~ClosureDataSerializationCluster() { }
688 700
689 void Trace(Serializer* s, RawObject* object) { 701 void Trace(Serializer* s, RawObject* object) {
690 RawClosureData* data = ClosureData::RawCast(object); 702 RawClosureData* data = ClosureData::RawCast(object);
691 objects_.Add(data); 703 objects_.Add(data);
692 704
693 RawObject** from = data->from(); 705 if (s->kind() != Snapshot::kAppNoJIT) {
694 RawObject** to = data->to(); 706 s->Push(data->ptr()->context_scope_);
695 for (RawObject** p = from; p <= to; p++) {
696 s->Push(*p);
697 } 707 }
708 s->Push(data->ptr()->parent_function_);
709 s->Push(data->ptr()->signature_type_);
710 s->Push(data->ptr()->closure_);
698 } 711 }
699 712
700 void WriteAlloc(Serializer* s) { 713 void WriteAlloc(Serializer* s) {
701 s->WriteCid(kClosureDataCid); 714 s->WriteCid(kClosureDataCid);
702 intptr_t count = objects_.length(); 715 intptr_t count = objects_.length();
703 s->Write<int32_t>(count); 716 s->Write<int32_t>(count);
704 for (intptr_t i = 0; i < count; i++) { 717 for (intptr_t i = 0; i < count; i++) {
705 RawClosureData* data = objects_[i]; 718 RawClosureData* data = objects_[i];
706 s->AssignRef(data); 719 s->AssignRef(data);
707 } 720 }
708 } 721 }
709 722
710 void WriteFill(Serializer* s) { 723 void WriteFill(Serializer* s) {
711 intptr_t count = objects_.length(); 724 intptr_t count = objects_.length();
712 for (intptr_t i = 0; i < count; i++) { 725 for (intptr_t i = 0; i < count; i++) {
713 RawClosureData* data = objects_[i]; 726 RawClosureData* data = objects_[i];
714 RawObject** from = data->from(); 727 if (s->kind() != Snapshot::kAppNoJIT) {
715 RawObject** to = data->to(); 728 s->WriteRef(data->ptr()->context_scope_);
716 for (RawObject** p = from; p <= to; p++) {
717 s->WriteRef(*p);
718 } 729 }
730 s->WriteRef(data->ptr()->parent_function_);
731 s->WriteRef(data->ptr()->signature_type_);
732 s->WriteRef(data->ptr()->closure_);
719 } 733 }
720 } 734 }
721 735
722 private: 736 private:
723 GrowableArray<RawClosureData*> objects_; 737 GrowableArray<RawClosureData*> objects_;
724 }; 738 };
725 #endif // !DART_PRECOMPILED_RUNTIME 739 #endif // !DART_PRECOMPILED_RUNTIME
726 740
727 741
728 class ClosureDataDeserializationCluster : public DeserializationCluster { 742 class ClosureDataDeserializationCluster : public DeserializationCluster {
(...skipping 11 matching lines...) Expand all
740 } 754 }
741 stop_index_ = d->next_index(); 755 stop_index_ = d->next_index();
742 } 756 }
743 757
744 void ReadFill(Deserializer* d) { 758 void ReadFill(Deserializer* d) {
745 bool is_vm_object = d->isolate() == Dart::vm_isolate(); 759 bool is_vm_object = d->isolate() == Dart::vm_isolate();
746 760
747 for (intptr_t id = start_index_; id < stop_index_; id++) { 761 for (intptr_t id = start_index_; id < stop_index_; id++) {
748 RawClosureData* data = reinterpret_cast<RawClosureData*>(d->Ref(id)); 762 RawClosureData* data = reinterpret_cast<RawClosureData*>(d->Ref(id));
749 Deserializer::InitializeHeader(data, kClosureDataCid, 763 Deserializer::InitializeHeader(data, kClosureDataCid,
750 ClosureData::InstanceSize(), is_vm_object); 764 ClosureData::InstanceSize(),
751 RawObject** from = data->from(); 765 is_vm_object);
752 RawObject** to = data->to(); 766 if (d->kind() == Snapshot::kAppNoJIT) {
753 for (RawObject** p = from; p <= to; p++) { 767 data->ptr()->context_scope_ = ContextScope::null();
754 *p = d->ReadRef(); 768 } else {
769 data->ptr()->context_scope_ =
770 static_cast<RawContextScope*>(d->ReadRef());
755 } 771 }
772 data->ptr()->parent_function_ = static_cast<RawFunction*>(d->ReadRef());
773 data->ptr()->signature_type_ = static_cast<RawType*>(d->ReadRef());
774 data->ptr()->closure_ = static_cast<RawInstance*>(d->ReadRef());
756 } 775 }
757 } 776 }
758 }; 777 };
759 778
760 779
761 #if !defined(DART_PRECOMPILED_RUNTIME) 780 #if !defined(DART_PRECOMPILED_RUNTIME)
762 class RedirectionDataSerializationCluster : public SerializationCluster { 781 class RedirectionDataSerializationCluster : public SerializationCluster {
763 public: 782 public:
764 RedirectionDataSerializationCluster() { } 783 RedirectionDataSerializationCluster() { }
765 virtual ~RedirectionDataSerializationCluster() { } 784 virtual ~RedirectionDataSerializationCluster() { }
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 for (intptr_t i = 0; i < count; i++) { 1501 for (intptr_t i = 0; i < count; i++) {
1483 RawCode* code = objects_[i]; 1502 RawCode* code = objects_[i];
1484 1503
1485 intptr_t pointer_offsets_length = 1504 intptr_t pointer_offsets_length =
1486 Code::PtrOffBits::decode(code->ptr()->state_bits_); 1505 Code::PtrOffBits::decode(code->ptr()->state_bits_);
1487 if (pointer_offsets_length != 0) { 1506 if (pointer_offsets_length != 0) {
1488 FATAL("Cannot serialize code with embedded pointers"); 1507 FATAL("Cannot serialize code with embedded pointers");
1489 } 1508 }
1490 if (kind == Snapshot::kAppNoJIT) { 1509 if (kind == Snapshot::kAppNoJIT) {
1491 // No disabled code in precompilation. 1510 // No disabled code in precompilation.
1492 ASSERT(code->ptr()->instructions_ == code->ptr()->active_instructions_); 1511 NOT_IN_PRECOMPILED(ASSERT(
1512 code->ptr()->instructions_ == code->ptr()->active_instructions_));
1493 } else { 1513 } else {
1494 ASSERT(kind == Snapshot::kAppWithJIT); 1514 ASSERT(kind == Snapshot::kAppWithJIT);
1495 // We never include optimized code in JIT precompilation. Deoptimization 1515 // We never include optimized code in JIT precompilation. Deoptimization
1496 // requires code patching and we cannot patch code that is shared 1516 // requires code patching and we cannot patch code that is shared
1497 // between isolates and should not mutate memory allocated by the 1517 // between isolates and should not mutate memory allocated by the
1498 // embedder. 1518 // embedder.
1499 bool is_optimized = Code::PtrOffBits::decode(code->ptr()->state_bits_); 1519 bool is_optimized = Code::PtrOffBits::decode(code->ptr()->state_bits_);
1500 if (is_optimized) { 1520 if (is_optimized) {
1501 FATAL("Cannot include optimized code in a JIT snapshot"); 1521 FATAL("Cannot include optimized code in a JIT snapshot");
1502 } 1522 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 Deserializer::InitializeHeader(code, kCodeCid, 1565 Deserializer::InitializeHeader(code, kCodeCid,
1546 Code::InstanceSize(0), is_vm_object); 1566 Code::InstanceSize(0), is_vm_object);
1547 1567
1548 int32_t text_offset = d->Read<int32_t>(); 1568 int32_t text_offset = d->Read<int32_t>();
1549 RawInstructions* instr = reinterpret_cast<RawInstructions*>( 1569 RawInstructions* instr = reinterpret_cast<RawInstructions*>(
1550 d->GetInstructionsAt(text_offset) + kHeapObjectTag); 1570 d->GetInstructionsAt(text_offset) + kHeapObjectTag);
1551 1571
1552 code->ptr()->entry_point_ = Instructions::UncheckedEntryPoint(instr); 1572 code->ptr()->entry_point_ = Instructions::UncheckedEntryPoint(instr);
1553 code->ptr()->checked_entry_point_ = 1573 code->ptr()->checked_entry_point_ =
1554 Instructions::CheckedEntryPoint(instr); 1574 Instructions::CheckedEntryPoint(instr);
1555 code->ptr()->active_instructions_ = instr; 1575 NOT_IN_PRECOMPILED(code->ptr()->active_instructions_ = instr);
1556 code->ptr()->instructions_ = instr; 1576 code->ptr()->instructions_ = instr;
1557 code->ptr()->object_pool_ = 1577 code->ptr()->object_pool_ =
1558 reinterpret_cast<RawObjectPool*>(d->ReadRef()); 1578 reinterpret_cast<RawObjectPool*>(d->ReadRef());
1559 code->ptr()->owner_ = d->ReadRef(); 1579 code->ptr()->owner_ = d->ReadRef();
1560 code->ptr()->exception_handlers_ = 1580 code->ptr()->exception_handlers_ =
1561 reinterpret_cast<RawExceptionHandlers*>(d->ReadRef()); 1581 reinterpret_cast<RawExceptionHandlers*>(d->ReadRef());
1562 code->ptr()->pc_descriptors_ = 1582 code->ptr()->pc_descriptors_ =
1563 reinterpret_cast<RawPcDescriptors*>(d->ReadRef()); 1583 reinterpret_cast<RawPcDescriptors*>(d->ReadRef());
1564 code->ptr()->stackmaps_ = 1584 code->ptr()->stackmaps_ =
1565 reinterpret_cast<RawArray*>(d->ReadRef()); 1585 reinterpret_cast<RawArray*>(d->ReadRef());
1566 1586
1587 #if !defined(DART_PRECOMPILED_RUNTIME)
1567 code->ptr()->deopt_info_array_ = Array::null(); 1588 code->ptr()->deopt_info_array_ = Array::null();
1568 code->ptr()->static_calls_target_table_ = Array::null(); 1589 code->ptr()->static_calls_target_table_ = Array::null();
1569 code->ptr()->var_descriptors_ = LocalVarDescriptors::null(); 1590 code->ptr()->var_descriptors_ = LocalVarDescriptors::null();
1570 code->ptr()->inlined_metadata_ = Array::null(); 1591 code->ptr()->inlined_metadata_ = Array::null();
1571 code->ptr()->code_source_map_ = CodeSourceMap::null(); 1592 code->ptr()->code_source_map_ = CodeSourceMap::null();
1572 code->ptr()->comments_ = Array::null(); 1593 code->ptr()->comments_ = Array::null();
1573 code->ptr()->return_address_metadata_ = Object::null(); 1594 code->ptr()->return_address_metadata_ = Object::null();
1574 1595
1575 code->ptr()->compile_timestamp_ = 0; 1596 code->ptr()->compile_timestamp_ = 0;
1597 #endif
1576 code->ptr()->state_bits_ = d->Read<int32_t>(); 1598 code->ptr()->state_bits_ = d->Read<int32_t>();
1599 #if !defined(DART_PRECOMPILED_RUNTIME)
1577 code->ptr()->lazy_deopt_pc_offset_ = -1; 1600 code->ptr()->lazy_deopt_pc_offset_ = -1;
1601 #endif
1578 } 1602 }
1579 } 1603 }
1580 }; 1604 };
1581 1605
1582 1606
1583 #if !defined(DART_PRECOMPILED_RUNTIME) 1607 #if !defined(DART_PRECOMPILED_RUNTIME)
1584 class ObjectPoolSerializationCluster : public SerializationCluster { 1608 class ObjectPoolSerializationCluster : public SerializationCluster {
1585 public: 1609 public:
1586 ObjectPoolSerializationCluster() { } 1610 ObjectPoolSerializationCluster() { }
1587 virtual ~ObjectPoolSerializationCluster() { } 1611 virtual ~ObjectPoolSerializationCluster() { }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2093 void WriteFill(Serializer* s) { 2117 void WriteFill(Serializer* s) {
2094 Snapshot::Kind kind = s->kind(); 2118 Snapshot::Kind kind = s->kind();
2095 intptr_t count = objects_.length(); 2119 intptr_t count = objects_.length();
2096 for (intptr_t i = 0; i < count; i++) { 2120 for (intptr_t i = 0; i < count; i++) {
2097 RawICData* ic = objects_[i]; 2121 RawICData* ic = objects_[i];
2098 RawObject** from = ic->from(); 2122 RawObject** from = ic->from();
2099 RawObject** to = ic->to_snapshot(kind); 2123 RawObject** to = ic->to_snapshot(kind);
2100 for (RawObject** p = from; p <= to; p++) { 2124 for (RawObject** p = from; p <= to; p++) {
2101 s->WriteRef(*p); 2125 s->WriteRef(*p);
2102 } 2126 }
2103 s->Write<int32_t>(ic->ptr()->deopt_id_); 2127 if (kind != Snapshot::kAppNoJIT) {
2128 NOT_IN_PRECOMPILED(s->Write<int32_t>(ic->ptr()->deopt_id_));
2129 }
2104 s->Write<uint32_t>(ic->ptr()->state_bits_); 2130 s->Write<uint32_t>(ic->ptr()->state_bits_);
2105 #if defined(TAG_IC_DATA) 2131 #if defined(TAG_IC_DATA)
2106 s->Write<int32_t>(ic->ptr()->tag_); 2132 s->Write<int32_t>(ic->ptr()->tag_);
2107 #endif 2133 #endif
2108 } 2134 }
2109 } 2135 }
2110 2136
2111 private: 2137 private:
2112 GrowableArray<RawICData*> objects_; 2138 GrowableArray<RawICData*> objects_;
2113 }; 2139 };
(...skipping 25 matching lines...) Expand all
2139 ICData::InstanceSize(), is_vm_object); 2165 ICData::InstanceSize(), is_vm_object);
2140 RawObject** from = ic->from(); 2166 RawObject** from = ic->from();
2141 RawObject** to_snapshot = ic->to_snapshot(kind); 2167 RawObject** to_snapshot = ic->to_snapshot(kind);
2142 RawObject** to = ic->to(); 2168 RawObject** to = ic->to();
2143 for (RawObject** p = from; p <= to_snapshot; p++) { 2169 for (RawObject** p = from; p <= to_snapshot; p++) {
2144 *p = d->ReadRef(); 2170 *p = d->ReadRef();
2145 } 2171 }
2146 for (RawObject** p = to_snapshot + 1; p <= to; p++) { 2172 for (RawObject** p = to_snapshot + 1; p <= to; p++) {
2147 *p = Object::null(); 2173 *p = Object::null();
2148 } 2174 }
2149 ic->ptr()->deopt_id_ = d->Read<int32_t>(); 2175 NOT_IN_PRECOMPILED(ic->ptr()->deopt_id_ = d->Read<int32_t>());
2150 ic->ptr()->state_bits_ = d->Read<int32_t>(); 2176 ic->ptr()->state_bits_ = d->Read<int32_t>();
2151 #if defined(TAG_IC_DATA) 2177 #if defined(TAG_IC_DATA)
2152 ic->ptr()->tag_ = d->Read<int32_t>(); 2178 ic->ptr()->tag_ = d->Read<int32_t>();
2153 #endif 2179 #endif
2154 } 2180 }
2155 } 2181 }
2156 }; 2182 };
2157 2183
2158 2184
2159 #if !defined(DART_PRECOMPILED_RUNTIME) 2185 #if !defined(DART_PRECOMPILED_RUNTIME)
(...skipping 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after
5093 5119
5094 deserializer.ReadVMSnapshot(); 5120 deserializer.ReadVMSnapshot();
5095 5121
5096 Dart::set_instructions_snapshot_buffer(instructions_buffer_); 5122 Dart::set_instructions_snapshot_buffer(instructions_buffer_);
5097 Dart::set_data_snapshot_buffer(data_buffer_); 5123 Dart::set_data_snapshot_buffer(data_buffer_);
5098 5124
5099 return ApiError::null(); 5125 return ApiError::null();
5100 } 5126 }
5101 5127
5102 } // namespace dart 5128 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/platform/globals.h ('k') | runtime/vm/flag_list.h » ('j') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698