| 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>()); | |
| 702 func.set_kind_tag(reader->Read<uint32_t>()); | 701 func.set_kind_tag(reader->Read<uint32_t>()); |
| 703 func.set_optimized_instruction_count(reader->Read<uint16_t>()); | 702 func.set_optimized_instruction_count(reader->Read<uint16_t>()); |
| 704 func.set_optimized_call_site_count(reader->Read<uint16_t>()); | 703 func.set_optimized_call_site_count(reader->Read<uint16_t>()); |
| 705 | 704 |
| 706 // Set all the object fields. | 705 // Set all the object fields. |
| 707 // 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 |
| 708 // allocations may happen. | 707 // allocations may happen. |
| 709 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); | 708 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); |
| 710 for (intptr_t i = 0; i <= num_flds; i++) { | 709 for (intptr_t i = 0; i <= num_flds; i++) { |
| 711 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef(); | 710 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 735 writer->WriteVMIsolateObject(kFunctionCid); | 734 writer->WriteVMIsolateObject(kFunctionCid); |
| 736 writer->WriteTags(writer->GetObjectTags(this)); | 735 writer->WriteTags(writer->GetObjectTags(this)); |
| 737 | 736 |
| 738 // Write out all the non object fields. | 737 // Write out all the non object fields. |
| 739 writer->Write<int32_t>(ptr()->token_pos_); | 738 writer->Write<int32_t>(ptr()->token_pos_); |
| 740 writer->Write<int32_t>(ptr()->end_token_pos_); | 739 writer->Write<int32_t>(ptr()->end_token_pos_); |
| 741 writer->Write<int32_t>(ptr()->usage_counter_); | 740 writer->Write<int32_t>(ptr()->usage_counter_); |
| 742 writer->Write<int16_t>(ptr()->num_fixed_parameters_); | 741 writer->Write<int16_t>(ptr()->num_fixed_parameters_); |
| 743 writer->Write<int16_t>(ptr()->num_optional_parameters_); | 742 writer->Write<int16_t>(ptr()->num_optional_parameters_); |
| 744 writer->Write<int16_t>(ptr()->deoptimization_counter_); | 743 writer->Write<int16_t>(ptr()->deoptimization_counter_); |
| 745 writer->Write<int16_t>(ptr()->regexp_cid_); | |
| 746 writer->Write<uint32_t>(ptr()->kind_tag_); | 744 writer->Write<uint32_t>(ptr()->kind_tag_); |
| 747 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); | 745 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); |
| 748 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); | 746 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); |
| 749 | 747 |
| 750 // Write out all the object pointer fields. | 748 // Write out all the object pointer fields. |
| 751 SnapshotWriterVisitor visitor(writer); | 749 SnapshotWriterVisitor visitor(writer); |
| 752 visitor.VisitPointers(from(), to_snapshot()); | 750 visitor.VisitPointers(from(), to_snapshot()); |
| 753 } | 751 } |
| 754 | 752 |
| 755 | 753 |
| (...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2889 // We do not allow objects with native fields in an isolate message. | 2887 // We do not allow objects with native fields in an isolate message. |
| 2890 writer->SetWriteException(Exceptions::kArgument, | 2888 writer->SetWriteException(Exceptions::kArgument, |
| 2891 "Illegal argument in isolate message" | 2889 "Illegal argument in isolate message" |
| 2892 " : (object is a UserTag)"); | 2890 " : (object is a UserTag)"); |
| 2893 } else { | 2891 } else { |
| 2894 UNREACHABLE(); | 2892 UNREACHABLE(); |
| 2895 } | 2893 } |
| 2896 } | 2894 } |
| 2897 | 2895 |
| 2898 } // namespace dart | 2896 } // namespace dart |
| OLD | NEW |