| 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 // Set the object tags. | 685 // Set the object tags. |
| 686 func.set_tags(tags); | 686 func.set_tags(tags); |
| 687 | 687 |
| 688 // Set all the non object fields. | 688 // Set all the non object fields. |
| 689 func.set_token_pos(reader->Read<int32_t>()); | 689 func.set_token_pos(reader->Read<int32_t>()); |
| 690 func.set_end_token_pos(reader->Read<int32_t>()); | 690 func.set_end_token_pos(reader->Read<int32_t>()); |
| 691 func.set_usage_counter(reader->Read<int32_t>()); | 691 func.set_usage_counter(reader->Read<int32_t>()); |
| 692 func.set_num_fixed_parameters(reader->Read<int16_t>()); | 692 func.set_num_fixed_parameters(reader->Read<int16_t>()); |
| 693 func.set_num_optional_parameters(reader->Read<int16_t>()); | 693 func.set_num_optional_parameters(reader->Read<int16_t>()); |
| 694 func.set_deoptimization_counter(reader->Read<int16_t>()); | 694 func.set_deoptimization_counter(reader->Read<int16_t>()); |
| 695 func.set_regexp_cid(reader->Read<int16_t>()); |
| 695 func.set_kind_tag(reader->Read<uint32_t>()); | 696 func.set_kind_tag(reader->Read<uint32_t>()); |
| 696 func.set_optimized_instruction_count(reader->Read<uint16_t>()); | 697 func.set_optimized_instruction_count(reader->Read<uint16_t>()); |
| 697 func.set_optimized_call_site_count(reader->Read<uint16_t>()); | 698 func.set_optimized_call_site_count(reader->Read<uint16_t>()); |
| 698 | 699 |
| 699 // Set all the object fields. | 700 // Set all the object fields. |
| 700 // TODO(5411462): Need to assert No GC can happen here, even though | 701 // TODO(5411462): Need to assert No GC can happen here, even though |
| 701 // allocations may happen. | 702 // allocations may happen. |
| 702 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); | 703 intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from()); |
| 703 for (intptr_t i = 0; i <= num_flds; i++) { | 704 for (intptr_t i = 0; i <= num_flds; i++) { |
| 704 *(func.raw()->from() + i) = reader->ReadObjectRef(); | 705 *(func.raw()->from() + i) = reader->ReadObjectRef(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 726 writer->WriteVMIsolateObject(kFunctionCid); | 727 writer->WriteVMIsolateObject(kFunctionCid); |
| 727 writer->WriteTags(writer->GetObjectTags(this)); | 728 writer->WriteTags(writer->GetObjectTags(this)); |
| 728 | 729 |
| 729 // Write out all the non object fields. | 730 // Write out all the non object fields. |
| 730 writer->Write<int32_t>(ptr()->token_pos_); | 731 writer->Write<int32_t>(ptr()->token_pos_); |
| 731 writer->Write<int32_t>(ptr()->end_token_pos_); | 732 writer->Write<int32_t>(ptr()->end_token_pos_); |
| 732 writer->Write<int32_t>(ptr()->usage_counter_); | 733 writer->Write<int32_t>(ptr()->usage_counter_); |
| 733 writer->Write<int16_t>(ptr()->num_fixed_parameters_); | 734 writer->Write<int16_t>(ptr()->num_fixed_parameters_); |
| 734 writer->Write<int16_t>(ptr()->num_optional_parameters_); | 735 writer->Write<int16_t>(ptr()->num_optional_parameters_); |
| 735 writer->Write<int16_t>(ptr()->deoptimization_counter_); | 736 writer->Write<int16_t>(ptr()->deoptimization_counter_); |
| 737 writer->Write<int16_t>(ptr()->regexp_cid_); |
| 736 writer->Write<uint32_t>(ptr()->kind_tag_); | 738 writer->Write<uint32_t>(ptr()->kind_tag_); |
| 737 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); | 739 writer->Write<uint16_t>(ptr()->optimized_instruction_count_); |
| 738 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); | 740 writer->Write<uint16_t>(ptr()->optimized_call_site_count_); |
| 739 | 741 |
| 740 // Write out all the object pointer fields. | 742 // Write out all the object pointer fields. |
| 741 SnapshotWriterVisitor visitor(writer); | 743 SnapshotWriterVisitor visitor(writer); |
| 742 visitor.VisitPointers(from(), to_snapshot()); | 744 visitor.VisitPointers(from(), to_snapshot()); |
| 743 } | 745 } |
| 744 | 746 |
| 745 | 747 |
| (...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2837 // We do not allow objects with native fields in an isolate message. | 2839 // We do not allow objects with native fields in an isolate message. |
| 2838 writer->SetWriteException(Exceptions::kArgument, | 2840 writer->SetWriteException(Exceptions::kArgument, |
| 2839 "Illegal argument in isolate message" | 2841 "Illegal argument in isolate message" |
| 2840 " : (object is a UserTag)"); | 2842 " : (object is a UserTag)"); |
| 2841 } else { | 2843 } else { |
| 2842 UNREACHABLE(); | 2844 UNREACHABLE(); |
| 2843 } | 2845 } |
| 2844 } | 2846 } |
| 2845 | 2847 |
| 2846 } // namespace dart | 2848 } // namespace dart |
| OLD | NEW |