OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/bigint_operations.h" | 5 #include "vm/bigint_operations.h" |
6 #include "vm/object.h" | 6 #include "vm/object.h" |
7 #include "vm/object_store.h" | 7 #include "vm/object_store.h" |
8 #include "vm/snapshot.h" | 8 #include "vm/snapshot.h" |
9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // Set the object tags. | 529 // Set the object tags. |
530 func.set_tags(tags); | 530 func.set_tags(tags); |
531 | 531 |
532 // Set all the non object fields. | 532 // Set all the non object fields. |
533 func.set_token_pos(reader->ReadIntptrValue()); | 533 func.set_token_pos(reader->ReadIntptrValue()); |
534 func.set_end_token_pos(reader->ReadIntptrValue()); | 534 func.set_end_token_pos(reader->ReadIntptrValue()); |
535 func.set_usage_counter(reader->ReadIntptrValue()); | 535 func.set_usage_counter(reader->ReadIntptrValue()); |
536 func.set_num_fixed_parameters(reader->ReadIntptrValue()); | 536 func.set_num_fixed_parameters(reader->ReadIntptrValue()); |
537 func.set_num_optional_parameters(reader->ReadIntptrValue()); | 537 func.set_num_optional_parameters(reader->ReadIntptrValue()); |
538 func.set_deoptimization_counter(reader->ReadIntptrValue()); | 538 func.set_deoptimization_counter(reader->ReadIntptrValue()); |
539 func.set_kind_tag(reader->ReadIntptrValue()); | 539 func.set_kind_tag(reader->Read<uint16_t>()); |
540 | 540 |
541 // Set all the object fields. | 541 // Set all the object fields. |
542 // TODO(5411462): Need to assert No GC can happen here, even though | 542 // TODO(5411462): Need to assert No GC can happen here, even though |
543 // allocations may happen. | 543 // allocations may happen. |
544 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); | 544 intptr_t num_flds = (func.raw()->to() - func.raw()->from()); |
545 for (intptr_t i = 0; i <= num_flds; i++) { | 545 for (intptr_t i = 0; i <= num_flds; i++) { |
546 *(func.raw()->from() + i) = reader->ReadObjectRef(); | 546 *(func.raw()->from() + i) = reader->ReadObjectRef(); |
547 } | 547 } |
548 | 548 |
549 return func.raw(); | 549 return func.raw(); |
(...skipping 14 matching lines...) Expand all Loading... |
564 writer->WriteVMIsolateObject(kFunctionCid); | 564 writer->WriteVMIsolateObject(kFunctionCid); |
565 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 565 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
566 | 566 |
567 // Write out all the non object fields. | 567 // Write out all the non object fields. |
568 writer->WriteIntptrValue(ptr()->token_pos_); | 568 writer->WriteIntptrValue(ptr()->token_pos_); |
569 writer->WriteIntptrValue(ptr()->end_token_pos_); | 569 writer->WriteIntptrValue(ptr()->end_token_pos_); |
570 writer->WriteIntptrValue(ptr()->usage_counter_); | 570 writer->WriteIntptrValue(ptr()->usage_counter_); |
571 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); | 571 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); |
572 writer->WriteIntptrValue(ptr()->num_optional_parameters_); | 572 writer->WriteIntptrValue(ptr()->num_optional_parameters_); |
573 writer->WriteIntptrValue(ptr()->deoptimization_counter_); | 573 writer->WriteIntptrValue(ptr()->deoptimization_counter_); |
574 writer->WriteIntptrValue(ptr()->kind_tag_); | 574 writer->Write<uint16_t>(ptr()->kind_tag_); |
575 | 575 |
576 // Write out all the object pointer fields. | 576 // Write out all the object pointer fields. |
577 SnapshotWriterVisitor visitor(writer); | 577 SnapshotWriterVisitor visitor(writer); |
578 visitor.VisitPointers(from(), to()); | 578 visitor.VisitPointers(from(), to()); |
579 } | 579 } |
580 | 580 |
581 | 581 |
582 RawField* Field::ReadFrom(SnapshotReader* reader, | 582 RawField* Field::ReadFrom(SnapshotReader* reader, |
583 intptr_t object_id, | 583 intptr_t object_id, |
584 intptr_t tags, | 584 intptr_t tags, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 | 619 |
620 // Write out the serialization header value for this object. | 620 // Write out the serialization header value for this object. |
621 writer->WriteInlinedObjectHeader(object_id); | 621 writer->WriteInlinedObjectHeader(object_id); |
622 | 622 |
623 // Write out the class and tags information. | 623 // Write out the class and tags information. |
624 writer->WriteVMIsolateObject(kFieldCid); | 624 writer->WriteVMIsolateObject(kFieldCid); |
625 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 625 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
626 | 626 |
627 // Write out all the non object fields. | 627 // Write out all the non object fields. |
628 writer->WriteIntptrValue(ptr()->token_pos_); | 628 writer->WriteIntptrValue(ptr()->token_pos_); |
629 writer->WriteIntptrValue(ptr()->kind_bits_); | 629 writer->Write<uint8_t>(ptr()->kind_bits_); |
630 | 630 |
631 // Write out all the object pointer fields. | 631 // Write out all the object pointer fields. |
632 SnapshotWriterVisitor visitor(writer); | 632 SnapshotWriterVisitor visitor(writer); |
633 visitor.VisitPointers(from(), to()); | 633 visitor.VisitPointers(from(), to()); |
634 } | 634 } |
635 | 635 |
636 | 636 |
637 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, | 637 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, |
638 intptr_t object_id, | 638 intptr_t object_id, |
639 intptr_t tags, | 639 intptr_t tags, |
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 // Write out the class and tags information. | 2228 // Write out the class and tags information. |
2229 writer->WriteIndexedObject(kWeakPropertyCid); | 2229 writer->WriteIndexedObject(kWeakPropertyCid); |
2230 writer->WriteIntptrValue(writer->GetObjectTags(this)); | 2230 writer->WriteIntptrValue(writer->GetObjectTags(this)); |
2231 | 2231 |
2232 // Write out all the other fields. | 2232 // Write out all the other fields. |
2233 writer->Write<RawObject*>(ptr()->key_); | 2233 writer->Write<RawObject*>(ptr()->key_); |
2234 writer->Write<RawObject*>(ptr()->value_); | 2234 writer->Write<RawObject*>(ptr()->value_); |
2235 } | 2235 } |
2236 | 2236 |
2237 } // namespace dart | 2237 } // namespace dart |
OLD | NEW |