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/native_entry.h" | 5 #include "vm/native_entry.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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 func.set_num_fixed_parameters(reader->Read<int16_t>()); | 726 func.set_num_fixed_parameters(reader->Read<int16_t>()); |
727 func.set_num_optional_parameters(reader->Read<int16_t>()); | 727 func.set_num_optional_parameters(reader->Read<int16_t>()); |
728 func.set_kind_tag(reader->Read<uint32_t>()); | 728 func.set_kind_tag(reader->Read<uint32_t>()); |
729 func.set_token_pos(TokenPosition::SnapshotDecode(token_pos)); | 729 func.set_token_pos(TokenPosition::SnapshotDecode(token_pos)); |
730 func.set_end_token_pos(TokenPosition::SnapshotDecode(end_token_pos)); | 730 func.set_end_token_pos(TokenPosition::SnapshotDecode(end_token_pos)); |
731 func.set_kernel_offset(kernel_offset); | 731 func.set_kernel_offset(kernel_offset); |
732 func.set_usage_counter(reader->Read<int32_t>()); | 732 func.set_usage_counter(reader->Read<int32_t>()); |
733 func.set_deoptimization_counter(reader->Read<int8_t>()); | 733 func.set_deoptimization_counter(reader->Read<int8_t>()); |
734 func.set_optimized_instruction_count(reader->Read<uint16_t>()); | 734 func.set_optimized_instruction_count(reader->Read<uint16_t>()); |
735 func.set_optimized_call_site_count(reader->Read<uint16_t>()); | 735 func.set_optimized_call_site_count(reader->Read<uint16_t>()); |
736 func.set_was_compiled(false); | 736 func.set_kernel_offset(0); |
| 737 func.SetWasCompiled(false); |
737 | 738 |
738 // Set all the object fields. | 739 // Set all the object fields. |
739 READ_OBJECT_FIELDS(func, func.raw()->from(), func.raw()->to_snapshot(kind), | 740 READ_OBJECT_FIELDS(func, func.raw()->from(), func.raw()->to_snapshot(kind), |
740 kAsReference); | 741 kAsReference); |
741 // Initialize all fields that are not part of the snapshot. | 742 // Initialize all fields that are not part of the snapshot. |
742 bool is_optimized = func.usage_counter() != 0; | 743 bool is_optimized = func.usage_counter() != 0; |
743 if (is_optimized) { | 744 if (is_optimized) { |
744 // Read the ic data array as the function is an optimized one. | 745 // Read the ic data array as the function is an optimized one. |
745 (*reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsReference); | 746 (*reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsReference); |
746 func.set_ic_data_array(*reader->ArrayHandle()); | 747 func.set_ic_data_array(*reader->ArrayHandle()); |
(...skipping 2187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2934 // We do not allow objects with native fields in an isolate message. | 2935 // We do not allow objects with native fields in an isolate message. |
2935 writer->SetWriteException(Exceptions::kArgument, | 2936 writer->SetWriteException(Exceptions::kArgument, |
2936 "Illegal argument in isolate message" | 2937 "Illegal argument in isolate message" |
2937 " : (object is a UserTag)"); | 2938 " : (object is a UserTag)"); |
2938 } else { | 2939 } else { |
2939 UNREACHABLE(); | 2940 UNREACHABLE(); |
2940 } | 2941 } |
2941 } | 2942 } |
2942 | 2943 |
2943 } // namespace dart | 2944 } // namespace dart |
OLD | NEW |