OLD | NEW |
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 ASSERT(Utils::IsAligned(size, kObjectAlignment)); | 42 ASSERT(Utils::IsAligned(size, kObjectAlignment)); |
43 uword tags = 0; | 43 uword tags = 0; |
44 tags = RawObject::ClassIdTag::update(class_id, tags); | 44 tags = RawObject::ClassIdTag::update(class_id, tags); |
45 tags = RawObject::SizeTag::update(size, tags); | 45 tags = RawObject::SizeTag::update(size, tags); |
46 tags = RawObject::VMHeapObjectTag::update(is_vm_isolate, tags); | 46 tags = RawObject::VMHeapObjectTag::update(is_vm_isolate, tags); |
47 tags = RawObject::CanonicalObjectTag::update(is_canonical, tags); | 47 tags = RawObject::CanonicalObjectTag::update(is_canonical, tags); |
48 raw->ptr()->tags_ = tags; | 48 raw->ptr()->tags_ = tags; |
49 } | 49 } |
50 | 50 |
51 | 51 |
| 52 #if !defined(DART_PRECOMPILED_RUNTIME) |
52 class ClassSerializationCluster : public SerializationCluster { | 53 class ClassSerializationCluster : public SerializationCluster { |
53 public: | 54 public: |
54 explicit ClassSerializationCluster(intptr_t num_cids) : | 55 explicit ClassSerializationCluster(intptr_t num_cids) : |
55 predefined_(kNumPredefinedCids), objects_(num_cids) { } | 56 predefined_(kNumPredefinedCids), objects_(num_cids) { } |
56 virtual ~ClassSerializationCluster() { } | 57 virtual ~ClassSerializationCluster() { } |
57 | 58 |
58 void Trace(Serializer* s, RawObject* object) { | 59 void Trace(Serializer* s, RawObject* object) { |
59 RawClass* cls = Class::RawCast(object); | 60 RawClass* cls = Class::RawCast(object); |
60 intptr_t class_id = cls->ptr()->id_; | 61 intptr_t class_id = cls->ptr()->id_; |
61 | 62 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_); | 121 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_); |
121 s->Write<uint16_t>(cls->ptr()->num_native_fields_); | 122 s->Write<uint16_t>(cls->ptr()->num_native_fields_); |
122 s->WriteTokenPosition(cls->ptr()->token_pos_); | 123 s->WriteTokenPosition(cls->ptr()->token_pos_); |
123 s->Write<uint16_t>(cls->ptr()->state_bits_); | 124 s->Write<uint16_t>(cls->ptr()->state_bits_); |
124 } | 125 } |
125 | 126 |
126 private: | 127 private: |
127 GrowableArray<RawClass*> predefined_; | 128 GrowableArray<RawClass*> predefined_; |
128 GrowableArray<RawClass*> objects_; | 129 GrowableArray<RawClass*> objects_; |
129 }; | 130 }; |
| 131 #endif // !DART_PRECOMPILED_RUNTIME |
130 | 132 |
131 | 133 |
132 class ClassDeserializationCluster : public DeserializationCluster { | 134 class ClassDeserializationCluster : public DeserializationCluster { |
133 public: | 135 public: |
134 ClassDeserializationCluster() { } | 136 ClassDeserializationCluster() { } |
135 virtual ~ClassDeserializationCluster() { } | 137 virtual ~ClassDeserializationCluster() { } |
136 | 138 |
137 void ReadAlloc(Deserializer* d) { | 139 void ReadAlloc(Deserializer* d) { |
138 predefined_start_index_ = d->next_index(); | 140 predefined_start_index_ = d->next_index(); |
139 PageSpace* old_space = d->heap()->old_space(); | 141 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 cls.RehashConstants(zone); | 242 cls.RehashConstants(zone); |
241 } | 243 } |
242 } | 244 } |
243 | 245 |
244 private: | 246 private: |
245 intptr_t predefined_start_index_; | 247 intptr_t predefined_start_index_; |
246 intptr_t predefined_stop_index_; | 248 intptr_t predefined_stop_index_; |
247 }; | 249 }; |
248 | 250 |
249 | 251 |
| 252 #if !defined(DART_PRECOMPILED_RUNTIME) |
250 class UnresolvedClassSerializationCluster : public SerializationCluster { | 253 class UnresolvedClassSerializationCluster : public SerializationCluster { |
251 public: | 254 public: |
252 UnresolvedClassSerializationCluster() { } | 255 UnresolvedClassSerializationCluster() { } |
253 virtual ~UnresolvedClassSerializationCluster() { } | 256 virtual ~UnresolvedClassSerializationCluster() { } |
254 | 257 |
255 void Trace(Serializer* s, RawObject* object) { | 258 void Trace(Serializer* s, RawObject* object) { |
256 RawUnresolvedClass* cls = UnresolvedClass::RawCast(object); | 259 RawUnresolvedClass* cls = UnresolvedClass::RawCast(object); |
257 objects_.Add(cls); | 260 objects_.Add(cls); |
258 | 261 |
259 RawObject** from = cls->from(); | 262 RawObject** from = cls->from(); |
(...skipping 23 matching lines...) Expand all Loading... |
283 for (RawObject** p = from; p <= to; p++) { | 286 for (RawObject** p = from; p <= to; p++) { |
284 s->WriteRef(*p); | 287 s->WriteRef(*p); |
285 } | 288 } |
286 s->WriteTokenPosition(cls->ptr()->token_pos_); | 289 s->WriteTokenPosition(cls->ptr()->token_pos_); |
287 } | 290 } |
288 } | 291 } |
289 | 292 |
290 private: | 293 private: |
291 GrowableArray<RawUnresolvedClass*> objects_; | 294 GrowableArray<RawUnresolvedClass*> objects_; |
292 }; | 295 }; |
| 296 #endif // !DART_PRECOMPILED_RUNTIME |
293 | 297 |
294 | 298 |
295 class UnresolvedClassDeserializationCluster : public DeserializationCluster { | 299 class UnresolvedClassDeserializationCluster : public DeserializationCluster { |
296 public: | 300 public: |
297 UnresolvedClassDeserializationCluster() { } | 301 UnresolvedClassDeserializationCluster() { } |
298 virtual ~UnresolvedClassDeserializationCluster() { } | 302 virtual ~UnresolvedClassDeserializationCluster() { } |
299 | 303 |
300 void ReadAlloc(Deserializer* d) { | 304 void ReadAlloc(Deserializer* d) { |
301 start_index_ = d->next_index(); | 305 start_index_ = d->next_index(); |
302 PageSpace* old_space = d->heap()->old_space(); | 306 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 18 matching lines...) Expand all Loading... |
321 RawObject** to = cls->to(); | 325 RawObject** to = cls->to(); |
322 for (RawObject** p = from; p <= to; p++) { | 326 for (RawObject** p = from; p <= to; p++) { |
323 *p = d->ReadRef(); | 327 *p = d->ReadRef(); |
324 } | 328 } |
325 cls->ptr()->token_pos_ = d->ReadTokenPosition(); | 329 cls->ptr()->token_pos_ = d->ReadTokenPosition(); |
326 } | 330 } |
327 } | 331 } |
328 }; | 332 }; |
329 | 333 |
330 | 334 |
| 335 #if !defined(DART_PRECOMPILED_RUNTIME) |
331 class TypeArgumentsSerializationCluster : public SerializationCluster { | 336 class TypeArgumentsSerializationCluster : public SerializationCluster { |
332 public: | 337 public: |
333 TypeArgumentsSerializationCluster() { } | 338 TypeArgumentsSerializationCluster() { } |
334 virtual ~TypeArgumentsSerializationCluster() { } | 339 virtual ~TypeArgumentsSerializationCluster() { } |
335 | 340 |
336 void Trace(Serializer* s, RawObject* object) { | 341 void Trace(Serializer* s, RawObject* object) { |
337 RawTypeArguments* type_args = TypeArguments::RawCast(object); | 342 RawTypeArguments* type_args = TypeArguments::RawCast(object); |
338 objects_.Add(type_args); | 343 objects_.Add(type_args); |
339 | 344 |
340 s->Push(type_args->ptr()->instantiations_); | 345 s->Push(type_args->ptr()->instantiations_); |
(...skipping 27 matching lines...) Expand all Loading... |
368 s->WriteRef(type_args->ptr()->instantiations_); | 373 s->WriteRef(type_args->ptr()->instantiations_); |
369 for (intptr_t j = 0; j < length; j++) { | 374 for (intptr_t j = 0; j < length; j++) { |
370 s->WriteRef(type_args->ptr()->types()[j]); | 375 s->WriteRef(type_args->ptr()->types()[j]); |
371 } | 376 } |
372 } | 377 } |
373 } | 378 } |
374 | 379 |
375 private: | 380 private: |
376 GrowableArray<RawTypeArguments*> objects_; | 381 GrowableArray<RawTypeArguments*> objects_; |
377 }; | 382 }; |
| 383 #endif // !DART_PRECOMPILED_RUNTIME |
378 | 384 |
379 | 385 |
380 class TypeArgumentsDeserializationCluster : public DeserializationCluster { | 386 class TypeArgumentsDeserializationCluster : public DeserializationCluster { |
381 public: | 387 public: |
382 TypeArgumentsDeserializationCluster() { } | 388 TypeArgumentsDeserializationCluster() { } |
383 virtual ~TypeArgumentsDeserializationCluster() { } | 389 virtual ~TypeArgumentsDeserializationCluster() { } |
384 | 390 |
385 void ReadAlloc(Deserializer* d) { | 391 void ReadAlloc(Deserializer* d) { |
386 start_index_ = d->next_index(); | 392 start_index_ = d->next_index(); |
387 PageSpace* old_space = d->heap()->old_space(); | 393 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 23 matching lines...) Expand all Loading... |
411 reinterpret_cast<RawArray*>(d->ReadRef()); | 417 reinterpret_cast<RawArray*>(d->ReadRef()); |
412 for (intptr_t j = 0; j < length; j++) { | 418 for (intptr_t j = 0; j < length; j++) { |
413 type_args->ptr()->types()[j] = | 419 type_args->ptr()->types()[j] = |
414 reinterpret_cast<RawAbstractType*>(d->ReadRef()); | 420 reinterpret_cast<RawAbstractType*>(d->ReadRef()); |
415 } | 421 } |
416 } | 422 } |
417 } | 423 } |
418 }; | 424 }; |
419 | 425 |
420 | 426 |
| 427 #if !defined(DART_PRECOMPILED_RUNTIME) |
421 class PatchClassSerializationCluster : public SerializationCluster { | 428 class PatchClassSerializationCluster : public SerializationCluster { |
422 public: | 429 public: |
423 PatchClassSerializationCluster() { } | 430 PatchClassSerializationCluster() { } |
424 virtual ~PatchClassSerializationCluster() { } | 431 virtual ~PatchClassSerializationCluster() { } |
425 | 432 |
426 void Trace(Serializer* s, RawObject* object) { | 433 void Trace(Serializer* s, RawObject* object) { |
427 RawPatchClass* cls = PatchClass::RawCast(object); | 434 RawPatchClass* cls = PatchClass::RawCast(object); |
428 objects_.Add(cls); | 435 objects_.Add(cls); |
429 | 436 |
430 RawObject** from = cls->from(); | 437 RawObject** from = cls->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
452 RawObject** to = cls->to(); | 459 RawObject** to = cls->to(); |
453 for (RawObject** p = from; p <= to; p++) { | 460 for (RawObject** p = from; p <= to; p++) { |
454 s->WriteRef(*p); | 461 s->WriteRef(*p); |
455 } | 462 } |
456 } | 463 } |
457 } | 464 } |
458 | 465 |
459 private: | 466 private: |
460 GrowableArray<RawPatchClass*> objects_; | 467 GrowableArray<RawPatchClass*> objects_; |
461 }; | 468 }; |
| 469 #endif // !DART_PRECOMPILED_RUNTIME |
462 | 470 |
463 | 471 |
464 class PatchClassDeserializationCluster : public DeserializationCluster { | 472 class PatchClassDeserializationCluster : public DeserializationCluster { |
465 public: | 473 public: |
466 PatchClassDeserializationCluster() { } | 474 PatchClassDeserializationCluster() { } |
467 virtual ~PatchClassDeserializationCluster() { } | 475 virtual ~PatchClassDeserializationCluster() { } |
468 | 476 |
469 void ReadAlloc(Deserializer* d) { | 477 void ReadAlloc(Deserializer* d) { |
470 start_index_ = d->next_index(); | 478 start_index_ = d->next_index(); |
471 PageSpace* old_space = d->heap()->old_space(); | 479 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 15 matching lines...) Expand all Loading... |
487 RawObject** from = cls->from(); | 495 RawObject** from = cls->from(); |
488 RawObject** to = cls->to(); | 496 RawObject** to = cls->to(); |
489 for (RawObject** p = from; p <= to; p++) { | 497 for (RawObject** p = from; p <= to; p++) { |
490 *p = d->ReadRef(); | 498 *p = d->ReadRef(); |
491 } | 499 } |
492 } | 500 } |
493 } | 501 } |
494 }; | 502 }; |
495 | 503 |
496 | 504 |
| 505 #if !defined(DART_PRECOMPILED_RUNTIME) |
497 class FunctionSerializationCluster : public SerializationCluster { | 506 class FunctionSerializationCluster : public SerializationCluster { |
498 public: | 507 public: |
499 FunctionSerializationCluster() { } | 508 FunctionSerializationCluster() { } |
500 virtual ~FunctionSerializationCluster() { } | 509 virtual ~FunctionSerializationCluster() { } |
501 | 510 |
502 void Trace(Serializer* s, RawObject* object) { | 511 void Trace(Serializer* s, RawObject* object) { |
503 RawFunction* func = Function::RawCast(object); | 512 RawFunction* func = Function::RawCast(object); |
504 objects_.Add(func); | 513 objects_.Add(func); |
505 | 514 |
506 RawObject** from = func->from(); | 515 RawObject** from = func->from(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 s->Write<int8_t>(func->ptr()->deoptimization_counter_); | 569 s->Write<int8_t>(func->ptr()->deoptimization_counter_); |
561 s->Write<uint16_t>(func->ptr()->optimized_instruction_count_); | 570 s->Write<uint16_t>(func->ptr()->optimized_instruction_count_); |
562 s->Write<uint16_t>(func->ptr()->optimized_call_site_count_); | 571 s->Write<uint16_t>(func->ptr()->optimized_call_site_count_); |
563 } | 572 } |
564 } | 573 } |
565 } | 574 } |
566 | 575 |
567 private: | 576 private: |
568 GrowableArray<RawFunction*> objects_; | 577 GrowableArray<RawFunction*> objects_; |
569 }; | 578 }; |
| 579 #endif // !DART_PRECOMPILED_RUNTIME |
570 | 580 |
571 | 581 |
572 class FunctionDeserializationCluster : public DeserializationCluster { | 582 class FunctionDeserializationCluster : public DeserializationCluster { |
573 public: | 583 public: |
574 FunctionDeserializationCluster() { } | 584 FunctionDeserializationCluster() { } |
575 virtual ~FunctionDeserializationCluster() { } | 585 virtual ~FunctionDeserializationCluster() { } |
576 | 586 |
577 void ReadAlloc(Deserializer* d) { | 587 void ReadAlloc(Deserializer* d) { |
578 start_index_ = d->next_index(); | 588 start_index_ = d->next_index(); |
579 PageSpace* old_space = d->heap()->old_space(); | 589 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 func ^= refs.At(i); | 673 func ^= refs.At(i); |
664 func.ClearICDataArray(); | 674 func.ClearICDataArray(); |
665 func.ClearCode(); | 675 func.ClearCode(); |
666 func.set_was_compiled(false); | 676 func.set_was_compiled(false); |
667 } | 677 } |
668 } | 678 } |
669 } | 679 } |
670 }; | 680 }; |
671 | 681 |
672 | 682 |
| 683 #if !defined(DART_PRECOMPILED_RUNTIME) |
673 class ClosureDataSerializationCluster : public SerializationCluster { | 684 class ClosureDataSerializationCluster : public SerializationCluster { |
674 public: | 685 public: |
675 ClosureDataSerializationCluster() { } | 686 ClosureDataSerializationCluster() { } |
676 virtual ~ClosureDataSerializationCluster() { } | 687 virtual ~ClosureDataSerializationCluster() { } |
677 | 688 |
678 void Trace(Serializer* s, RawObject* object) { | 689 void Trace(Serializer* s, RawObject* object) { |
679 RawClosureData* data = ClosureData::RawCast(object); | 690 RawClosureData* data = ClosureData::RawCast(object); |
680 objects_.Add(data); | 691 objects_.Add(data); |
681 | 692 |
682 RawObject** from = data->from(); | 693 RawObject** from = data->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
704 RawObject** to = data->to(); | 715 RawObject** to = data->to(); |
705 for (RawObject** p = from; p <= to; p++) { | 716 for (RawObject** p = from; p <= to; p++) { |
706 s->WriteRef(*p); | 717 s->WriteRef(*p); |
707 } | 718 } |
708 } | 719 } |
709 } | 720 } |
710 | 721 |
711 private: | 722 private: |
712 GrowableArray<RawClosureData*> objects_; | 723 GrowableArray<RawClosureData*> objects_; |
713 }; | 724 }; |
| 725 #endif // !DART_PRECOMPILED_RUNTIME |
714 | 726 |
715 | 727 |
716 class ClosureDataDeserializationCluster : public DeserializationCluster { | 728 class ClosureDataDeserializationCluster : public DeserializationCluster { |
717 public: | 729 public: |
718 ClosureDataDeserializationCluster() { } | 730 ClosureDataDeserializationCluster() { } |
719 virtual ~ClosureDataDeserializationCluster() { } | 731 virtual ~ClosureDataDeserializationCluster() { } |
720 | 732 |
721 void ReadAlloc(Deserializer* d) { | 733 void ReadAlloc(Deserializer* d) { |
722 start_index_ = d->next_index(); | 734 start_index_ = d->next_index(); |
723 PageSpace* old_space = d->heap()->old_space(); | 735 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 15 matching lines...) Expand all Loading... |
739 RawObject** from = data->from(); | 751 RawObject** from = data->from(); |
740 RawObject** to = data->to(); | 752 RawObject** to = data->to(); |
741 for (RawObject** p = from; p <= to; p++) { | 753 for (RawObject** p = from; p <= to; p++) { |
742 *p = d->ReadRef(); | 754 *p = d->ReadRef(); |
743 } | 755 } |
744 } | 756 } |
745 } | 757 } |
746 }; | 758 }; |
747 | 759 |
748 | 760 |
| 761 #if !defined(DART_PRECOMPILED_RUNTIME) |
749 class RedirectionDataSerializationCluster : public SerializationCluster { | 762 class RedirectionDataSerializationCluster : public SerializationCluster { |
750 public: | 763 public: |
751 RedirectionDataSerializationCluster() { } | 764 RedirectionDataSerializationCluster() { } |
752 virtual ~RedirectionDataSerializationCluster() { } | 765 virtual ~RedirectionDataSerializationCluster() { } |
753 | 766 |
754 void Trace(Serializer* s, RawObject* object) { | 767 void Trace(Serializer* s, RawObject* object) { |
755 RawRedirectionData* data = RedirectionData::RawCast(object); | 768 RawRedirectionData* data = RedirectionData::RawCast(object); |
756 objects_.Add(data); | 769 objects_.Add(data); |
757 | 770 |
758 RawObject** from = data->from(); | 771 RawObject** from = data->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
780 RawObject** to = data->to(); | 793 RawObject** to = data->to(); |
781 for (RawObject** p = from; p <= to; p++) { | 794 for (RawObject** p = from; p <= to; p++) { |
782 s->WriteRef(*p); | 795 s->WriteRef(*p); |
783 } | 796 } |
784 } | 797 } |
785 } | 798 } |
786 | 799 |
787 private: | 800 private: |
788 GrowableArray<RawRedirectionData*> objects_; | 801 GrowableArray<RawRedirectionData*> objects_; |
789 }; | 802 }; |
| 803 #endif // !DART_PRECOMPILED_RUNTIME |
790 | 804 |
791 | 805 |
792 class RedirectionDataDeserializationCluster : public DeserializationCluster { | 806 class RedirectionDataDeserializationCluster : public DeserializationCluster { |
793 public: | 807 public: |
794 RedirectionDataDeserializationCluster() { } | 808 RedirectionDataDeserializationCluster() { } |
795 virtual ~RedirectionDataDeserializationCluster() { } | 809 virtual ~RedirectionDataDeserializationCluster() { } |
796 | 810 |
797 void ReadAlloc(Deserializer* d) { | 811 void ReadAlloc(Deserializer* d) { |
798 start_index_ = d->next_index(); | 812 start_index_ = d->next_index(); |
799 PageSpace* old_space = d->heap()->old_space(); | 813 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 17 matching lines...) Expand all Loading... |
817 RawObject** from = data->from(); | 831 RawObject** from = data->from(); |
818 RawObject** to = data->to(); | 832 RawObject** to = data->to(); |
819 for (RawObject** p = from; p <= to; p++) { | 833 for (RawObject** p = from; p <= to; p++) { |
820 *p = d->ReadRef(); | 834 *p = d->ReadRef(); |
821 } | 835 } |
822 } | 836 } |
823 } | 837 } |
824 }; | 838 }; |
825 | 839 |
826 | 840 |
| 841 #if !defined(DART_PRECOMPILED_RUNTIME) |
827 class FieldSerializationCluster : public SerializationCluster { | 842 class FieldSerializationCluster : public SerializationCluster { |
828 public: | 843 public: |
829 FieldSerializationCluster() { } | 844 FieldSerializationCluster() { } |
830 virtual ~FieldSerializationCluster() { } | 845 virtual ~FieldSerializationCluster() { } |
831 | 846 |
832 void Trace(Serializer* s, RawObject* object) { | 847 void Trace(Serializer* s, RawObject* object) { |
833 RawField* field = Field::RawCast(object); | 848 RawField* field = Field::RawCast(object); |
834 objects_.Add(field); | 849 objects_.Add(field); |
835 | 850 |
836 Snapshot::Kind kind = s->kind(); | 851 Snapshot::Kind kind = s->kind(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
917 s->WriteCid(field->ptr()->guarded_cid_); | 932 s->WriteCid(field->ptr()->guarded_cid_); |
918 s->WriteCid(field->ptr()->is_nullable_); | 933 s->WriteCid(field->ptr()->is_nullable_); |
919 } | 934 } |
920 s->Write<uint8_t>(field->ptr()->kind_bits_); | 935 s->Write<uint8_t>(field->ptr()->kind_bits_); |
921 } | 936 } |
922 } | 937 } |
923 | 938 |
924 private: | 939 private: |
925 GrowableArray<RawField*> objects_; | 940 GrowableArray<RawField*> objects_; |
926 }; | 941 }; |
| 942 #endif // !DART_PRECOMPILED_RUNTIME |
927 | 943 |
928 | 944 |
929 class FieldDeserializationCluster : public DeserializationCluster { | 945 class FieldDeserializationCluster : public DeserializationCluster { |
930 public: | 946 public: |
931 FieldDeserializationCluster() { } | 947 FieldDeserializationCluster() { } |
932 virtual ~FieldDeserializationCluster() { } | 948 virtual ~FieldDeserializationCluster() { } |
933 | 949 |
934 void ReadAlloc(Deserializer* d) { | 950 void ReadAlloc(Deserializer* d) { |
935 start_index_ = d->next_index(); | 951 start_index_ = d->next_index(); |
936 PageSpace* old_space = d->heap()->old_space(); | 952 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 } else { | 1001 } else { |
986 for (intptr_t i = start_index_; i < stop_index_; i++) { | 1002 for (intptr_t i = start_index_; i < stop_index_; i++) { |
987 field ^= refs.At(i); | 1003 field ^= refs.At(i); |
988 field.InitializeGuardedListLengthInObjectOffset(); | 1004 field.InitializeGuardedListLengthInObjectOffset(); |
989 } | 1005 } |
990 } | 1006 } |
991 } | 1007 } |
992 }; | 1008 }; |
993 | 1009 |
994 | 1010 |
| 1011 #if !defined(DART_PRECOMPILED_RUNTIME) |
995 class LiteralTokenSerializationCluster : public SerializationCluster { | 1012 class LiteralTokenSerializationCluster : public SerializationCluster { |
996 public: | 1013 public: |
997 LiteralTokenSerializationCluster() { } | 1014 LiteralTokenSerializationCluster() { } |
998 virtual ~LiteralTokenSerializationCluster() { } | 1015 virtual ~LiteralTokenSerializationCluster() { } |
999 | 1016 |
1000 void Trace(Serializer* s, RawObject* object) { | 1017 void Trace(Serializer* s, RawObject* object) { |
1001 RawLiteralToken* token = LiteralToken::RawCast(object); | 1018 RawLiteralToken* token = LiteralToken::RawCast(object); |
1002 objects_.Add(token); | 1019 objects_.Add(token); |
1003 | 1020 |
1004 RawObject** from = token->from(); | 1021 RawObject** from = token->from(); |
(...skipping 22 matching lines...) Expand all Loading... |
1027 for (RawObject** p = from; p <= to; p++) { | 1044 for (RawObject** p = from; p <= to; p++) { |
1028 s->WriteRef(*p); | 1045 s->WriteRef(*p); |
1029 } | 1046 } |
1030 s->Write<int32_t>(token->ptr()->kind_); | 1047 s->Write<int32_t>(token->ptr()->kind_); |
1031 } | 1048 } |
1032 } | 1049 } |
1033 | 1050 |
1034 private: | 1051 private: |
1035 GrowableArray<RawLiteralToken*> objects_; | 1052 GrowableArray<RawLiteralToken*> objects_; |
1036 }; | 1053 }; |
| 1054 #endif // !DART_PRECOMPILED_RUNTIME |
1037 | 1055 |
1038 | 1056 |
1039 class LiteralTokenDeserializationCluster : public DeserializationCluster { | 1057 class LiteralTokenDeserializationCluster : public DeserializationCluster { |
1040 public: | 1058 public: |
1041 LiteralTokenDeserializationCluster() { } | 1059 LiteralTokenDeserializationCluster() { } |
1042 virtual ~LiteralTokenDeserializationCluster() { } | 1060 virtual ~LiteralTokenDeserializationCluster() { } |
1043 | 1061 |
1044 void ReadAlloc(Deserializer* d) { | 1062 void ReadAlloc(Deserializer* d) { |
1045 start_index_ = d->next_index(); | 1063 start_index_ = d->next_index(); |
1046 PageSpace* old_space = d->heap()->old_space(); | 1064 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 17 matching lines...) Expand all Loading... |
1064 RawObject** to = token->to(); | 1082 RawObject** to = token->to(); |
1065 for (RawObject** p = from; p <= to; p++) { | 1083 for (RawObject** p = from; p <= to; p++) { |
1066 *p = d->ReadRef(); | 1084 *p = d->ReadRef(); |
1067 } | 1085 } |
1068 token->ptr()->kind_ = static_cast<Token::Kind>(d->Read<int32_t>()); | 1086 token->ptr()->kind_ = static_cast<Token::Kind>(d->Read<int32_t>()); |
1069 } | 1087 } |
1070 } | 1088 } |
1071 }; | 1089 }; |
1072 | 1090 |
1073 | 1091 |
| 1092 #if !defined(DART_PRECOMPILED_RUNTIME) |
1074 class TokenStreamSerializationCluster : public SerializationCluster { | 1093 class TokenStreamSerializationCluster : public SerializationCluster { |
1075 public: | 1094 public: |
1076 TokenStreamSerializationCluster() { } | 1095 TokenStreamSerializationCluster() { } |
1077 virtual ~TokenStreamSerializationCluster() { } | 1096 virtual ~TokenStreamSerializationCluster() { } |
1078 | 1097 |
1079 void Trace(Serializer* s, RawObject* object) { | 1098 void Trace(Serializer* s, RawObject* object) { |
1080 RawTokenStream* stream = TokenStream::RawCast(object); | 1099 RawTokenStream* stream = TokenStream::RawCast(object); |
1081 objects_.Add(stream); | 1100 objects_.Add(stream); |
1082 | 1101 |
1083 RawObject** from = stream->from(); | 1102 RawObject** from = stream->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
1105 RawObject** to = stream->to(); | 1124 RawObject** to = stream->to(); |
1106 for (RawObject** p = from; p <= to; p++) { | 1125 for (RawObject** p = from; p <= to; p++) { |
1107 s->WriteRef(*p); | 1126 s->WriteRef(*p); |
1108 } | 1127 } |
1109 } | 1128 } |
1110 } | 1129 } |
1111 | 1130 |
1112 private: | 1131 private: |
1113 GrowableArray<RawTokenStream*> objects_; | 1132 GrowableArray<RawTokenStream*> objects_; |
1114 }; | 1133 }; |
| 1134 #endif // !DART_PRECOMPILED_RUNTIME |
1115 | 1135 |
1116 | 1136 |
1117 class TokenStreamDeserializationCluster : public DeserializationCluster { | 1137 class TokenStreamDeserializationCluster : public DeserializationCluster { |
1118 public: | 1138 public: |
1119 TokenStreamDeserializationCluster() { } | 1139 TokenStreamDeserializationCluster() { } |
1120 virtual ~TokenStreamDeserializationCluster() { } | 1140 virtual ~TokenStreamDeserializationCluster() { } |
1121 | 1141 |
1122 void ReadAlloc(Deserializer* d) { | 1142 void ReadAlloc(Deserializer* d) { |
1123 start_index_ = d->next_index(); | 1143 start_index_ = d->next_index(); |
1124 PageSpace* old_space = d->heap()->old_space(); | 1144 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 15 matching lines...) Expand all Loading... |
1140 RawObject** from = stream->from(); | 1160 RawObject** from = stream->from(); |
1141 RawObject** to = stream->to(); | 1161 RawObject** to = stream->to(); |
1142 for (RawObject** p = from; p <= to; p++) { | 1162 for (RawObject** p = from; p <= to; p++) { |
1143 *p = d->ReadRef(); | 1163 *p = d->ReadRef(); |
1144 } | 1164 } |
1145 } | 1165 } |
1146 } | 1166 } |
1147 }; | 1167 }; |
1148 | 1168 |
1149 | 1169 |
| 1170 #if !defined(DART_PRECOMPILED_RUNTIME) |
1150 class ScriptSerializationCluster : public SerializationCluster { | 1171 class ScriptSerializationCluster : public SerializationCluster { |
1151 public: | 1172 public: |
1152 ScriptSerializationCluster() { } | 1173 ScriptSerializationCluster() { } |
1153 virtual ~ScriptSerializationCluster() { } | 1174 virtual ~ScriptSerializationCluster() { } |
1154 | 1175 |
1155 void Trace(Serializer* s, RawObject* object) { | 1176 void Trace(Serializer* s, RawObject* object) { |
1156 RawScript* script = Script::RawCast(object); | 1177 RawScript* script = Script::RawCast(object); |
1157 objects_.Add(script); | 1178 objects_.Add(script); |
1158 | 1179 |
1159 RawObject** from = script->from(); | 1180 RawObject** from = script->from(); |
(...skipping 26 matching lines...) Expand all Loading... |
1186 | 1207 |
1187 s->Write<int32_t>(script->ptr()->line_offset_); | 1208 s->Write<int32_t>(script->ptr()->line_offset_); |
1188 s->Write<int32_t>(script->ptr()->col_offset_); | 1209 s->Write<int32_t>(script->ptr()->col_offset_); |
1189 s->Write<int8_t>(script->ptr()->kind_); | 1210 s->Write<int8_t>(script->ptr()->kind_); |
1190 } | 1211 } |
1191 } | 1212 } |
1192 | 1213 |
1193 private: | 1214 private: |
1194 GrowableArray<RawScript*> objects_; | 1215 GrowableArray<RawScript*> objects_; |
1195 }; | 1216 }; |
| 1217 #endif // !DART_PRECOMPILED_RUNTIME |
1196 | 1218 |
1197 | 1219 |
1198 class ScriptDeserializationCluster : public DeserializationCluster { | 1220 class ScriptDeserializationCluster : public DeserializationCluster { |
1199 public: | 1221 public: |
1200 ScriptDeserializationCluster() { } | 1222 ScriptDeserializationCluster() { } |
1201 virtual ~ScriptDeserializationCluster() { } | 1223 virtual ~ScriptDeserializationCluster() { } |
1202 | 1224 |
1203 void ReadAlloc(Deserializer* d) { | 1225 void ReadAlloc(Deserializer* d) { |
1204 start_index_ = d->next_index(); | 1226 start_index_ = d->next_index(); |
1205 PageSpace* old_space = d->heap()->old_space(); | 1227 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 24 matching lines...) Expand all Loading... |
1230 | 1252 |
1231 script->ptr()->line_offset_ = d->Read<int32_t>(); | 1253 script->ptr()->line_offset_ = d->Read<int32_t>(); |
1232 script->ptr()->col_offset_ = d->Read<int32_t>(); | 1254 script->ptr()->col_offset_ = d->Read<int32_t>(); |
1233 script->ptr()->kind_ = d->Read<int8_t>(); | 1255 script->ptr()->kind_ = d->Read<int8_t>(); |
1234 script->ptr()->load_timestamp_ = 0; | 1256 script->ptr()->load_timestamp_ = 0; |
1235 } | 1257 } |
1236 } | 1258 } |
1237 }; | 1259 }; |
1238 | 1260 |
1239 | 1261 |
| 1262 #if !defined(DART_PRECOMPILED_RUNTIME) |
1240 class LibrarySerializationCluster : public SerializationCluster { | 1263 class LibrarySerializationCluster : public SerializationCluster { |
1241 public: | 1264 public: |
1242 LibrarySerializationCluster() { } | 1265 LibrarySerializationCluster() { } |
1243 virtual ~LibrarySerializationCluster() { } | 1266 virtual ~LibrarySerializationCluster() { } |
1244 | 1267 |
1245 void Trace(Serializer* s, RawObject* object) { | 1268 void Trace(Serializer* s, RawObject* object) { |
1246 RawLibrary* lib = Library::RawCast(object); | 1269 RawLibrary* lib = Library::RawCast(object); |
1247 objects_.Add(lib); | 1270 objects_.Add(lib); |
1248 | 1271 |
1249 RawObject** from = lib->from(); | 1272 RawObject** from = lib->from(); |
(...skipping 28 matching lines...) Expand all Loading... |
1278 s->Write<int8_t>(lib->ptr()->load_state_); | 1301 s->Write<int8_t>(lib->ptr()->load_state_); |
1279 s->Write<bool>(lib->ptr()->corelib_imported_); | 1302 s->Write<bool>(lib->ptr()->corelib_imported_); |
1280 s->Write<bool>(lib->ptr()->is_dart_scheme_); | 1303 s->Write<bool>(lib->ptr()->is_dart_scheme_); |
1281 s->Write<bool>(lib->ptr()->debuggable_); | 1304 s->Write<bool>(lib->ptr()->debuggable_); |
1282 } | 1305 } |
1283 } | 1306 } |
1284 | 1307 |
1285 private: | 1308 private: |
1286 GrowableArray<RawLibrary*> objects_; | 1309 GrowableArray<RawLibrary*> objects_; |
1287 }; | 1310 }; |
| 1311 #endif // !DART_PRECOMPILED_RUNTIME |
| 1312 |
1288 | 1313 |
1289 class LibraryDeserializationCluster : public DeserializationCluster { | 1314 class LibraryDeserializationCluster : public DeserializationCluster { |
1290 public: | 1315 public: |
1291 LibraryDeserializationCluster() { } | 1316 LibraryDeserializationCluster() { } |
1292 virtual ~LibraryDeserializationCluster() { } | 1317 virtual ~LibraryDeserializationCluster() { } |
1293 | 1318 |
1294 void ReadAlloc(Deserializer* d) { | 1319 void ReadAlloc(Deserializer* d) { |
1295 start_index_ = d->next_index(); | 1320 start_index_ = d->next_index(); |
1296 PageSpace* old_space = d->heap()->old_space(); | 1321 PageSpace* old_space = d->heap()->old_space(); |
1297 intptr_t count = d->Read<int32_t>(); | 1322 intptr_t count = d->Read<int32_t>(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 Library& lib = Library::Handle(zone); | 1365 Library& lib = Library::Handle(zone); |
1341 for (intptr_t i = start_index_; i < stop_index_; i++) { | 1366 for (intptr_t i = start_index_; i < stop_index_; i++) { |
1342 lib ^= refs.At(i); | 1367 lib ^= refs.At(i); |
1343 const intptr_t kInitialNameCacheSize = 64; | 1368 const intptr_t kInitialNameCacheSize = 64; |
1344 lib.InitResolvedNamesCache(kInitialNameCacheSize); | 1369 lib.InitResolvedNamesCache(kInitialNameCacheSize); |
1345 } | 1370 } |
1346 } | 1371 } |
1347 }; | 1372 }; |
1348 | 1373 |
1349 | 1374 |
| 1375 #if !defined(DART_PRECOMPILED_RUNTIME) |
1350 class NamespaceSerializationCluster : public SerializationCluster { | 1376 class NamespaceSerializationCluster : public SerializationCluster { |
1351 public: | 1377 public: |
1352 NamespaceSerializationCluster() { } | 1378 NamespaceSerializationCluster() { } |
1353 virtual ~NamespaceSerializationCluster() { } | 1379 virtual ~NamespaceSerializationCluster() { } |
1354 | 1380 |
1355 void Trace(Serializer* s, RawObject* object) { | 1381 void Trace(Serializer* s, RawObject* object) { |
1356 RawNamespace* ns = Namespace::RawCast(object); | 1382 RawNamespace* ns = Namespace::RawCast(object); |
1357 objects_.Add(ns); | 1383 objects_.Add(ns); |
1358 | 1384 |
1359 RawObject** from = ns->from(); | 1385 RawObject** from = ns->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
1381 RawObject** to = ns->to(); | 1407 RawObject** to = ns->to(); |
1382 for (RawObject** p = from; p <= to; p++) { | 1408 for (RawObject** p = from; p <= to; p++) { |
1383 s->WriteRef(*p); | 1409 s->WriteRef(*p); |
1384 } | 1410 } |
1385 } | 1411 } |
1386 } | 1412 } |
1387 | 1413 |
1388 private: | 1414 private: |
1389 GrowableArray<RawNamespace*> objects_; | 1415 GrowableArray<RawNamespace*> objects_; |
1390 }; | 1416 }; |
| 1417 #endif // !DART_PRECOMPILED_RUNTIME |
1391 | 1418 |
1392 | 1419 |
1393 class NamespaceDeserializationCluster : public DeserializationCluster { | 1420 class NamespaceDeserializationCluster : public DeserializationCluster { |
1394 public: | 1421 public: |
1395 NamespaceDeserializationCluster() { } | 1422 NamespaceDeserializationCluster() { } |
1396 virtual ~NamespaceDeserializationCluster() { } | 1423 virtual ~NamespaceDeserializationCluster() { } |
1397 | 1424 |
1398 void ReadAlloc(Deserializer* d) { | 1425 void ReadAlloc(Deserializer* d) { |
1399 start_index_ = d->next_index(); | 1426 start_index_ = d->next_index(); |
1400 PageSpace* old_space = d->heap()->old_space(); | 1427 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 14 matching lines...) Expand all Loading... |
1415 RawObject** from = ns->from(); | 1442 RawObject** from = ns->from(); |
1416 RawObject** to = ns->to(); | 1443 RawObject** to = ns->to(); |
1417 for (RawObject** p = from; p <= to; p++) { | 1444 for (RawObject** p = from; p <= to; p++) { |
1418 *p = d->ReadRef(); | 1445 *p = d->ReadRef(); |
1419 } | 1446 } |
1420 } | 1447 } |
1421 } | 1448 } |
1422 }; | 1449 }; |
1423 | 1450 |
1424 | 1451 |
| 1452 #if !defined(DART_PRECOMPILED_RUNTIME) |
1425 class CodeSerializationCluster : public SerializationCluster { | 1453 class CodeSerializationCluster : public SerializationCluster { |
1426 public: | 1454 public: |
1427 CodeSerializationCluster() { } | 1455 CodeSerializationCluster() { } |
1428 virtual ~CodeSerializationCluster() { } | 1456 virtual ~CodeSerializationCluster() { } |
1429 | 1457 |
1430 void Trace(Serializer* s, RawObject* object) { | 1458 void Trace(Serializer* s, RawObject* object) { |
1431 RawCode* code = Code::RawCast(object); | 1459 RawCode* code = Code::RawCast(object); |
1432 objects_.Add(code); | 1460 objects_.Add(code); |
1433 | 1461 |
1434 s->Push(code->ptr()->object_pool_); | 1462 s->Push(code->ptr()->object_pool_); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 s->WriteRef(code->ptr()->pc_descriptors_); | 1512 s->WriteRef(code->ptr()->pc_descriptors_); |
1485 s->WriteRef(code->ptr()->stackmaps_); | 1513 s->WriteRef(code->ptr()->stackmaps_); |
1486 | 1514 |
1487 s->Write<int32_t>(code->ptr()->state_bits_); | 1515 s->Write<int32_t>(code->ptr()->state_bits_); |
1488 } | 1516 } |
1489 } | 1517 } |
1490 | 1518 |
1491 private: | 1519 private: |
1492 GrowableArray<RawCode*> objects_; | 1520 GrowableArray<RawCode*> objects_; |
1493 }; | 1521 }; |
| 1522 #endif // !DART_PRECOMPILED_RUNTIME |
1494 | 1523 |
1495 | 1524 |
1496 class CodeDeserializationCluster : public DeserializationCluster { | 1525 class CodeDeserializationCluster : public DeserializationCluster { |
1497 public: | 1526 public: |
1498 CodeDeserializationCluster() { } | 1527 CodeDeserializationCluster() { } |
1499 virtual ~CodeDeserializationCluster() { } | 1528 virtual ~CodeDeserializationCluster() { } |
1500 | 1529 |
1501 void ReadAlloc(Deserializer* d) { | 1530 void ReadAlloc(Deserializer* d) { |
1502 start_index_ = d->next_index(); | 1531 start_index_ = d->next_index(); |
1503 PageSpace* old_space = d->heap()->old_space(); | 1532 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 code->ptr()->return_address_metadata_ = Object::null(); | 1573 code->ptr()->return_address_metadata_ = Object::null(); |
1545 | 1574 |
1546 code->ptr()->compile_timestamp_ = 0; | 1575 code->ptr()->compile_timestamp_ = 0; |
1547 code->ptr()->state_bits_ = d->Read<int32_t>(); | 1576 code->ptr()->state_bits_ = d->Read<int32_t>(); |
1548 code->ptr()->lazy_deopt_pc_offset_ = -1; | 1577 code->ptr()->lazy_deopt_pc_offset_ = -1; |
1549 } | 1578 } |
1550 } | 1579 } |
1551 }; | 1580 }; |
1552 | 1581 |
1553 | 1582 |
| 1583 #if !defined(DART_PRECOMPILED_RUNTIME) |
1554 class ObjectPoolSerializationCluster : public SerializationCluster { | 1584 class ObjectPoolSerializationCluster : public SerializationCluster { |
1555 public: | 1585 public: |
1556 ObjectPoolSerializationCluster() { } | 1586 ObjectPoolSerializationCluster() { } |
1557 virtual ~ObjectPoolSerializationCluster() { } | 1587 virtual ~ObjectPoolSerializationCluster() { } |
1558 | 1588 |
1559 void Trace(Serializer* s, RawObject* object) { | 1589 void Trace(Serializer* s, RawObject* object) { |
1560 RawObjectPool* pool = ObjectPool::RawCast(object); | 1590 RawObjectPool* pool = ObjectPool::RawCast(object); |
1561 objects_.Add(pool); | 1591 objects_.Add(pool); |
1562 | 1592 |
1563 intptr_t length = pool->ptr()->length_; | 1593 intptr_t length = pool->ptr()->length_; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1627 default: | 1657 default: |
1628 UNREACHABLE(); | 1658 UNREACHABLE(); |
1629 } | 1659 } |
1630 } | 1660 } |
1631 } | 1661 } |
1632 } | 1662 } |
1633 | 1663 |
1634 private: | 1664 private: |
1635 GrowableArray<RawObjectPool*> objects_; | 1665 GrowableArray<RawObjectPool*> objects_; |
1636 }; | 1666 }; |
| 1667 #endif // !DART_PRECOMPILED_RUNTIME |
1637 | 1668 |
1638 | 1669 |
1639 class ObjectPoolDeserializationCluster : public DeserializationCluster { | 1670 class ObjectPoolDeserializationCluster : public DeserializationCluster { |
1640 public: | 1671 public: |
1641 ObjectPoolDeserializationCluster() { } | 1672 ObjectPoolDeserializationCluster() { } |
1642 virtual ~ObjectPoolDeserializationCluster() { } | 1673 virtual ~ObjectPoolDeserializationCluster() { } |
1643 | 1674 |
1644 void ReadAlloc(Deserializer* d) { | 1675 void ReadAlloc(Deserializer* d) { |
1645 start_index_ = d->next_index(); | 1676 start_index_ = d->next_index(); |
1646 PageSpace* old_space = d->heap()->old_space(); | 1677 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 } | 1725 } |
1695 default: | 1726 default: |
1696 UNREACHABLE(); | 1727 UNREACHABLE(); |
1697 } | 1728 } |
1698 } | 1729 } |
1699 } | 1730 } |
1700 } | 1731 } |
1701 }; | 1732 }; |
1702 | 1733 |
1703 | 1734 |
| 1735 #if !defined(DART_PRECOMPILED_RUNTIME) |
1704 // PcDescriptor, Stackmap, OneByteString, TwoByteString | 1736 // PcDescriptor, Stackmap, OneByteString, TwoByteString |
1705 class RODataSerializationCluster : public SerializationCluster { | 1737 class RODataSerializationCluster : public SerializationCluster { |
1706 public: | 1738 public: |
1707 explicit RODataSerializationCluster(intptr_t cid) : cid_(cid) { } | 1739 explicit RODataSerializationCluster(intptr_t cid) : cid_(cid) { } |
1708 virtual ~RODataSerializationCluster() { } | 1740 virtual ~RODataSerializationCluster() { } |
1709 | 1741 |
1710 void Trace(Serializer* s, RawObject* object) { | 1742 void Trace(Serializer* s, RawObject* object) { |
1711 objects_.Add(object); | 1743 objects_.Add(object); |
1712 | 1744 |
1713 // A string's hash must already be computed when we write it because it | 1745 // A string's hash must already be computed when we write it because it |
(...skipping 30 matching lines...) Expand all Loading... |
1744 } | 1776 } |
1745 | 1777 |
1746 void WriteFill(Serializer* s) { | 1778 void WriteFill(Serializer* s) { |
1747 // No-op. | 1779 // No-op. |
1748 } | 1780 } |
1749 | 1781 |
1750 private: | 1782 private: |
1751 const intptr_t cid_; | 1783 const intptr_t cid_; |
1752 GrowableArray<RawObject*> objects_; | 1784 GrowableArray<RawObject*> objects_; |
1753 }; | 1785 }; |
| 1786 #endif // !DART_PRECOMPILED_RUNTIME |
1754 | 1787 |
1755 | 1788 |
1756 class RODataDeserializationCluster : public DeserializationCluster { | 1789 class RODataDeserializationCluster : public DeserializationCluster { |
1757 public: | 1790 public: |
1758 RODataDeserializationCluster() { } | 1791 RODataDeserializationCluster() { } |
1759 virtual ~RODataDeserializationCluster() { } | 1792 virtual ~RODataDeserializationCluster() { } |
1760 | 1793 |
1761 void ReadAlloc(Deserializer* d) { | 1794 void ReadAlloc(Deserializer* d) { |
1762 intptr_t count = d->Read<int32_t>(); | 1795 intptr_t count = d->Read<int32_t>(); |
1763 for (intptr_t i = 0; i < count; i++) { | 1796 for (intptr_t i = 0; i < count; i++) { |
1764 int32_t rodata_offset = d->Read<int32_t>(); | 1797 int32_t rodata_offset = d->Read<int32_t>(); |
1765 d->AssignRef(d->GetObjectAt(rodata_offset)); | 1798 d->AssignRef(d->GetObjectAt(rodata_offset)); |
1766 } | 1799 } |
1767 } | 1800 } |
1768 | 1801 |
1769 void ReadFill(Deserializer* d) { | 1802 void ReadFill(Deserializer* d) { |
1770 // No-op. | 1803 // No-op. |
1771 } | 1804 } |
1772 }; | 1805 }; |
1773 | 1806 |
1774 | 1807 |
1775 class LocalVarDescriptorsSerializationCluster : public SerializationCluster { | 1808 #if !defined(DART_PRECOMPILED_RUNTIME) |
1776 public: | |
1777 LocalVarDescriptorsSerializationCluster() { } | |
1778 virtual ~LocalVarDescriptorsSerializationCluster() { } | |
1779 | |
1780 void Trace(Serializer* s, RawObject* object) { UNIMPLEMENTED(); } | |
1781 void WriteAlloc(Serializer* s) {} | |
1782 void WriteFill(Serializer* s) {} | |
1783 | |
1784 private: | |
1785 GrowableArray<RawClass*> objects_; | |
1786 }; | |
1787 | |
1788 | |
1789 class ExceptionHandlersSerializationCluster : public SerializationCluster { | 1809 class ExceptionHandlersSerializationCluster : public SerializationCluster { |
1790 public: | 1810 public: |
1791 ExceptionHandlersSerializationCluster() { } | 1811 ExceptionHandlersSerializationCluster() { } |
1792 virtual ~ExceptionHandlersSerializationCluster() { } | 1812 virtual ~ExceptionHandlersSerializationCluster() { } |
1793 | 1813 |
1794 void Trace(Serializer* s, RawObject* object) { | 1814 void Trace(Serializer* s, RawObject* object) { |
1795 RawExceptionHandlers* handlers = ExceptionHandlers::RawCast(object); | 1815 RawExceptionHandlers* handlers = ExceptionHandlers::RawCast(object); |
1796 objects_.Add(handlers); | 1816 objects_.Add(handlers); |
1797 | 1817 |
1798 s->Push(handlers->ptr()->handled_types_data_); | 1818 s->Push(handlers->ptr()->handled_types_data_); |
(...skipping 22 matching lines...) Expand all Loading... |
1821 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); | 1841 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); |
1822 intptr_t length_in_bytes = | 1842 intptr_t length_in_bytes = |
1823 length * sizeof(RawExceptionHandlers::HandlerInfo); | 1843 length * sizeof(RawExceptionHandlers::HandlerInfo); |
1824 s->WriteBytes(data, length_in_bytes); | 1844 s->WriteBytes(data, length_in_bytes); |
1825 } | 1845 } |
1826 } | 1846 } |
1827 | 1847 |
1828 private: | 1848 private: |
1829 GrowableArray<RawExceptionHandlers*> objects_; | 1849 GrowableArray<RawExceptionHandlers*> objects_; |
1830 }; | 1850 }; |
| 1851 #endif // !DART_PRECOMPILED_RUNTIME |
1831 | 1852 |
1832 | 1853 |
1833 class ExceptionHandlersDeserializationCluster : public DeserializationCluster { | 1854 class ExceptionHandlersDeserializationCluster : public DeserializationCluster { |
1834 public: | 1855 public: |
1835 ExceptionHandlersDeserializationCluster() { } | 1856 ExceptionHandlersDeserializationCluster() { } |
1836 virtual ~ExceptionHandlersDeserializationCluster() { } | 1857 virtual ~ExceptionHandlersDeserializationCluster() { } |
1837 | 1858 |
1838 void ReadAlloc(Deserializer* d) { | 1859 void ReadAlloc(Deserializer* d) { |
1839 start_index_ = d->next_index(); | 1860 start_index_ = d->next_index(); |
1840 PageSpace* old_space = d->heap()->old_space(); | 1861 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 21 matching lines...) Expand all Loading... |
1862 reinterpret_cast<RawArray*>(d->ReadRef()); | 1883 reinterpret_cast<RawArray*>(d->ReadRef()); |
1863 | 1884 |
1864 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); | 1885 uint8_t* data = reinterpret_cast<uint8_t*>(handlers->ptr()->data()); |
1865 intptr_t length_in_bytes = | 1886 intptr_t length_in_bytes = |
1866 length * sizeof(RawExceptionHandlers::HandlerInfo); | 1887 length * sizeof(RawExceptionHandlers::HandlerInfo); |
1867 d->ReadBytes(data, length_in_bytes); | 1888 d->ReadBytes(data, length_in_bytes); |
1868 } | 1889 } |
1869 } | 1890 } |
1870 }; | 1891 }; |
1871 | 1892 |
| 1893 #if !defined(DART_PRECOMPILED_RUNTIME) |
1872 class ContextSerializationCluster : public SerializationCluster { | 1894 class ContextSerializationCluster : public SerializationCluster { |
1873 public: | 1895 public: |
1874 ContextSerializationCluster() { } | 1896 ContextSerializationCluster() { } |
1875 virtual ~ContextSerializationCluster() { } | 1897 virtual ~ContextSerializationCluster() { } |
1876 | 1898 |
1877 void Trace(Serializer* s, RawObject* object) { | 1899 void Trace(Serializer* s, RawObject* object) { |
1878 RawContext* context = Context::RawCast(object); | 1900 RawContext* context = Context::RawCast(object); |
1879 objects_.Add(context); | 1901 objects_.Add(context); |
1880 | 1902 |
1881 s->Push(context->ptr()->parent_); | 1903 s->Push(context->ptr()->parent_); |
(...skipping 24 matching lines...) Expand all Loading... |
1906 s->WriteRef(context->ptr()->parent_); | 1928 s->WriteRef(context->ptr()->parent_); |
1907 for (intptr_t j = 0; j < length; j++) { | 1929 for (intptr_t j = 0; j < length; j++) { |
1908 s->WriteRef(context->ptr()->data()[j]); | 1930 s->WriteRef(context->ptr()->data()[j]); |
1909 } | 1931 } |
1910 } | 1932 } |
1911 } | 1933 } |
1912 | 1934 |
1913 private: | 1935 private: |
1914 GrowableArray<RawContext*> objects_; | 1936 GrowableArray<RawContext*> objects_; |
1915 }; | 1937 }; |
| 1938 #endif // !DART_PRECOMPILED_RUNTIME |
1916 | 1939 |
1917 | 1940 |
1918 class ContextDeserializationCluster : public DeserializationCluster { | 1941 class ContextDeserializationCluster : public DeserializationCluster { |
1919 public: | 1942 public: |
1920 ContextDeserializationCluster() { } | 1943 ContextDeserializationCluster() { } |
1921 virtual ~ContextDeserializationCluster() { } | 1944 virtual ~ContextDeserializationCluster() { } |
1922 | 1945 |
1923 void ReadAlloc(Deserializer* d) { | 1946 void ReadAlloc(Deserializer* d) { |
1924 start_index_ = d->next_index(); | 1947 start_index_ = d->next_index(); |
1925 PageSpace* old_space = d->heap()->old_space(); | 1948 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 18 matching lines...) Expand all Loading... |
1944 context->ptr()->num_variables_ = length; | 1967 context->ptr()->num_variables_ = length; |
1945 context->ptr()->parent_ = reinterpret_cast<RawContext*>(d->ReadRef()); | 1968 context->ptr()->parent_ = reinterpret_cast<RawContext*>(d->ReadRef()); |
1946 for (intptr_t j = 0; j < length; j++) { | 1969 for (intptr_t j = 0; j < length; j++) { |
1947 context->ptr()->data()[j] = d->ReadRef(); | 1970 context->ptr()->data()[j] = d->ReadRef(); |
1948 } | 1971 } |
1949 } | 1972 } |
1950 } | 1973 } |
1951 }; | 1974 }; |
1952 | 1975 |
1953 | 1976 |
| 1977 #if !defined(DART_PRECOMPILED_RUNTIME) |
1954 class ContextScopeSerializationCluster : public SerializationCluster { | 1978 class ContextScopeSerializationCluster : public SerializationCluster { |
1955 public: | 1979 public: |
1956 ContextScopeSerializationCluster() { } | 1980 ContextScopeSerializationCluster() { } |
1957 virtual ~ContextScopeSerializationCluster() { } | 1981 virtual ~ContextScopeSerializationCluster() { } |
1958 | 1982 |
1959 void Trace(Serializer* s, RawObject* object) { | 1983 void Trace(Serializer* s, RawObject* object) { |
1960 RawContextScope* scope = ContextScope::RawCast(object); | 1984 RawContextScope* scope = ContextScope::RawCast(object); |
1961 objects_.Add(scope); | 1985 objects_.Add(scope); |
1962 | 1986 |
1963 intptr_t length = scope->ptr()->num_variables_; | 1987 intptr_t length = scope->ptr()->num_variables_; |
(...skipping 27 matching lines...) Expand all Loading... |
1991 RawObject** to = scope->to(length); | 2015 RawObject** to = scope->to(length); |
1992 for (RawObject** p = from; p <= to; p++) { | 2016 for (RawObject** p = from; p <= to; p++) { |
1993 s->WriteRef(*p); | 2017 s->WriteRef(*p); |
1994 } | 2018 } |
1995 } | 2019 } |
1996 } | 2020 } |
1997 | 2021 |
1998 private: | 2022 private: |
1999 GrowableArray<RawContextScope*> objects_; | 2023 GrowableArray<RawContextScope*> objects_; |
2000 }; | 2024 }; |
| 2025 #endif // !DART_PRECOMPILED_RUNTIME |
2001 | 2026 |
2002 | 2027 |
2003 class ContextScopeDeserializationCluster : public DeserializationCluster { | 2028 class ContextScopeDeserializationCluster : public DeserializationCluster { |
2004 public: | 2029 public: |
2005 ContextScopeDeserializationCluster() { } | 2030 ContextScopeDeserializationCluster() { } |
2006 virtual ~ContextScopeDeserializationCluster() { } | 2031 virtual ~ContextScopeDeserializationCluster() { } |
2007 | 2032 |
2008 void ReadAlloc(Deserializer* d) { | 2033 void ReadAlloc(Deserializer* d) { |
2009 start_index_ = d->next_index(); | 2034 start_index_ = d->next_index(); |
2010 PageSpace* old_space = d->heap()->old_space(); | 2035 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 20 matching lines...) Expand all Loading... |
2031 RawObject** from = scope->from(); | 2056 RawObject** from = scope->from(); |
2032 RawObject** to = scope->to(length); | 2057 RawObject** to = scope->to(length); |
2033 for (RawObject** p = from; p <= to; p++) { | 2058 for (RawObject** p = from; p <= to; p++) { |
2034 *p = d->ReadRef(); | 2059 *p = d->ReadRef(); |
2035 } | 2060 } |
2036 } | 2061 } |
2037 } | 2062 } |
2038 }; | 2063 }; |
2039 | 2064 |
2040 | 2065 |
| 2066 #if !defined(DART_PRECOMPILED_RUNTIME) |
2041 class ICDataSerializationCluster : public SerializationCluster { | 2067 class ICDataSerializationCluster : public SerializationCluster { |
2042 public: | 2068 public: |
2043 ICDataSerializationCluster() { } | 2069 ICDataSerializationCluster() { } |
2044 virtual ~ICDataSerializationCluster() { } | 2070 virtual ~ICDataSerializationCluster() { } |
2045 | 2071 |
2046 void Trace(Serializer* s, RawObject* object) { | 2072 void Trace(Serializer* s, RawObject* object) { |
2047 RawICData* ic = ICData::RawCast(object); | 2073 RawICData* ic = ICData::RawCast(object); |
2048 objects_.Add(ic); | 2074 objects_.Add(ic); |
2049 | 2075 |
2050 RawObject** from = ic->from(); | 2076 RawObject** from = ic->from(); |
(...skipping 27 matching lines...) Expand all Loading... |
2078 s->Write<uint32_t>(ic->ptr()->state_bits_); | 2104 s->Write<uint32_t>(ic->ptr()->state_bits_); |
2079 #if defined(TAG_IC_DATA) | 2105 #if defined(TAG_IC_DATA) |
2080 s->Write<int32_t>(ic->ptr()->tag_); | 2106 s->Write<int32_t>(ic->ptr()->tag_); |
2081 #endif | 2107 #endif |
2082 } | 2108 } |
2083 } | 2109 } |
2084 | 2110 |
2085 private: | 2111 private: |
2086 GrowableArray<RawICData*> objects_; | 2112 GrowableArray<RawICData*> objects_; |
2087 }; | 2113 }; |
| 2114 #endif // !DART_PRECOMPILED_RUNTIME |
2088 | 2115 |
2089 | 2116 |
2090 class ICDataDeserializationCluster : public DeserializationCluster { | 2117 class ICDataDeserializationCluster : public DeserializationCluster { |
2091 public: | 2118 public: |
2092 ICDataDeserializationCluster() { } | 2119 ICDataDeserializationCluster() { } |
2093 virtual ~ICDataDeserializationCluster() { } | 2120 virtual ~ICDataDeserializationCluster() { } |
2094 | 2121 |
2095 void ReadAlloc(Deserializer* d) { | 2122 void ReadAlloc(Deserializer* d) { |
2096 start_index_ = d->next_index(); | 2123 start_index_ = d->next_index(); |
2097 PageSpace* old_space = d->heap()->old_space(); | 2124 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 24 matching lines...) Expand all Loading... |
2122 ic->ptr()->deopt_id_ = d->Read<int32_t>(); | 2149 ic->ptr()->deopt_id_ = d->Read<int32_t>(); |
2123 ic->ptr()->state_bits_ = d->Read<int32_t>(); | 2150 ic->ptr()->state_bits_ = d->Read<int32_t>(); |
2124 #if defined(TAG_IC_DATA) | 2151 #if defined(TAG_IC_DATA) |
2125 ic->ptr()->tag_ = d->Read<int32_t>(); | 2152 ic->ptr()->tag_ = d->Read<int32_t>(); |
2126 #endif | 2153 #endif |
2127 } | 2154 } |
2128 } | 2155 } |
2129 }; | 2156 }; |
2130 | 2157 |
2131 | 2158 |
| 2159 #if !defined(DART_PRECOMPILED_RUNTIME) |
2132 class MegamorphicCacheSerializationCluster : public SerializationCluster { | 2160 class MegamorphicCacheSerializationCluster : public SerializationCluster { |
2133 public: | 2161 public: |
2134 MegamorphicCacheSerializationCluster() { } | 2162 MegamorphicCacheSerializationCluster() { } |
2135 virtual ~MegamorphicCacheSerializationCluster() { } | 2163 virtual ~MegamorphicCacheSerializationCluster() { } |
2136 | 2164 |
2137 void Trace(Serializer* s, RawObject* object) { | 2165 void Trace(Serializer* s, RawObject* object) { |
2138 RawMegamorphicCache* cache = MegamorphicCache::RawCast(object); | 2166 RawMegamorphicCache* cache = MegamorphicCache::RawCast(object); |
2139 objects_.Add(cache); | 2167 objects_.Add(cache); |
2140 | 2168 |
2141 RawObject** from = cache->from(); | 2169 RawObject** from = cache->from(); |
(...skipping 22 matching lines...) Expand all Loading... |
2164 for (RawObject** p = from; p <= to; p++) { | 2192 for (RawObject** p = from; p <= to; p++) { |
2165 s->WriteRef(*p); | 2193 s->WriteRef(*p); |
2166 } | 2194 } |
2167 s->Write<int32_t>(cache->ptr()->filled_entry_count_); | 2195 s->Write<int32_t>(cache->ptr()->filled_entry_count_); |
2168 } | 2196 } |
2169 } | 2197 } |
2170 | 2198 |
2171 private: | 2199 private: |
2172 GrowableArray<RawMegamorphicCache*> objects_; | 2200 GrowableArray<RawMegamorphicCache*> objects_; |
2173 }; | 2201 }; |
| 2202 #endif // !DART_PRECOMPILED_RUNTIME |
2174 | 2203 |
2175 | 2204 |
2176 class MegamorphicCacheDeserializationCluster : public DeserializationCluster { | 2205 class MegamorphicCacheDeserializationCluster : public DeserializationCluster { |
2177 public: | 2206 public: |
2178 MegamorphicCacheDeserializationCluster() { } | 2207 MegamorphicCacheDeserializationCluster() { } |
2179 virtual ~MegamorphicCacheDeserializationCluster() { } | 2208 virtual ~MegamorphicCacheDeserializationCluster() { } |
2180 | 2209 |
2181 void ReadAlloc(Deserializer* d) { | 2210 void ReadAlloc(Deserializer* d) { |
2182 start_index_ = d->next_index(); | 2211 start_index_ = d->next_index(); |
2183 PageSpace* old_space = d->heap()->old_space(); | 2212 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 18 matching lines...) Expand all Loading... |
2202 RawObject** to = cache->to(); | 2231 RawObject** to = cache->to(); |
2203 for (RawObject** p = from; p <= to; p++) { | 2232 for (RawObject** p = from; p <= to; p++) { |
2204 *p = d->ReadRef(); | 2233 *p = d->ReadRef(); |
2205 } | 2234 } |
2206 cache->ptr()->filled_entry_count_ = d->Read<int32_t>(); | 2235 cache->ptr()->filled_entry_count_ = d->Read<int32_t>(); |
2207 } | 2236 } |
2208 } | 2237 } |
2209 }; | 2238 }; |
2210 | 2239 |
2211 | 2240 |
| 2241 #if !defined(DART_PRECOMPILED_RUNTIME) |
2212 class SubtypeTestCacheSerializationCluster : public SerializationCluster { | 2242 class SubtypeTestCacheSerializationCluster : public SerializationCluster { |
2213 public: | 2243 public: |
2214 SubtypeTestCacheSerializationCluster() { } | 2244 SubtypeTestCacheSerializationCluster() { } |
2215 virtual ~SubtypeTestCacheSerializationCluster() { } | 2245 virtual ~SubtypeTestCacheSerializationCluster() { } |
2216 | 2246 |
2217 void Trace(Serializer* s, RawObject* object) { | 2247 void Trace(Serializer* s, RawObject* object) { |
2218 RawSubtypeTestCache* cache = SubtypeTestCache::RawCast(object); | 2248 RawSubtypeTestCache* cache = SubtypeTestCache::RawCast(object); |
2219 objects_.Add(cache); | 2249 objects_.Add(cache); |
2220 s->Push(cache->ptr()->cache_); | 2250 s->Push(cache->ptr()->cache_); |
2221 } | 2251 } |
(...skipping 12 matching lines...) Expand all Loading... |
2234 intptr_t count = objects_.length(); | 2264 intptr_t count = objects_.length(); |
2235 for (intptr_t i = 0; i < count; i++) { | 2265 for (intptr_t i = 0; i < count; i++) { |
2236 RawSubtypeTestCache* cache = objects_[i]; | 2266 RawSubtypeTestCache* cache = objects_[i]; |
2237 s->WriteRef(cache->ptr()->cache_); | 2267 s->WriteRef(cache->ptr()->cache_); |
2238 } | 2268 } |
2239 } | 2269 } |
2240 | 2270 |
2241 private: | 2271 private: |
2242 GrowableArray<RawSubtypeTestCache*> objects_; | 2272 GrowableArray<RawSubtypeTestCache*> objects_; |
2243 }; | 2273 }; |
| 2274 #endif // !DART_PRECOMPILED_RUNTIME |
2244 | 2275 |
2245 | 2276 |
2246 class SubtypeTestCacheDeserializationCluster : public DeserializationCluster { | 2277 class SubtypeTestCacheDeserializationCluster : public DeserializationCluster { |
2247 public: | 2278 public: |
2248 SubtypeTestCacheDeserializationCluster() { } | 2279 SubtypeTestCacheDeserializationCluster() { } |
2249 virtual ~SubtypeTestCacheDeserializationCluster() { } | 2280 virtual ~SubtypeTestCacheDeserializationCluster() { } |
2250 | 2281 |
2251 void ReadAlloc(Deserializer* d) { | 2282 void ReadAlloc(Deserializer* d) { |
2252 start_index_ = d->next_index(); | 2283 start_index_ = d->next_index(); |
2253 PageSpace* old_space = d->heap()->old_space(); | 2284 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 13 matching lines...) Expand all Loading... |
2267 reinterpret_cast<RawSubtypeTestCache*>(d->Ref(id)); | 2298 reinterpret_cast<RawSubtypeTestCache*>(d->Ref(id)); |
2268 Deserializer::InitializeHeader(cache, kSubtypeTestCacheCid, | 2299 Deserializer::InitializeHeader(cache, kSubtypeTestCacheCid, |
2269 SubtypeTestCache::InstanceSize(), | 2300 SubtypeTestCache::InstanceSize(), |
2270 is_vm_object); | 2301 is_vm_object); |
2271 cache->ptr()->cache_ = reinterpret_cast<RawArray*>(d->ReadRef()); | 2302 cache->ptr()->cache_ = reinterpret_cast<RawArray*>(d->ReadRef()); |
2272 } | 2303 } |
2273 } | 2304 } |
2274 }; | 2305 }; |
2275 | 2306 |
2276 | 2307 |
| 2308 #if !defined(DART_PRECOMPILED_RUNTIME) |
2277 class LanguageErrorSerializationCluster : public SerializationCluster { | 2309 class LanguageErrorSerializationCluster : public SerializationCluster { |
2278 public: | 2310 public: |
2279 LanguageErrorSerializationCluster() { } | 2311 LanguageErrorSerializationCluster() { } |
2280 virtual ~LanguageErrorSerializationCluster() { } | 2312 virtual ~LanguageErrorSerializationCluster() { } |
2281 | 2313 |
2282 void Trace(Serializer* s, RawObject* object) { | 2314 void Trace(Serializer* s, RawObject* object) { |
2283 RawLanguageError* error = LanguageError::RawCast(object); | 2315 RawLanguageError* error = LanguageError::RawCast(object); |
2284 objects_.Add(error); | 2316 objects_.Add(error); |
2285 | 2317 |
2286 RawObject** from = error->from(); | 2318 RawObject** from = error->from(); |
(...skipping 24 matching lines...) Expand all Loading... |
2311 } | 2343 } |
2312 s->WriteTokenPosition(error->ptr()->token_pos_); | 2344 s->WriteTokenPosition(error->ptr()->token_pos_); |
2313 s->Write<bool>(error->ptr()->report_after_token_); | 2345 s->Write<bool>(error->ptr()->report_after_token_); |
2314 s->Write<int8_t>(error->ptr()->kind_); | 2346 s->Write<int8_t>(error->ptr()->kind_); |
2315 } | 2347 } |
2316 } | 2348 } |
2317 | 2349 |
2318 private: | 2350 private: |
2319 GrowableArray<RawLanguageError*> objects_; | 2351 GrowableArray<RawLanguageError*> objects_; |
2320 }; | 2352 }; |
| 2353 #endif // !DART_PRECOMPILED_RUNTIME |
2321 | 2354 |
2322 | 2355 |
2323 class LanguageErrorDeserializationCluster : public DeserializationCluster { | 2356 class LanguageErrorDeserializationCluster : public DeserializationCluster { |
2324 public: | 2357 public: |
2325 LanguageErrorDeserializationCluster() { } | 2358 LanguageErrorDeserializationCluster() { } |
2326 virtual ~LanguageErrorDeserializationCluster() { } | 2359 virtual ~LanguageErrorDeserializationCluster() { } |
2327 | 2360 |
2328 void ReadAlloc(Deserializer* d) { | 2361 void ReadAlloc(Deserializer* d) { |
2329 start_index_ = d->next_index(); | 2362 start_index_ = d->next_index(); |
2330 PageSpace* old_space = d->heap()->old_space(); | 2363 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 19 matching lines...) Expand all Loading... |
2350 *p = d->ReadRef(); | 2383 *p = d->ReadRef(); |
2351 } | 2384 } |
2352 error->ptr()->token_pos_ = d->ReadTokenPosition(); | 2385 error->ptr()->token_pos_ = d->ReadTokenPosition(); |
2353 error->ptr()->report_after_token_ = d->Read<bool>(); | 2386 error->ptr()->report_after_token_ = d->Read<bool>(); |
2354 error->ptr()->kind_ = d->Read<int8_t>(); | 2387 error->ptr()->kind_ = d->Read<int8_t>(); |
2355 } | 2388 } |
2356 } | 2389 } |
2357 }; | 2390 }; |
2358 | 2391 |
2359 | 2392 |
| 2393 #if !defined(DART_PRECOMPILED_RUNTIME) |
2360 class UnhandledExceptionSerializationCluster : public SerializationCluster { | 2394 class UnhandledExceptionSerializationCluster : public SerializationCluster { |
2361 public: | 2395 public: |
2362 UnhandledExceptionSerializationCluster() { } | 2396 UnhandledExceptionSerializationCluster() { } |
2363 virtual ~UnhandledExceptionSerializationCluster() { } | 2397 virtual ~UnhandledExceptionSerializationCluster() { } |
2364 | 2398 |
2365 void Trace(Serializer* s, RawObject* object) { | 2399 void Trace(Serializer* s, RawObject* object) { |
2366 RawUnhandledException* exception = UnhandledException::RawCast(object); | 2400 RawUnhandledException* exception = UnhandledException::RawCast(object); |
2367 objects_.Add(exception); | 2401 objects_.Add(exception); |
2368 | 2402 |
2369 RawObject** from = exception->from(); | 2403 RawObject** from = exception->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
2391 RawObject** to = exception->to(); | 2425 RawObject** to = exception->to(); |
2392 for (RawObject** p = from; p <= to; p++) { | 2426 for (RawObject** p = from; p <= to; p++) { |
2393 s->WriteRef(*p); | 2427 s->WriteRef(*p); |
2394 } | 2428 } |
2395 } | 2429 } |
2396 } | 2430 } |
2397 | 2431 |
2398 private: | 2432 private: |
2399 GrowableArray<RawUnhandledException*> objects_; | 2433 GrowableArray<RawUnhandledException*> objects_; |
2400 }; | 2434 }; |
| 2435 #endif // !DART_PRECOMPILED_RUNTIME |
2401 | 2436 |
2402 | 2437 |
2403 class UnhandledExceptionDeserializationCluster : public DeserializationCluster { | 2438 class UnhandledExceptionDeserializationCluster : public DeserializationCluster { |
2404 public: | 2439 public: |
2405 UnhandledExceptionDeserializationCluster() { } | 2440 UnhandledExceptionDeserializationCluster() { } |
2406 virtual ~UnhandledExceptionDeserializationCluster() { } | 2441 virtual ~UnhandledExceptionDeserializationCluster() { } |
2407 | 2442 |
2408 void ReadAlloc(Deserializer* d) { | 2443 void ReadAlloc(Deserializer* d) { |
2409 start_index_ = d->next_index(); | 2444 start_index_ = d->next_index(); |
2410 PageSpace* old_space = d->heap()->old_space(); | 2445 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 17 matching lines...) Expand all Loading... |
2428 RawObject** from = exception->from(); | 2463 RawObject** from = exception->from(); |
2429 RawObject** to = exception->to(); | 2464 RawObject** to = exception->to(); |
2430 for (RawObject** p = from; p <= to; p++) { | 2465 for (RawObject** p = from; p <= to; p++) { |
2431 *p = d->ReadRef(); | 2466 *p = d->ReadRef(); |
2432 } | 2467 } |
2433 } | 2468 } |
2434 } | 2469 } |
2435 }; | 2470 }; |
2436 | 2471 |
2437 | 2472 |
| 2473 #if !defined(DART_PRECOMPILED_RUNTIME) |
2438 class InstanceSerializationCluster : public SerializationCluster { | 2474 class InstanceSerializationCluster : public SerializationCluster { |
2439 public: | 2475 public: |
2440 explicit InstanceSerializationCluster(intptr_t cid) : cid_(cid) { | 2476 explicit InstanceSerializationCluster(intptr_t cid) : cid_(cid) { |
2441 RawClass* cls = Isolate::Current()->class_table()->At(cid); | 2477 RawClass* cls = Isolate::Current()->class_table()->At(cid); |
2442 next_field_offset_in_words_ = cls->ptr()->next_field_offset_in_words_; | 2478 next_field_offset_in_words_ = cls->ptr()->next_field_offset_in_words_; |
2443 instance_size_in_words_ = cls->ptr()->instance_size_in_words_; | 2479 instance_size_in_words_ = cls->ptr()->instance_size_in_words_; |
2444 ASSERT(next_field_offset_in_words_ > 0); | 2480 ASSERT(next_field_offset_in_words_ > 0); |
2445 ASSERT(instance_size_in_words_ > 0); | 2481 ASSERT(instance_size_in_words_ > 0); |
2446 } | 2482 } |
2447 virtual ~InstanceSerializationCluster() { } | 2483 virtual ~InstanceSerializationCluster() { } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2489 } | 2525 } |
2490 } | 2526 } |
2491 } | 2527 } |
2492 | 2528 |
2493 private: | 2529 private: |
2494 const intptr_t cid_; | 2530 const intptr_t cid_; |
2495 intptr_t next_field_offset_in_words_; | 2531 intptr_t next_field_offset_in_words_; |
2496 intptr_t instance_size_in_words_; | 2532 intptr_t instance_size_in_words_; |
2497 GrowableArray<RawInstance*> objects_; | 2533 GrowableArray<RawInstance*> objects_; |
2498 }; | 2534 }; |
| 2535 #endif // !DART_PRECOMPILED_RUNTIME |
2499 | 2536 |
2500 | 2537 |
2501 class InstanceDeserializationCluster : public DeserializationCluster { | 2538 class InstanceDeserializationCluster : public DeserializationCluster { |
2502 public: | 2539 public: |
2503 explicit InstanceDeserializationCluster(intptr_t cid) : cid_(cid) { } | 2540 explicit InstanceDeserializationCluster(intptr_t cid) : cid_(cid) { } |
2504 virtual ~InstanceDeserializationCluster() { } | 2541 virtual ~InstanceDeserializationCluster() { } |
2505 | 2542 |
2506 void ReadAlloc(Deserializer* d) { | 2543 void ReadAlloc(Deserializer* d) { |
2507 start_index_ = d->next_index(); | 2544 start_index_ = d->next_index(); |
2508 PageSpace* old_space = d->heap()->old_space(); | 2545 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2546 } | 2583 } |
2547 } | 2584 } |
2548 | 2585 |
2549 private: | 2586 private: |
2550 const intptr_t cid_; | 2587 const intptr_t cid_; |
2551 intptr_t next_field_offset_in_words_; | 2588 intptr_t next_field_offset_in_words_; |
2552 intptr_t instance_size_in_words_; | 2589 intptr_t instance_size_in_words_; |
2553 }; | 2590 }; |
2554 | 2591 |
2555 | 2592 |
| 2593 #if !defined(DART_PRECOMPILED_RUNTIME) |
2556 class LibraryPrefixSerializationCluster : public SerializationCluster { | 2594 class LibraryPrefixSerializationCluster : public SerializationCluster { |
2557 public: | 2595 public: |
2558 LibraryPrefixSerializationCluster() { } | 2596 LibraryPrefixSerializationCluster() { } |
2559 virtual ~LibraryPrefixSerializationCluster() { } | 2597 virtual ~LibraryPrefixSerializationCluster() { } |
2560 | 2598 |
2561 void Trace(Serializer* s, RawObject* object) { | 2599 void Trace(Serializer* s, RawObject* object) { |
2562 RawLibraryPrefix* prefix = LibraryPrefix::RawCast(object); | 2600 RawLibraryPrefix* prefix = LibraryPrefix::RawCast(object); |
2563 objects_.Add(prefix); | 2601 objects_.Add(prefix); |
2564 | 2602 |
2565 RawObject** from = prefix->from(); | 2603 RawObject** from = prefix->from(); |
(...skipping 24 matching lines...) Expand all Loading... |
2590 } | 2628 } |
2591 s->Write<uint16_t>(prefix->ptr()->num_imports_); | 2629 s->Write<uint16_t>(prefix->ptr()->num_imports_); |
2592 s->Write<bool>(prefix->ptr()->is_deferred_load_); | 2630 s->Write<bool>(prefix->ptr()->is_deferred_load_); |
2593 s->Write<bool>(prefix->ptr()->is_loaded_); | 2631 s->Write<bool>(prefix->ptr()->is_loaded_); |
2594 } | 2632 } |
2595 } | 2633 } |
2596 | 2634 |
2597 private: | 2635 private: |
2598 GrowableArray<RawLibraryPrefix*> objects_; | 2636 GrowableArray<RawLibraryPrefix*> objects_; |
2599 }; | 2637 }; |
| 2638 #endif // !DART_PRECOMPILED_RUNTIME |
2600 | 2639 |
2601 | 2640 |
2602 class LibraryPrefixDeserializationCluster : public DeserializationCluster { | 2641 class LibraryPrefixDeserializationCluster : public DeserializationCluster { |
2603 public: | 2642 public: |
2604 LibraryPrefixDeserializationCluster() { } | 2643 LibraryPrefixDeserializationCluster() { } |
2605 virtual ~LibraryPrefixDeserializationCluster() { } | 2644 virtual ~LibraryPrefixDeserializationCluster() { } |
2606 | 2645 |
2607 void ReadAlloc(Deserializer* d) { | 2646 void ReadAlloc(Deserializer* d) { |
2608 start_index_ = d->next_index(); | 2647 start_index_ = d->next_index(); |
2609 PageSpace* old_space = d->heap()->old_space(); | 2648 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 20 matching lines...) Expand all Loading... |
2630 *p = d->ReadRef(); | 2669 *p = d->ReadRef(); |
2631 } | 2670 } |
2632 prefix->ptr()->num_imports_ = d->Read<uint16_t>(); | 2671 prefix->ptr()->num_imports_ = d->Read<uint16_t>(); |
2633 prefix->ptr()->is_deferred_load_ = d->Read<bool>(); | 2672 prefix->ptr()->is_deferred_load_ = d->Read<bool>(); |
2634 prefix->ptr()->is_loaded_ = d->Read<bool>(); | 2673 prefix->ptr()->is_loaded_ = d->Read<bool>(); |
2635 } | 2674 } |
2636 } | 2675 } |
2637 }; | 2676 }; |
2638 | 2677 |
2639 | 2678 |
| 2679 #if !defined(DART_PRECOMPILED_RUNTIME) |
2640 class TypeSerializationCluster : public SerializationCluster { | 2680 class TypeSerializationCluster : public SerializationCluster { |
2641 public: | 2681 public: |
2642 TypeSerializationCluster() { } | 2682 TypeSerializationCluster() { } |
2643 virtual ~TypeSerializationCluster() { } | 2683 virtual ~TypeSerializationCluster() { } |
2644 | 2684 |
2645 void Trace(Serializer* s, RawObject* object) { | 2685 void Trace(Serializer* s, RawObject* object) { |
2646 RawType* type = Type::RawCast(object); | 2686 RawType* type = Type::RawCast(object); |
2647 if (type->IsCanonical()) { | 2687 if (type->IsCanonical()) { |
2648 canonical_objects_.Add(type); | 2688 canonical_objects_.Add(type); |
2649 } else { | 2689 } else { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2700 } | 2740 } |
2701 s->WriteTokenPosition(type->ptr()->token_pos_); | 2741 s->WriteTokenPosition(type->ptr()->token_pos_); |
2702 s->Write<int8_t>(type->ptr()->type_state_); | 2742 s->Write<int8_t>(type->ptr()->type_state_); |
2703 } | 2743 } |
2704 } | 2744 } |
2705 | 2745 |
2706 private: | 2746 private: |
2707 GrowableArray<RawType*> canonical_objects_; | 2747 GrowableArray<RawType*> canonical_objects_; |
2708 GrowableArray<RawType*> objects_; | 2748 GrowableArray<RawType*> objects_; |
2709 }; | 2749 }; |
| 2750 #endif // !DART_PRECOMPILED_RUNTIME |
2710 | 2751 |
2711 | 2752 |
2712 class TypeDeserializationCluster : public DeserializationCluster { | 2753 class TypeDeserializationCluster : public DeserializationCluster { |
2713 public: | 2754 public: |
2714 TypeDeserializationCluster() { } | 2755 TypeDeserializationCluster() { } |
2715 virtual ~TypeDeserializationCluster() { } | 2756 virtual ~TypeDeserializationCluster() { } |
2716 | 2757 |
2717 void ReadAlloc(Deserializer* d) { | 2758 void ReadAlloc(Deserializer* d) { |
2718 canonical_start_index_ = d->next_index(); | 2759 canonical_start_index_ = d->next_index(); |
2719 PageSpace* old_space = d->heap()->old_space(); | 2760 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2762 type->ptr()->type_state_ = d->Read<int8_t>(); | 2803 type->ptr()->type_state_ = d->Read<int8_t>(); |
2763 } | 2804 } |
2764 } | 2805 } |
2765 | 2806 |
2766 private: | 2807 private: |
2767 intptr_t canonical_start_index_; | 2808 intptr_t canonical_start_index_; |
2768 intptr_t canonical_stop_index_; | 2809 intptr_t canonical_stop_index_; |
2769 }; | 2810 }; |
2770 | 2811 |
2771 | 2812 |
| 2813 #if !defined(DART_PRECOMPILED_RUNTIME) |
2772 class TypeRefSerializationCluster : public SerializationCluster { | 2814 class TypeRefSerializationCluster : public SerializationCluster { |
2773 public: | 2815 public: |
2774 TypeRefSerializationCluster() { } | 2816 TypeRefSerializationCluster() { } |
2775 virtual ~TypeRefSerializationCluster() { } | 2817 virtual ~TypeRefSerializationCluster() { } |
2776 | 2818 |
2777 void Trace(Serializer* s, RawObject* object) { | 2819 void Trace(Serializer* s, RawObject* object) { |
2778 RawTypeRef* type = TypeRef::RawCast(object); | 2820 RawTypeRef* type = TypeRef::RawCast(object); |
2779 objects_.Add(type); | 2821 objects_.Add(type); |
2780 | 2822 |
2781 RawObject** from = type->from(); | 2823 RawObject** from = type->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
2803 RawObject** to = type->to(); | 2845 RawObject** to = type->to(); |
2804 for (RawObject** p = from; p <= to; p++) { | 2846 for (RawObject** p = from; p <= to; p++) { |
2805 s->WriteRef(*p); | 2847 s->WriteRef(*p); |
2806 } | 2848 } |
2807 } | 2849 } |
2808 } | 2850 } |
2809 | 2851 |
2810 private: | 2852 private: |
2811 GrowableArray<RawTypeRef*> objects_; | 2853 GrowableArray<RawTypeRef*> objects_; |
2812 }; | 2854 }; |
| 2855 #endif // !DART_PRECOMPILED_RUNTIME |
2813 | 2856 |
2814 | 2857 |
2815 class TypeRefDeserializationCluster : public DeserializationCluster { | 2858 class TypeRefDeserializationCluster : public DeserializationCluster { |
2816 public: | 2859 public: |
2817 TypeRefDeserializationCluster() { } | 2860 TypeRefDeserializationCluster() { } |
2818 virtual ~TypeRefDeserializationCluster() { } | 2861 virtual ~TypeRefDeserializationCluster() { } |
2819 | 2862 |
2820 void ReadAlloc(Deserializer* d) { | 2863 void ReadAlloc(Deserializer* d) { |
2821 start_index_ = d->next_index(); | 2864 start_index_ = d->next_index(); |
2822 PageSpace* old_space = d->heap()->old_space(); | 2865 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 14 matching lines...) Expand all Loading... |
2837 RawObject** from = type->from(); | 2880 RawObject** from = type->from(); |
2838 RawObject** to = type->to(); | 2881 RawObject** to = type->to(); |
2839 for (RawObject** p = from; p <= to; p++) { | 2882 for (RawObject** p = from; p <= to; p++) { |
2840 *p = d->ReadRef(); | 2883 *p = d->ReadRef(); |
2841 } | 2884 } |
2842 } | 2885 } |
2843 } | 2886 } |
2844 }; | 2887 }; |
2845 | 2888 |
2846 | 2889 |
| 2890 #if !defined(DART_PRECOMPILED_RUNTIME) |
2847 class TypeParameterSerializationCluster : public SerializationCluster { | 2891 class TypeParameterSerializationCluster : public SerializationCluster { |
2848 public: | 2892 public: |
2849 TypeParameterSerializationCluster() { } | 2893 TypeParameterSerializationCluster() { } |
2850 virtual ~TypeParameterSerializationCluster() { } | 2894 virtual ~TypeParameterSerializationCluster() { } |
2851 | 2895 |
2852 void Trace(Serializer* s, RawObject* object) { | 2896 void Trace(Serializer* s, RawObject* object) { |
2853 RawTypeParameter* type = TypeParameter::RawCast(object); | 2897 RawTypeParameter* type = TypeParameter::RawCast(object); |
2854 objects_.Add(type); | 2898 objects_.Add(type); |
2855 ASSERT(!type->IsCanonical()); | 2899 ASSERT(!type->IsCanonical()); |
2856 | 2900 |
(...skipping 26 matching lines...) Expand all Loading... |
2883 s->Write<int32_t>(type->ptr()->parameterized_class_id_); | 2927 s->Write<int32_t>(type->ptr()->parameterized_class_id_); |
2884 s->WriteTokenPosition(type->ptr()->token_pos_); | 2928 s->WriteTokenPosition(type->ptr()->token_pos_); |
2885 s->Write<int16_t>(type->ptr()->index_); | 2929 s->Write<int16_t>(type->ptr()->index_); |
2886 s->Write<int8_t>(type->ptr()->type_state_); | 2930 s->Write<int8_t>(type->ptr()->type_state_); |
2887 } | 2931 } |
2888 } | 2932 } |
2889 | 2933 |
2890 private: | 2934 private: |
2891 GrowableArray<RawTypeParameter*> objects_; | 2935 GrowableArray<RawTypeParameter*> objects_; |
2892 }; | 2936 }; |
| 2937 #endif // !DART_PRECOMPILED_RUNTIME |
2893 | 2938 |
2894 | 2939 |
2895 class TypeParameterDeserializationCluster : public DeserializationCluster { | 2940 class TypeParameterDeserializationCluster : public DeserializationCluster { |
2896 public: | 2941 public: |
2897 TypeParameterDeserializationCluster() { } | 2942 TypeParameterDeserializationCluster() { } |
2898 virtual ~TypeParameterDeserializationCluster() { } | 2943 virtual ~TypeParameterDeserializationCluster() { } |
2899 | 2944 |
2900 void ReadAlloc(Deserializer* d) { | 2945 void ReadAlloc(Deserializer* d) { |
2901 start_index_ = d->next_index(); | 2946 start_index_ = d->next_index(); |
2902 PageSpace* old_space = d->heap()->old_space(); | 2947 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 20 matching lines...) Expand all Loading... |
2923 } | 2968 } |
2924 type->ptr()->parameterized_class_id_ = d->Read<int32_t>(); | 2969 type->ptr()->parameterized_class_id_ = d->Read<int32_t>(); |
2925 type->ptr()->token_pos_ = d->ReadTokenPosition(); | 2970 type->ptr()->token_pos_ = d->ReadTokenPosition(); |
2926 type->ptr()->index_ = d->Read<int16_t>(); | 2971 type->ptr()->index_ = d->Read<int16_t>(); |
2927 type->ptr()->type_state_ = d->Read<int8_t>(); | 2972 type->ptr()->type_state_ = d->Read<int8_t>(); |
2928 } | 2973 } |
2929 } | 2974 } |
2930 }; | 2975 }; |
2931 | 2976 |
2932 | 2977 |
| 2978 #if !defined(DART_PRECOMPILED_RUNTIME) |
2933 class BoundedTypeSerializationCluster : public SerializationCluster { | 2979 class BoundedTypeSerializationCluster : public SerializationCluster { |
2934 public: | 2980 public: |
2935 BoundedTypeSerializationCluster() { } | 2981 BoundedTypeSerializationCluster() { } |
2936 virtual ~BoundedTypeSerializationCluster() { } | 2982 virtual ~BoundedTypeSerializationCluster() { } |
2937 | 2983 |
2938 void Trace(Serializer* s, RawObject* object) { | 2984 void Trace(Serializer* s, RawObject* object) { |
2939 RawBoundedType* type = BoundedType::RawCast(object); | 2985 RawBoundedType* type = BoundedType::RawCast(object); |
2940 objects_.Add(type); | 2986 objects_.Add(type); |
2941 | 2987 |
2942 RawObject** from = type->from(); | 2988 RawObject** from = type->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
2964 RawObject** to = type->to(); | 3010 RawObject** to = type->to(); |
2965 for (RawObject** p = from; p <= to; p++) { | 3011 for (RawObject** p = from; p <= to; p++) { |
2966 s->WriteRef(*p); | 3012 s->WriteRef(*p); |
2967 } | 3013 } |
2968 } | 3014 } |
2969 } | 3015 } |
2970 | 3016 |
2971 private: | 3017 private: |
2972 GrowableArray<RawBoundedType*> objects_; | 3018 GrowableArray<RawBoundedType*> objects_; |
2973 }; | 3019 }; |
| 3020 #endif // !DART_PRECOMPILED_RUNTIME |
2974 | 3021 |
2975 | 3022 |
2976 class BoundedTypeDeserializationCluster : public DeserializationCluster { | 3023 class BoundedTypeDeserializationCluster : public DeserializationCluster { |
2977 public: | 3024 public: |
2978 BoundedTypeDeserializationCluster() { } | 3025 BoundedTypeDeserializationCluster() { } |
2979 virtual ~BoundedTypeDeserializationCluster() { } | 3026 virtual ~BoundedTypeDeserializationCluster() { } |
2980 | 3027 |
2981 void ReadAlloc(Deserializer* d) { | 3028 void ReadAlloc(Deserializer* d) { |
2982 start_index_ = d->next_index(); | 3029 start_index_ = d->next_index(); |
2983 PageSpace* old_space = d->heap()->old_space(); | 3030 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 15 matching lines...) Expand all Loading... |
2999 RawObject** from = type->from(); | 3046 RawObject** from = type->from(); |
3000 RawObject** to = type->to(); | 3047 RawObject** to = type->to(); |
3001 for (RawObject** p = from; p <= to; p++) { | 3048 for (RawObject** p = from; p <= to; p++) { |
3002 *p = d->ReadRef(); | 3049 *p = d->ReadRef(); |
3003 } | 3050 } |
3004 } | 3051 } |
3005 } | 3052 } |
3006 }; | 3053 }; |
3007 | 3054 |
3008 | 3055 |
| 3056 #if !defined(DART_PRECOMPILED_RUNTIME) |
3009 class ClosureSerializationCluster : public SerializationCluster { | 3057 class ClosureSerializationCluster : public SerializationCluster { |
3010 public: | 3058 public: |
3011 ClosureSerializationCluster() { } | 3059 ClosureSerializationCluster() { } |
3012 virtual ~ClosureSerializationCluster() { } | 3060 virtual ~ClosureSerializationCluster() { } |
3013 | 3061 |
3014 void Trace(Serializer* s, RawObject* object) { | 3062 void Trace(Serializer* s, RawObject* object) { |
3015 RawClosure* closure = Closure::RawCast(object); | 3063 RawClosure* closure = Closure::RawCast(object); |
3016 objects_.Add(closure); | 3064 objects_.Add(closure); |
3017 | 3065 |
3018 RawObject** from = closure->from(); | 3066 RawObject** from = closure->from(); |
(...skipping 22 matching lines...) Expand all Loading... |
3041 RawObject** to = closure->to(); | 3089 RawObject** to = closure->to(); |
3042 for (RawObject** p = from; p <= to; p++) { | 3090 for (RawObject** p = from; p <= to; p++) { |
3043 s->WriteRef(*p); | 3091 s->WriteRef(*p); |
3044 } | 3092 } |
3045 } | 3093 } |
3046 } | 3094 } |
3047 | 3095 |
3048 private: | 3096 private: |
3049 GrowableArray<RawClosure*> objects_; | 3097 GrowableArray<RawClosure*> objects_; |
3050 }; | 3098 }; |
| 3099 #endif // !DART_PRECOMPILED_RUNTIME |
3051 | 3100 |
3052 | 3101 |
3053 class ClosureDeserializationCluster : public DeserializationCluster { | 3102 class ClosureDeserializationCluster : public DeserializationCluster { |
3054 public: | 3103 public: |
3055 ClosureDeserializationCluster() { } | 3104 ClosureDeserializationCluster() { } |
3056 virtual ~ClosureDeserializationCluster() { } | 3105 virtual ~ClosureDeserializationCluster() { } |
3057 | 3106 |
3058 void ReadAlloc(Deserializer* d) { | 3107 void ReadAlloc(Deserializer* d) { |
3059 start_index_ = d->next_index(); | 3108 start_index_ = d->next_index(); |
3060 PageSpace* old_space = d->heap()->old_space(); | 3109 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 16 matching lines...) Expand all Loading... |
3077 RawObject** from = closure->from(); | 3126 RawObject** from = closure->from(); |
3078 RawObject** to = closure->to(); | 3127 RawObject** to = closure->to(); |
3079 for (RawObject** p = from; p <= to; p++) { | 3128 for (RawObject** p = from; p <= to; p++) { |
3080 *p = d->ReadRef(); | 3129 *p = d->ReadRef(); |
3081 } | 3130 } |
3082 } | 3131 } |
3083 } | 3132 } |
3084 }; | 3133 }; |
3085 | 3134 |
3086 | 3135 |
| 3136 #if !defined(DART_PRECOMPILED_RUNTIME) |
3087 class MintSerializationCluster : public SerializationCluster { | 3137 class MintSerializationCluster : public SerializationCluster { |
3088 public: | 3138 public: |
3089 MintSerializationCluster() { } | 3139 MintSerializationCluster() { } |
3090 virtual ~MintSerializationCluster() { } | 3140 virtual ~MintSerializationCluster() { } |
3091 | 3141 |
3092 void Trace(Serializer* s, RawObject* object) { | 3142 void Trace(Serializer* s, RawObject* object) { |
3093 if (!object->IsHeapObject()) { | 3143 if (!object->IsHeapObject()) { |
3094 RawSmi* smi = Smi::RawCast(object); | 3144 RawSmi* smi = Smi::RawCast(object); |
3095 smis_.Add(smi); | 3145 smis_.Add(smi); |
3096 } else { | 3146 } else { |
(...skipping 19 matching lines...) Expand all Loading... |
3116 s->AssignRef(mint); | 3166 s->AssignRef(mint); |
3117 } | 3167 } |
3118 } | 3168 } |
3119 | 3169 |
3120 void WriteFill(Serializer* s) { } | 3170 void WriteFill(Serializer* s) { } |
3121 | 3171 |
3122 private: | 3172 private: |
3123 GrowableArray<RawSmi*> smis_; | 3173 GrowableArray<RawSmi*> smis_; |
3124 GrowableArray<RawMint*> mints_; | 3174 GrowableArray<RawMint*> mints_; |
3125 }; | 3175 }; |
| 3176 #endif // !DART_PRECOMPILED_RUNTIME |
3126 | 3177 |
3127 | 3178 |
3128 class MintDeserializationCluster : public DeserializationCluster { | 3179 class MintDeserializationCluster : public DeserializationCluster { |
3129 public: | 3180 public: |
3130 MintDeserializationCluster() { } | 3181 MintDeserializationCluster() { } |
3131 virtual ~MintDeserializationCluster() { } | 3182 virtual ~MintDeserializationCluster() { } |
3132 | 3183 |
3133 void ReadAlloc(Deserializer* d) { | 3184 void ReadAlloc(Deserializer* d) { |
3134 PageSpace* old_space = d->heap()->old_space(); | 3185 PageSpace* old_space = d->heap()->old_space(); |
3135 bool is_vm_object = d->isolate() == Dart::vm_isolate(); | 3186 bool is_vm_object = d->isolate() == Dart::vm_isolate(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3171 } | 3222 } |
3172 const Array& constants_array = | 3223 const Array& constants_array = |
3173 Array::Handle(zone, Array::MakeArray(new_constants)); | 3224 Array::Handle(zone, Array::MakeArray(new_constants)); |
3174 const Class& mint_cls = Class::Handle(zone, | 3225 const Class& mint_cls = Class::Handle(zone, |
3175 Isolate::Current()->object_store()->mint_class()); | 3226 Isolate::Current()->object_store()->mint_class()); |
3176 mint_cls.set_constants(constants_array); | 3227 mint_cls.set_constants(constants_array); |
3177 } | 3228 } |
3178 }; | 3229 }; |
3179 | 3230 |
3180 | 3231 |
| 3232 #if !defined(DART_PRECOMPILED_RUNTIME) |
3181 class BigintSerializationCluster : public SerializationCluster { | 3233 class BigintSerializationCluster : public SerializationCluster { |
3182 public: | 3234 public: |
3183 BigintSerializationCluster() { } | 3235 BigintSerializationCluster() { } |
3184 virtual ~BigintSerializationCluster() { } | 3236 virtual ~BigintSerializationCluster() { } |
3185 | 3237 |
3186 void Trace(Serializer* s, RawObject* object) { | 3238 void Trace(Serializer* s, RawObject* object) { |
3187 RawBigint* bigint = Bigint::RawCast(object); | 3239 RawBigint* bigint = Bigint::RawCast(object); |
3188 objects_.Add(bigint); | 3240 objects_.Add(bigint); |
3189 | 3241 |
3190 RawObject** from = bigint->from(); | 3242 RawObject** from = bigint->from(); |
(...skipping 22 matching lines...) Expand all Loading... |
3213 RawObject** to = bigint->to(); | 3265 RawObject** to = bigint->to(); |
3214 for (RawObject** p = from; p <= to; p++) { | 3266 for (RawObject** p = from; p <= to; p++) { |
3215 s->WriteRef(*p); | 3267 s->WriteRef(*p); |
3216 } | 3268 } |
3217 } | 3269 } |
3218 } | 3270 } |
3219 | 3271 |
3220 private: | 3272 private: |
3221 GrowableArray<RawBigint*> objects_; | 3273 GrowableArray<RawBigint*> objects_; |
3222 }; | 3274 }; |
| 3275 #endif // !DART_PRECOMPILED_RUNTIME |
3223 | 3276 |
3224 | 3277 |
3225 class BigintDeserializationCluster : public DeserializationCluster { | 3278 class BigintDeserializationCluster : public DeserializationCluster { |
3226 public: | 3279 public: |
3227 BigintDeserializationCluster() { } | 3280 BigintDeserializationCluster() { } |
3228 virtual ~BigintDeserializationCluster() { } | 3281 virtual ~BigintDeserializationCluster() { } |
3229 | 3282 |
3230 void ReadAlloc(Deserializer* d) { | 3283 void ReadAlloc(Deserializer* d) { |
3231 start_index_ = d->next_index(); | 3284 start_index_ = d->next_index(); |
3232 PageSpace* old_space = d->heap()->old_space(); | 3285 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 16 matching lines...) Expand all Loading... |
3249 RawObject** from = bigint->from(); | 3302 RawObject** from = bigint->from(); |
3250 RawObject** to = bigint->to(); | 3303 RawObject** to = bigint->to(); |
3251 for (RawObject** p = from; p <= to; p++) { | 3304 for (RawObject** p = from; p <= to; p++) { |
3252 *p = d->ReadRef(); | 3305 *p = d->ReadRef(); |
3253 } | 3306 } |
3254 } | 3307 } |
3255 } | 3308 } |
3256 }; | 3309 }; |
3257 | 3310 |
3258 | 3311 |
| 3312 #if !defined(DART_PRECOMPILED_RUNTIME) |
3259 class DoubleSerializationCluster : public SerializationCluster { | 3313 class DoubleSerializationCluster : public SerializationCluster { |
3260 public: | 3314 public: |
3261 DoubleSerializationCluster() { } | 3315 DoubleSerializationCluster() { } |
3262 virtual ~DoubleSerializationCluster() { } | 3316 virtual ~DoubleSerializationCluster() { } |
3263 | 3317 |
3264 void Trace(Serializer* s, RawObject* object) { | 3318 void Trace(Serializer* s, RawObject* object) { |
3265 RawDouble* dbl = Double::RawCast(object); | 3319 RawDouble* dbl = Double::RawCast(object); |
3266 objects_.Add(dbl); | 3320 objects_.Add(dbl); |
3267 } | 3321 } |
3268 | 3322 |
(...skipping 12 matching lines...) Expand all Loading... |
3281 for (intptr_t i = 0; i < count; i++) { | 3335 for (intptr_t i = 0; i < count; i++) { |
3282 RawDouble* dbl = objects_[i]; | 3336 RawDouble* dbl = objects_[i]; |
3283 s->Write<bool>(dbl->IsCanonical()); | 3337 s->Write<bool>(dbl->IsCanonical()); |
3284 s->Write<double>(dbl->ptr()->value_); | 3338 s->Write<double>(dbl->ptr()->value_); |
3285 } | 3339 } |
3286 } | 3340 } |
3287 | 3341 |
3288 private: | 3342 private: |
3289 GrowableArray<RawDouble*> objects_; | 3343 GrowableArray<RawDouble*> objects_; |
3290 }; | 3344 }; |
| 3345 #endif // !DART_PRECOMPILED_RUNTIME |
3291 | 3346 |
3292 | 3347 |
3293 class DoubleDeserializationCluster : public DeserializationCluster { | 3348 class DoubleDeserializationCluster : public DeserializationCluster { |
3294 public: | 3349 public: |
3295 DoubleDeserializationCluster() { } | 3350 DoubleDeserializationCluster() { } |
3296 virtual ~DoubleDeserializationCluster() { } | 3351 virtual ~DoubleDeserializationCluster() { } |
3297 | 3352 |
3298 void ReadAlloc(Deserializer* d) { | 3353 void ReadAlloc(Deserializer* d) { |
3299 start_index_ = d->next_index(); | 3354 start_index_ = d->next_index(); |
3300 PageSpace* old_space = d->heap()->old_space(); | 3355 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 12 matching lines...) Expand all Loading... |
3313 bool is_canonical = d->Read<bool>(); | 3368 bool is_canonical = d->Read<bool>(); |
3314 Deserializer::InitializeHeader(dbl, kDoubleCid, | 3369 Deserializer::InitializeHeader(dbl, kDoubleCid, |
3315 Double::InstanceSize(), | 3370 Double::InstanceSize(), |
3316 is_vm_object, is_canonical); | 3371 is_vm_object, is_canonical); |
3317 dbl->ptr()->value_ = d->Read<double>(); | 3372 dbl->ptr()->value_ = d->Read<double>(); |
3318 } | 3373 } |
3319 } | 3374 } |
3320 }; | 3375 }; |
3321 | 3376 |
3322 | 3377 |
| 3378 #if !defined(DART_PRECOMPILED_RUNTIME) |
3323 class GrowableObjectArraySerializationCluster : public SerializationCluster { | 3379 class GrowableObjectArraySerializationCluster : public SerializationCluster { |
3324 public: | 3380 public: |
3325 GrowableObjectArraySerializationCluster() { } | 3381 GrowableObjectArraySerializationCluster() { } |
3326 virtual ~GrowableObjectArraySerializationCluster() { } | 3382 virtual ~GrowableObjectArraySerializationCluster() { } |
3327 | 3383 |
3328 void Trace(Serializer* s, RawObject* object) { | 3384 void Trace(Serializer* s, RawObject* object) { |
3329 RawGrowableObjectArray* array = GrowableObjectArray::RawCast(object); | 3385 RawGrowableObjectArray* array = GrowableObjectArray::RawCast(object); |
3330 objects_.Add(array); | 3386 objects_.Add(array); |
3331 | 3387 |
3332 RawObject** from = array->from(); | 3388 RawObject** from = array->from(); |
(...skipping 22 matching lines...) Expand all Loading... |
3355 RawObject** to = array->to(); | 3411 RawObject** to = array->to(); |
3356 for (RawObject** p = from; p <= to; p++) { | 3412 for (RawObject** p = from; p <= to; p++) { |
3357 s->WriteRef(*p); | 3413 s->WriteRef(*p); |
3358 } | 3414 } |
3359 } | 3415 } |
3360 } | 3416 } |
3361 | 3417 |
3362 private: | 3418 private: |
3363 GrowableArray<RawGrowableObjectArray*> objects_; | 3419 GrowableArray<RawGrowableObjectArray*> objects_; |
3364 }; | 3420 }; |
| 3421 #endif // !DART_PRECOMPILED_RUNTIME |
3365 | 3422 |
3366 | 3423 |
3367 class GrowableObjectArrayDeserializationCluster | 3424 class GrowableObjectArrayDeserializationCluster |
3368 : public DeserializationCluster { | 3425 : public DeserializationCluster { |
3369 public: | 3426 public: |
3370 GrowableObjectArrayDeserializationCluster() { } | 3427 GrowableObjectArrayDeserializationCluster() { } |
3371 virtual ~GrowableObjectArrayDeserializationCluster() { } | 3428 virtual ~GrowableObjectArrayDeserializationCluster() { } |
3372 | 3429 |
3373 void ReadAlloc(Deserializer* d) { | 3430 void ReadAlloc(Deserializer* d) { |
3374 start_index_ = d->next_index(); | 3431 start_index_ = d->next_index(); |
(...skipping 19 matching lines...) Expand all Loading... |
3394 RawObject** from = list->from(); | 3451 RawObject** from = list->from(); |
3395 RawObject** to = list->to(); | 3452 RawObject** to = list->to(); |
3396 for (RawObject** p = from; p <= to; p++) { | 3453 for (RawObject** p = from; p <= to; p++) { |
3397 *p = d->ReadRef(); | 3454 *p = d->ReadRef(); |
3398 } | 3455 } |
3399 } | 3456 } |
3400 } | 3457 } |
3401 }; | 3458 }; |
3402 | 3459 |
3403 | 3460 |
| 3461 #if !defined(DART_PRECOMPILED_RUNTIME) |
3404 class TypedDataSerializationCluster : public SerializationCluster { | 3462 class TypedDataSerializationCluster : public SerializationCluster { |
3405 public: | 3463 public: |
3406 explicit TypedDataSerializationCluster(intptr_t cid) : cid_(cid) { } | 3464 explicit TypedDataSerializationCluster(intptr_t cid) : cid_(cid) { } |
3407 virtual ~TypedDataSerializationCluster() { } | 3465 virtual ~TypedDataSerializationCluster() { } |
3408 | 3466 |
3409 void Trace(Serializer* s, RawObject* object) { | 3467 void Trace(Serializer* s, RawObject* object) { |
3410 RawTypedData* data = TypedData::RawCast(object); | 3468 RawTypedData* data = TypedData::RawCast(object); |
3411 objects_.Add(data); | 3469 objects_.Add(data); |
3412 } | 3470 } |
3413 | 3471 |
(...skipping 19 matching lines...) Expand all Loading... |
3433 s->Write<bool>(data->IsCanonical()); | 3491 s->Write<bool>(data->IsCanonical()); |
3434 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->ptr()->data()); | 3492 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->ptr()->data()); |
3435 s->WriteBytes(cdata, length * element_size); | 3493 s->WriteBytes(cdata, length * element_size); |
3436 } | 3494 } |
3437 } | 3495 } |
3438 | 3496 |
3439 private: | 3497 private: |
3440 const intptr_t cid_; | 3498 const intptr_t cid_; |
3441 GrowableArray<RawTypedData*> objects_; | 3499 GrowableArray<RawTypedData*> objects_; |
3442 }; | 3500 }; |
| 3501 #endif // !DART_PRECOMPILED_RUNTIME |
3443 | 3502 |
3444 | 3503 |
3445 class TypedDataDeserializationCluster : public DeserializationCluster { | 3504 class TypedDataDeserializationCluster : public DeserializationCluster { |
3446 public: | 3505 public: |
3447 explicit TypedDataDeserializationCluster(intptr_t cid) : cid_(cid) { } | 3506 explicit TypedDataDeserializationCluster(intptr_t cid) : cid_(cid) { } |
3448 virtual ~TypedDataDeserializationCluster() { } | 3507 virtual ~TypedDataDeserializationCluster() { } |
3449 | 3508 |
3450 void ReadAlloc(Deserializer* d) { | 3509 void ReadAlloc(Deserializer* d) { |
3451 start_index_ = d->next_index(); | 3510 start_index_ = d->next_index(); |
3452 PageSpace* old_space = d->heap()->old_space(); | 3511 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 23 matching lines...) Expand all Loading... |
3476 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->ptr()->data()); | 3535 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->ptr()->data()); |
3477 d->ReadBytes(cdata, length_in_bytes); | 3536 d->ReadBytes(cdata, length_in_bytes); |
3478 } | 3537 } |
3479 } | 3538 } |
3480 | 3539 |
3481 private: | 3540 private: |
3482 const intptr_t cid_; | 3541 const intptr_t cid_; |
3483 }; | 3542 }; |
3484 | 3543 |
3485 | 3544 |
| 3545 #if !defined(DART_PRECOMPILED_RUNTIME) |
3486 class ExternalTypedDataSerializationCluster : public SerializationCluster { | 3546 class ExternalTypedDataSerializationCluster : public SerializationCluster { |
3487 public: | 3547 public: |
3488 explicit ExternalTypedDataSerializationCluster(intptr_t cid) : cid_(cid) { } | 3548 explicit ExternalTypedDataSerializationCluster(intptr_t cid) : cid_(cid) { } |
3489 virtual ~ExternalTypedDataSerializationCluster() { } | 3549 virtual ~ExternalTypedDataSerializationCluster() { } |
3490 | 3550 |
3491 void Trace(Serializer* s, RawObject* object) { | 3551 void Trace(Serializer* s, RawObject* object) { |
3492 RawExternalTypedData* data = ExternalTypedData::RawCast(object); | 3552 RawExternalTypedData* data = ExternalTypedData::RawCast(object); |
3493 objects_.Add(data); | 3553 objects_.Add(data); |
3494 ASSERT(!data->IsCanonical()); | 3554 ASSERT(!data->IsCanonical()); |
3495 } | 3555 } |
(...skipping 17 matching lines...) Expand all Loading... |
3513 s->Write<int32_t>(length); | 3573 s->Write<int32_t>(length); |
3514 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->ptr()->data_); | 3574 uint8_t* cdata = reinterpret_cast<uint8_t*>(data->ptr()->data_); |
3515 s->WriteBytes(cdata, length * element_size); | 3575 s->WriteBytes(cdata, length * element_size); |
3516 } | 3576 } |
3517 } | 3577 } |
3518 | 3578 |
3519 private: | 3579 private: |
3520 const intptr_t cid_; | 3580 const intptr_t cid_; |
3521 GrowableArray<RawExternalTypedData*> objects_; | 3581 GrowableArray<RawExternalTypedData*> objects_; |
3522 }; | 3582 }; |
| 3583 #endif // !DART_PRECOMPILED_RUNTIME |
3523 | 3584 |
3524 | 3585 |
3525 class ExternalTypedDataDeserializationCluster : public DeserializationCluster { | 3586 class ExternalTypedDataDeserializationCluster : public DeserializationCluster { |
3526 public: | 3587 public: |
3527 explicit ExternalTypedDataDeserializationCluster(intptr_t cid) : cid_(cid) { } | 3588 explicit ExternalTypedDataDeserializationCluster(intptr_t cid) : cid_(cid) { } |
3528 virtual ~ExternalTypedDataDeserializationCluster() { } | 3589 virtual ~ExternalTypedDataDeserializationCluster() { } |
3529 | 3590 |
3530 void ReadAlloc(Deserializer* d) { | 3591 void ReadAlloc(Deserializer* d) { |
3531 start_index_ = d->next_index(); | 3592 start_index_ = d->next_index(); |
3532 PageSpace* old_space = d->heap()->old_space(); | 3593 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 21 matching lines...) Expand all Loading... |
3554 d->Advance(length * element_size); | 3615 d->Advance(length * element_size); |
3555 // No finalizer / external size 0. | 3616 // No finalizer / external size 0. |
3556 } | 3617 } |
3557 } | 3618 } |
3558 | 3619 |
3559 private: | 3620 private: |
3560 const intptr_t cid_; | 3621 const intptr_t cid_; |
3561 }; | 3622 }; |
3562 | 3623 |
3563 | 3624 |
| 3625 #if !defined(DART_PRECOMPILED_RUNTIME) |
3564 class StacktraceSerializationCluster : public SerializationCluster { | 3626 class StacktraceSerializationCluster : public SerializationCluster { |
3565 public: | 3627 public: |
3566 StacktraceSerializationCluster() { } | 3628 StacktraceSerializationCluster() { } |
3567 virtual ~StacktraceSerializationCluster() { } | 3629 virtual ~StacktraceSerializationCluster() { } |
3568 | 3630 |
3569 void Trace(Serializer* s, RawObject* object) { | 3631 void Trace(Serializer* s, RawObject* object) { |
3570 RawStacktrace* trace = Stacktrace::RawCast(object); | 3632 RawStacktrace* trace = Stacktrace::RawCast(object); |
3571 objects_.Add(trace); | 3633 objects_.Add(trace); |
3572 | 3634 |
3573 RawObject** from = trace->from(); | 3635 RawObject** from = trace->from(); |
(...skipping 21 matching lines...) Expand all Loading... |
3595 RawObject** to = trace->to(); | 3657 RawObject** to = trace->to(); |
3596 for (RawObject** p = from; p <= to; p++) { | 3658 for (RawObject** p = from; p <= to; p++) { |
3597 s->WriteRef(*p); | 3659 s->WriteRef(*p); |
3598 } | 3660 } |
3599 } | 3661 } |
3600 } | 3662 } |
3601 | 3663 |
3602 private: | 3664 private: |
3603 GrowableArray<RawStacktrace*> objects_; | 3665 GrowableArray<RawStacktrace*> objects_; |
3604 }; | 3666 }; |
| 3667 #endif // !DART_PRECOMPILED_RUNTIME |
3605 | 3668 |
3606 | 3669 |
3607 class StacktraceDeserializationCluster : public DeserializationCluster { | 3670 class StacktraceDeserializationCluster : public DeserializationCluster { |
3608 public: | 3671 public: |
3609 StacktraceDeserializationCluster() { } | 3672 StacktraceDeserializationCluster() { } |
3610 virtual ~StacktraceDeserializationCluster() { } | 3673 virtual ~StacktraceDeserializationCluster() { } |
3611 | 3674 |
3612 void ReadAlloc(Deserializer* d) { | 3675 void ReadAlloc(Deserializer* d) { |
3613 start_index_ = d->next_index(); | 3676 start_index_ = d->next_index(); |
3614 PageSpace* old_space = d->heap()->old_space(); | 3677 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 15 matching lines...) Expand all Loading... |
3630 RawObject** from = trace->from(); | 3693 RawObject** from = trace->from(); |
3631 RawObject** to = trace->to(); | 3694 RawObject** to = trace->to(); |
3632 for (RawObject** p = from; p <= to; p++) { | 3695 for (RawObject** p = from; p <= to; p++) { |
3633 *p = d->ReadRef(); | 3696 *p = d->ReadRef(); |
3634 } | 3697 } |
3635 } | 3698 } |
3636 } | 3699 } |
3637 }; | 3700 }; |
3638 | 3701 |
3639 | 3702 |
| 3703 #if !defined(DART_PRECOMPILED_RUNTIME) |
3640 class RegExpSerializationCluster : public SerializationCluster { | 3704 class RegExpSerializationCluster : public SerializationCluster { |
3641 public: | 3705 public: |
3642 RegExpSerializationCluster() { } | 3706 RegExpSerializationCluster() { } |
3643 virtual ~RegExpSerializationCluster() { } | 3707 virtual ~RegExpSerializationCluster() { } |
3644 | 3708 |
3645 void Trace(Serializer* s, RawObject* object) { | 3709 void Trace(Serializer* s, RawObject* object) { |
3646 RawRegExp* regexp = RegExp::RawCast(object); | 3710 RawRegExp* regexp = RegExp::RawCast(object); |
3647 objects_.Add(regexp); | 3711 objects_.Add(regexp); |
3648 | 3712 |
3649 RawObject** from = regexp->from(); | 3713 RawObject** from = regexp->from(); |
(...skipping 24 matching lines...) Expand all Loading... |
3674 } | 3738 } |
3675 | 3739 |
3676 s->Write<int32_t>(regexp->ptr()->num_registers_); | 3740 s->Write<int32_t>(regexp->ptr()->num_registers_); |
3677 s->Write<int8_t>(regexp->ptr()->type_flags_); | 3741 s->Write<int8_t>(regexp->ptr()->type_flags_); |
3678 } | 3742 } |
3679 } | 3743 } |
3680 | 3744 |
3681 private: | 3745 private: |
3682 GrowableArray<RawRegExp*> objects_; | 3746 GrowableArray<RawRegExp*> objects_; |
3683 }; | 3747 }; |
| 3748 #endif // !DART_PRECOMPILED_RUNTIME |
3684 | 3749 |
3685 | 3750 |
3686 class RegExpDeserializationCluster : public DeserializationCluster { | 3751 class RegExpDeserializationCluster : public DeserializationCluster { |
3687 public: | 3752 public: |
3688 RegExpDeserializationCluster() { } | 3753 RegExpDeserializationCluster() { } |
3689 virtual ~RegExpDeserializationCluster() { } | 3754 virtual ~RegExpDeserializationCluster() { } |
3690 | 3755 |
3691 void ReadAlloc(Deserializer* d) { | 3756 void ReadAlloc(Deserializer* d) { |
3692 start_index_ = d->next_index(); | 3757 start_index_ = d->next_index(); |
3693 PageSpace* old_space = d->heap()->old_space(); | 3758 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 18 matching lines...) Expand all Loading... |
3712 *p = d->ReadRef(); | 3777 *p = d->ReadRef(); |
3713 } | 3778 } |
3714 | 3779 |
3715 regexp->ptr()->num_registers_ = d->Read<int32_t>(); | 3780 regexp->ptr()->num_registers_ = d->Read<int32_t>(); |
3716 regexp->ptr()->type_flags_ = d->Read<int8_t>(); | 3781 regexp->ptr()->type_flags_ = d->Read<int8_t>(); |
3717 } | 3782 } |
3718 } | 3783 } |
3719 }; | 3784 }; |
3720 | 3785 |
3721 | 3786 |
| 3787 #if !defined(DART_PRECOMPILED_RUNTIME) |
3722 class LinkedHashMapSerializationCluster : public SerializationCluster { | 3788 class LinkedHashMapSerializationCluster : public SerializationCluster { |
3723 public: | 3789 public: |
3724 LinkedHashMapSerializationCluster() { } | 3790 LinkedHashMapSerializationCluster() { } |
3725 virtual ~LinkedHashMapSerializationCluster() { } | 3791 virtual ~LinkedHashMapSerializationCluster() { } |
3726 | 3792 |
3727 void Trace(Serializer* s, RawObject* object) { | 3793 void Trace(Serializer* s, RawObject* object) { |
3728 RawLinkedHashMap* map = LinkedHashMap::RawCast(object); | 3794 RawLinkedHashMap* map = LinkedHashMap::RawCast(object); |
3729 objects_.Add(map); | 3795 objects_.Add(map); |
3730 | 3796 |
3731 s->Push(map->ptr()->type_arguments_); | 3797 s->Push(map->ptr()->type_arguments_); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3777 s->WriteRef(key); | 3843 s->WriteRef(key); |
3778 s->WriteRef(value); | 3844 s->WriteRef(value); |
3779 } | 3845 } |
3780 } | 3846 } |
3781 } | 3847 } |
3782 } | 3848 } |
3783 | 3849 |
3784 private: | 3850 private: |
3785 GrowableArray<RawLinkedHashMap*> objects_; | 3851 GrowableArray<RawLinkedHashMap*> objects_; |
3786 }; | 3852 }; |
| 3853 #endif // !DART_PRECOMPILED_RUNTIME |
3787 | 3854 |
3788 | 3855 |
3789 class LinkedHashMapDeserializationCluster : public DeserializationCluster { | 3856 class LinkedHashMapDeserializationCluster : public DeserializationCluster { |
3790 public: | 3857 public: |
3791 LinkedHashMapDeserializationCluster() { } | 3858 LinkedHashMapDeserializationCluster() { } |
3792 virtual ~LinkedHashMapDeserializationCluster() { } | 3859 virtual ~LinkedHashMapDeserializationCluster() { } |
3793 | 3860 |
3794 void ReadAlloc(Deserializer* d) { | 3861 void ReadAlloc(Deserializer* d) { |
3795 start_index_ = d->next_index(); | 3862 start_index_ = d->next_index(); |
3796 PageSpace* old_space = d->heap()->old_space(); | 3863 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3838 map->ptr()->index_ = TypedData::null(); | 3905 map->ptr()->index_ = TypedData::null(); |
3839 map->ptr()->hash_mask_ = Smi::New(0); | 3906 map->ptr()->hash_mask_ = Smi::New(0); |
3840 map->ptr()->data_ = data; | 3907 map->ptr()->data_ = data; |
3841 map->ptr()->used_data_ = Smi::New(used_data); | 3908 map->ptr()->used_data_ = Smi::New(used_data); |
3842 map->ptr()->deleted_keys_ = Smi::New(0); | 3909 map->ptr()->deleted_keys_ = Smi::New(0); |
3843 } | 3910 } |
3844 } | 3911 } |
3845 }; | 3912 }; |
3846 | 3913 |
3847 | 3914 |
| 3915 #if !defined(DART_PRECOMPILED_RUNTIME) |
3848 class ArraySerializationCluster : public SerializationCluster { | 3916 class ArraySerializationCluster : public SerializationCluster { |
3849 public: | 3917 public: |
3850 explicit ArraySerializationCluster(intptr_t cid) : cid_(cid) { } | 3918 explicit ArraySerializationCluster(intptr_t cid) : cid_(cid) { } |
3851 virtual ~ArraySerializationCluster() { } | 3919 virtual ~ArraySerializationCluster() { } |
3852 | 3920 |
3853 void Trace(Serializer* s, RawObject* object) { | 3921 void Trace(Serializer* s, RawObject* object) { |
3854 RawArray* array = Array::RawCast(object); | 3922 RawArray* array = Array::RawCast(object); |
3855 objects_.Add(array); | 3923 objects_.Add(array); |
3856 | 3924 |
3857 s->Push(array->ptr()->type_arguments_); | 3925 s->Push(array->ptr()->type_arguments_); |
(...skipping 26 matching lines...) Expand all Loading... |
3884 for (intptr_t j = 0; j < length; j++) { | 3952 for (intptr_t j = 0; j < length; j++) { |
3885 s->WriteRef(array->ptr()->data()[j]); | 3953 s->WriteRef(array->ptr()->data()[j]); |
3886 } | 3954 } |
3887 } | 3955 } |
3888 } | 3956 } |
3889 | 3957 |
3890 private: | 3958 private: |
3891 intptr_t cid_; | 3959 intptr_t cid_; |
3892 GrowableArray<RawArray*> objects_; | 3960 GrowableArray<RawArray*> objects_; |
3893 }; | 3961 }; |
| 3962 #endif // !DART_PRECOMPILED_RUNTIME |
3894 | 3963 |
3895 | 3964 |
3896 class ArrayDeserializationCluster : public DeserializationCluster { | 3965 class ArrayDeserializationCluster : public DeserializationCluster { |
3897 public: | 3966 public: |
3898 explicit ArrayDeserializationCluster(intptr_t cid) : cid_(cid) { } | 3967 explicit ArrayDeserializationCluster(intptr_t cid) : cid_(cid) { } |
3899 virtual ~ArrayDeserializationCluster() { } | 3968 virtual ~ArrayDeserializationCluster() { } |
3900 | 3969 |
3901 void ReadAlloc(Deserializer* d) { | 3970 void ReadAlloc(Deserializer* d) { |
3902 start_index_ = d->next_index(); | 3971 start_index_ = d->next_index(); |
3903 PageSpace* old_space = d->heap()->old_space(); | 3972 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 23 matching lines...) Expand all Loading... |
3927 array->ptr()->data()[j] = d->ReadRef(); | 3996 array->ptr()->data()[j] = d->ReadRef(); |
3928 } | 3997 } |
3929 } | 3998 } |
3930 } | 3999 } |
3931 | 4000 |
3932 private: | 4001 private: |
3933 const intptr_t cid_; | 4002 const intptr_t cid_; |
3934 }; | 4003 }; |
3935 | 4004 |
3936 | 4005 |
| 4006 #if !defined(DART_PRECOMPILED_RUNTIME) |
3937 class OneByteStringSerializationCluster : public SerializationCluster { | 4007 class OneByteStringSerializationCluster : public SerializationCluster { |
3938 public: | 4008 public: |
3939 OneByteStringSerializationCluster() { } | 4009 OneByteStringSerializationCluster() { } |
3940 virtual ~OneByteStringSerializationCluster() { } | 4010 virtual ~OneByteStringSerializationCluster() { } |
3941 | 4011 |
3942 void Trace(Serializer* s, RawObject* object) { | 4012 void Trace(Serializer* s, RawObject* object) { |
3943 RawOneByteString* str = reinterpret_cast<RawOneByteString*>(object); | 4013 RawOneByteString* str = reinterpret_cast<RawOneByteString*>(object); |
3944 objects_.Add(str); | 4014 objects_.Add(str); |
3945 } | 4015 } |
3946 | 4016 |
(...skipping 18 matching lines...) Expand all Loading... |
3965 s->Write<bool>(str->IsCanonical()); | 4035 s->Write<bool>(str->IsCanonical()); |
3966 intptr_t hash = Smi::Value(str->ptr()->hash_); | 4036 intptr_t hash = Smi::Value(str->ptr()->hash_); |
3967 s->Write<int32_t>(hash); | 4037 s->Write<int32_t>(hash); |
3968 s->WriteBytes(str->ptr()->data(), length); | 4038 s->WriteBytes(str->ptr()->data(), length); |
3969 } | 4039 } |
3970 } | 4040 } |
3971 | 4041 |
3972 private: | 4042 private: |
3973 GrowableArray<RawOneByteString*> objects_; | 4043 GrowableArray<RawOneByteString*> objects_; |
3974 }; | 4044 }; |
| 4045 #endif // !DART_PRECOMPILED_RUNTIME |
3975 | 4046 |
3976 | 4047 |
3977 class OneByteStringDeserializationCluster : public DeserializationCluster { | 4048 class OneByteStringDeserializationCluster : public DeserializationCluster { |
3978 public: | 4049 public: |
3979 OneByteStringDeserializationCluster() { } | 4050 OneByteStringDeserializationCluster() { } |
3980 virtual ~OneByteStringDeserializationCluster() { } | 4051 virtual ~OneByteStringDeserializationCluster() { } |
3981 | 4052 |
3982 void ReadAlloc(Deserializer* d) { | 4053 void ReadAlloc(Deserializer* d) { |
3983 start_index_ = d->next_index(); | 4054 start_index_ = d->next_index(); |
3984 PageSpace* old_space = d->heap()->old_space(); | 4055 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 19 matching lines...) Expand all Loading... |
4004 str->ptr()->length_ = Smi::New(length); | 4075 str->ptr()->length_ = Smi::New(length); |
4005 str->ptr()->hash_ = Smi::New(d->Read<int32_t>()); | 4076 str->ptr()->hash_ = Smi::New(d->Read<int32_t>()); |
4006 for (intptr_t j = 0; j < length; j++) { | 4077 for (intptr_t j = 0; j < length; j++) { |
4007 str->ptr()->data()[j] = d->Read<uint8_t>(); | 4078 str->ptr()->data()[j] = d->Read<uint8_t>(); |
4008 } | 4079 } |
4009 } | 4080 } |
4010 } | 4081 } |
4011 }; | 4082 }; |
4012 | 4083 |
4013 | 4084 |
| 4085 #if !defined(DART_PRECOMPILED_RUNTIME) |
4014 class TwoByteStringSerializationCluster : public SerializationCluster { | 4086 class TwoByteStringSerializationCluster : public SerializationCluster { |
4015 public: | 4087 public: |
4016 TwoByteStringSerializationCluster() { } | 4088 TwoByteStringSerializationCluster() { } |
4017 virtual ~TwoByteStringSerializationCluster() { } | 4089 virtual ~TwoByteStringSerializationCluster() { } |
4018 | 4090 |
4019 void Trace(Serializer* s, RawObject* object) { | 4091 void Trace(Serializer* s, RawObject* object) { |
4020 RawTwoByteString* str = reinterpret_cast<RawTwoByteString*>(object); | 4092 RawTwoByteString* str = reinterpret_cast<RawTwoByteString*>(object); |
4021 objects_.Add(str); | 4093 objects_.Add(str); |
4022 } | 4094 } |
4023 | 4095 |
(...skipping 18 matching lines...) Expand all Loading... |
4042 s->Write<bool>(str->IsCanonical()); | 4114 s->Write<bool>(str->IsCanonical()); |
4043 intptr_t hash = Smi::Value(str->ptr()->hash_); | 4115 intptr_t hash = Smi::Value(str->ptr()->hash_); |
4044 s->Write<int32_t>(hash); | 4116 s->Write<int32_t>(hash); |
4045 s->WriteBytes(reinterpret_cast<uint8_t*>(str->ptr()->data()), length * 2); | 4117 s->WriteBytes(reinterpret_cast<uint8_t*>(str->ptr()->data()), length * 2); |
4046 } | 4118 } |
4047 } | 4119 } |
4048 | 4120 |
4049 private: | 4121 private: |
4050 GrowableArray<RawTwoByteString*> objects_; | 4122 GrowableArray<RawTwoByteString*> objects_; |
4051 }; | 4123 }; |
| 4124 #endif // !DART_PRECOMPILED_RUNTIME |
4052 | 4125 |
4053 | 4126 |
4054 class TwoByteStringDeserializationCluster : public DeserializationCluster { | 4127 class TwoByteStringDeserializationCluster : public DeserializationCluster { |
4055 public: | 4128 public: |
4056 TwoByteStringDeserializationCluster() { } | 4129 TwoByteStringDeserializationCluster() { } |
4057 virtual ~TwoByteStringDeserializationCluster() { } | 4130 virtual ~TwoByteStringDeserializationCluster() { } |
4058 | 4131 |
4059 void ReadAlloc(Deserializer* d) { | 4132 void ReadAlloc(Deserializer* d) { |
4060 start_index_ = d->next_index(); | 4133 start_index_ = d->next_index(); |
4061 PageSpace* old_space = d->heap()->old_space(); | 4134 PageSpace* old_space = d->heap()->old_space(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4113 } | 4186 } |
4114 } | 4187 } |
4115 | 4188 |
4116 | 4189 |
4117 Serializer::~Serializer() { | 4190 Serializer::~Serializer() { |
4118 delete[] clusters_by_cid_; | 4191 delete[] clusters_by_cid_; |
4119 } | 4192 } |
4120 | 4193 |
4121 | 4194 |
4122 SerializationCluster* Serializer::NewClusterForClass(intptr_t cid) { | 4195 SerializationCluster* Serializer::NewClusterForClass(intptr_t cid) { |
| 4196 #if defined(DART_PRECOMPILED_RUNTIME) |
| 4197 UNREACHABLE(); |
| 4198 return NULL; |
| 4199 #else |
4123 Zone* Z = zone_; | 4200 Zone* Z = zone_; |
4124 if ((cid > kNumPredefinedCids) || | 4201 if ((cid > kNumPredefinedCids) || |
4125 (cid == kInstanceCid) || | 4202 (cid == kInstanceCid) || |
4126 RawObject::IsTypedDataViewClassId(cid)) { | 4203 RawObject::IsTypedDataViewClassId(cid)) { |
4127 Push(isolate()->class_table()->At(cid)); | 4204 Push(isolate()->class_table()->At(cid)); |
4128 return new (Z) InstanceSerializationCluster(cid); | 4205 return new (Z) InstanceSerializationCluster(cid); |
4129 } | 4206 } |
4130 if (RawObject::IsExternalTypedDataClassId(cid)) { | 4207 if (RawObject::IsExternalTypedDataClassId(cid)) { |
4131 return new (Z) ExternalTypedDataSerializationCluster(cid); | 4208 return new (Z) ExternalTypedDataSerializationCluster(cid); |
4132 } | 4209 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4199 return new (Z) RODataSerializationCluster(kTwoByteStringCid); | 4276 return new (Z) RODataSerializationCluster(kTwoByteStringCid); |
4200 } else { | 4277 } else { |
4201 return new (Z) TwoByteStringSerializationCluster(); | 4278 return new (Z) TwoByteStringSerializationCluster(); |
4202 } | 4279 } |
4203 } | 4280 } |
4204 default: break; | 4281 default: break; |
4205 } | 4282 } |
4206 | 4283 |
4207 FATAL1("No cluster defined for cid %" Pd, cid); | 4284 FATAL1("No cluster defined for cid %" Pd, cid); |
4208 return NULL; | 4285 return NULL; |
| 4286 #endif // !DART_PRECOMPILED_RUNTIME |
4209 } | 4287 } |
4210 | 4288 |
4211 | 4289 |
4212 void Serializer::Trace(RawObject* object) { | 4290 void Serializer::Trace(RawObject* object) { |
4213 intptr_t cid; | 4291 intptr_t cid; |
4214 if (!object->IsHeapObject()) { | 4292 if (!object->IsHeapObject()) { |
4215 // Smis are merged into the Mint cluster because Smis for the writer might | 4293 // Smis are merged into the Mint cluster because Smis for the writer might |
4216 // become Mints for the reader and vice versa. | 4294 // become Mints for the reader and vice versa. |
4217 cid = kMintCid; | 4295 cid = kMintCid; |
4218 } else { | 4296 } else { |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5015 | 5093 |
5016 deserializer.ReadVMSnapshot(); | 5094 deserializer.ReadVMSnapshot(); |
5017 | 5095 |
5018 Dart::set_instructions_snapshot_buffer(instructions_buffer_); | 5096 Dart::set_instructions_snapshot_buffer(instructions_buffer_); |
5019 Dart::set_data_snapshot_buffer(data_buffer_); | 5097 Dart::set_data_snapshot_buffer(data_buffer_); |
5020 | 5098 |
5021 return ApiError::null(); | 5099 return ApiError::null(); |
5022 } | 5100 } |
5023 | 5101 |
5024 } // namespace dart | 5102 } // namespace dart |
OLD | NEW |