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/object.h" | 5 #include "vm/object.h" |
6 #include "vm/object_store.h" | 6 #include "vm/object_store.h" |
7 #include "vm/snapshot.h" | 7 #include "vm/snapshot.h" |
8 #include "vm/stub_code.h" | 8 #include "vm/stub_code.h" |
9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 // Set the object tags. | 691 // Set the object tags. |
692 func.set_tags(tags); | 692 func.set_tags(tags); |
693 | 693 |
694 // Set all the non object fields. | 694 // Set all the non object fields. |
695 func.set_token_pos(reader->Read<int32_t>()); | 695 func.set_token_pos(reader->Read<int32_t>()); |
696 func.set_end_token_pos(reader->Read<int32_t>()); | 696 func.set_end_token_pos(reader->Read<int32_t>()); |
697 func.set_usage_counter(reader->Read<int32_t>()); | 697 func.set_usage_counter(reader->Read<int32_t>()); |
698 func.set_num_fixed_parameters(reader->Read<int16_t>()); | 698 func.set_num_fixed_parameters(reader->Read<int16_t>()); |
699 func.set_num_optional_parameters(reader->Read<int16_t>()); | 699 func.set_num_optional_parameters(reader->Read<int16_t>()); |
700 func.set_deoptimization_counter(reader->Read<int16_t>()); | 700 func.set_deoptimization_counter(reader->Read<int16_t>()); |
| 701 func.set_regexp_cid(reader->Read<int16_t>()); |
701 func.set_kind_tag(reader->Read<uint32_t>()); | 702 func.set_kind_tag(reader->Read<uint32_t>()); |
702 func.set_optimized_instruction_count(reader->Read<uint16_t>()); | 703 func.set_optimized_instruction_count(reader->Read<uint16_t>()); |
703 func.set_optimized_call_site_count(reader->Read<uint16_t>()); | 704 func.set_optimized_call_site_count(reader->Read<uint16_t>()); |
704 | 705 |
705 // Set all the object fields. | 706 // Set all the object fields. |
706 // TODO(5411462): Need to assert No GC can happen here, even though | 707 // TODO(5411462): Need to assert No GC can happen here, even though |
707 // allocations may happen. | 708 // allocations may happen. |
708 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); | 709 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); |
709 for (intptr_t i = 0; i <= num_flds; i++) { | 710 for (intptr_t i = 0; i <= num_flds; i++) { |
710 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef(); | 711 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef(); |
(...skipping 23 matching lines...) Expand all Loading... |
734 writer->WriteVMIsolateObject(kFunctionCid); | 735 writer->WriteVMIsolateObject(kFunctionCid); |
735 writer->WriteTags(writer->GetObjectTags(this)); | 736 writer->WriteTags(writer->GetObjectTags(this)); |
736 | 737 |
737 // Write out all the non object fields. | 738 // Write out all the non object fields. |
738 writer->Write<int32_t>(ptr()->token_pos_); | 739 writer->Write<int32_t>(ptr()->token_pos_); |
739 writer->Write<int32_t>(ptr()->end_token_pos_); | 740 writer->Write<int32_t>(ptr()->end_token_pos_); |
740 writer->Write<int32_t>(ptr()->usage_counter_); | 741 writer->Write<int32_t>(ptr()->usage_counter_); |
741 writer->Write<int16_t>(ptr()->num_fixed_parameters_); | 742 writer->Write<int16_t>(ptr()->num_fixed_parameters_); |
742 writer->Write<int16_t>(ptr()->num_optional_parameters_); | 743 writer->Write<int16_t>(ptr()->num_optional_parameters_); |
743 writer->Write<int16_t>(ptr()->deoptimization_counter_); | 744 writer->Write<int16_t>(ptr()->deoptimization_counter_); |
| 745 writer->Write<int16_t>(ptr()->regexp_cid_); |
744 writer->Write<uint32_t>(ptr()->kind_tag_); | 746 writer->Write<uint32_t>(ptr()->kind_tag_); |
745 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); | 747 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); |
746 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); | 748 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); |
747 | 749 |
748 // Write out all the object pointer fields. | 750 // Write out all the object pointer fields. |
749 SnapshotWriterVisitor visitor(writer); | 751 SnapshotWriterVisitor visitor(writer); |
750 visitor.VisitPointers(from(), to_snapshot()); | 752 visitor.VisitPointers(from(), to_snapshot()); |
751 } | 753 } |
752 | 754 |
753 | 755 |
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2887 // We do not allow objects with native fields in an isolate message. | 2889 // We do not allow objects with native fields in an isolate message. |
2888 writer->SetWriteException(Exceptions::kArgument, | 2890 writer->SetWriteException(Exceptions::kArgument, |
2889 "Illegal argument in isolate message" | 2891 "Illegal argument in isolate message" |
2890 " : (object is a UserTag)"); | 2892 " : (object is a UserTag)"); |
2891 } else { | 2893 } else { |
2892 UNREACHABLE(); | 2894 UNREACHABLE(); |
2893 } | 2895 } |
2894 } | 2896 } |
2895 | 2897 |
2896 } // namespace dart | 2898 } // namespace dart |
OLD | NEW |