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/stub_code.h" | 9 #include "vm/stub_code.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.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_kind_tag(reader->Read<uint16_t>()); | 701 func.set_kind_tag(reader->Read<uint32_t>()); |
702 func.set_optimized_instruction_count(reader->Read<uint16_t>()); | 702 func.set_optimized_instruction_count(reader->Read<uint16_t>()); |
703 func.set_optimized_call_site_count(reader->Read<uint16_t>()); | 703 func.set_optimized_call_site_count(reader->Read<uint16_t>()); |
704 | 704 |
705 // Set all the object fields. | 705 // Set all the object fields. |
706 // TODO(5411462): Need to assert No GC can happen here, even though | 706 // TODO(5411462): Need to assert No GC can happen here, even though |
707 // allocations may happen. | 707 // allocations may happen. |
708 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); | 708 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); |
709 for (intptr_t i = 0; i <= num_flds; i++) { | 709 for (intptr_t i = 0; i <= num_flds; i++) { |
710 *(func.raw()->from() + i) = reader->ReadObjectRef(); | 710 *(func.raw()->from() + i) = reader->ReadObjectRef(); |
711 } | 711 } |
(...skipping 20 matching lines...) Expand all Loading... |
732 writer->WriteVMIsolateObject(kFunctionCid); | 732 writer->WriteVMIsolateObject(kFunctionCid); |
733 writer->WriteTags(writer->GetObjectTags(this)); | 733 writer->WriteTags(writer->GetObjectTags(this)); |
734 | 734 |
735 // Write out all the non object fields. | 735 // Write out all the non object fields. |
736 writer->Write<int32_t>(ptr()->token_pos_); | 736 writer->Write<int32_t>(ptr()->token_pos_); |
737 writer->Write<int32_t>(ptr()->end_token_pos_); | 737 writer->Write<int32_t>(ptr()->end_token_pos_); |
738 writer->Write<int32_t>(ptr()->usage_counter_); | 738 writer->Write<int32_t>(ptr()->usage_counter_); |
739 writer->Write<int16_t>(ptr()->num_fixed_parameters_); | 739 writer->Write<int16_t>(ptr()->num_fixed_parameters_); |
740 writer->Write<int16_t>(ptr()->num_optional_parameters_); | 740 writer->Write<int16_t>(ptr()->num_optional_parameters_); |
741 writer->Write<int16_t>(ptr()->deoptimization_counter_); | 741 writer->Write<int16_t>(ptr()->deoptimization_counter_); |
742 writer->Write<uint16_t>(ptr()->kind_tag_); | 742 writer->Write<uint32_t>(ptr()->kind_tag_); |
743 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); | 743 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); |
744 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); | 744 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); |
745 | 745 |
746 // Write out all the object pointer fields. | 746 // Write out all the object pointer fields. |
747 SnapshotWriterVisitor visitor(writer); | 747 SnapshotWriterVisitor visitor(writer); |
748 visitor.VisitPointers(from(), to_snapshot()); | 748 visitor.VisitPointers(from(), to_snapshot()); |
749 } | 749 } |
750 | 750 |
751 | 751 |
752 RawField* Field::ReadFrom(SnapshotReader* reader, | 752 RawField* Field::ReadFrom(SnapshotReader* reader, |
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2870 // We do not allow objects with native fields in an isolate message. | 2870 // We do not allow objects with native fields in an isolate message. |
2871 writer->SetWriteException(Exceptions::kArgument, | 2871 writer->SetWriteException(Exceptions::kArgument, |
2872 "Illegal argument in isolate message" | 2872 "Illegal argument in isolate message" |
2873 " : (object is a UserTag)"); | 2873 " : (object is a UserTag)"); |
2874 } else { | 2874 } else { |
2875 UNREACHABLE(); | 2875 UNREACHABLE(); |
2876 } | 2876 } |
2877 } | 2877 } |
2878 | 2878 |
2879 } // namespace dart | 2879 } // namespace dart |
OLD | NEW |