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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 const int32_t end_token_pos = reader->Read<uint32_t>(); | 750 const int32_t end_token_pos = reader->Read<uint32_t>(); |
751 func.set_num_fixed_parameters(reader->Read<int16_t>()); | 751 func.set_num_fixed_parameters(reader->Read<int16_t>()); |
752 func.set_num_optional_parameters(reader->Read<int16_t>()); | 752 func.set_num_optional_parameters(reader->Read<int16_t>()); |
753 func.set_kind_tag(reader->Read<uint32_t>()); | 753 func.set_kind_tag(reader->Read<uint32_t>()); |
754 func.set_token_pos(TokenPosition::SnapshotDecode(token_pos)); | 754 func.set_token_pos(TokenPosition::SnapshotDecode(token_pos)); |
755 func.set_end_token_pos(TokenPosition::SnapshotDecode(end_token_pos)); | 755 func.set_end_token_pos(TokenPosition::SnapshotDecode(end_token_pos)); |
756 func.set_usage_counter(reader->Read<int32_t>()); | 756 func.set_usage_counter(reader->Read<int32_t>()); |
757 func.set_deoptimization_counter(reader->Read<int8_t>()); | 757 func.set_deoptimization_counter(reader->Read<int8_t>()); |
758 func.set_optimized_instruction_count(reader->Read<uint16_t>()); | 758 func.set_optimized_instruction_count(reader->Read<uint16_t>()); |
759 func.set_optimized_call_site_count(reader->Read<uint16_t>()); | 759 func.set_optimized_call_site_count(reader->Read<uint16_t>()); |
760 func.set_kernel_function(NULL); | 760 func.set_kernel_offset(0); |
761 func.set_was_compiled(false); | 761 func.set_was_compiled(false); |
762 | 762 |
763 // Set all the object fields. | 763 // Set all the object fields. |
764 READ_OBJECT_FIELDS(func, func.raw()->from(), func.raw()->to_snapshot(), | 764 READ_OBJECT_FIELDS(func, func.raw()->from(), func.raw()->to_snapshot(), |
765 kAsReference); | 765 kAsReference); |
766 // Initialize all fields that are not part of the snapshot. | 766 // Initialize all fields that are not part of the snapshot. |
767 bool is_optimized = func.usage_counter() != 0; | 767 bool is_optimized = func.usage_counter() != 0; |
768 if (is_optimized) { | 768 if (is_optimized) { |
769 // Read the ic data array as the function is an optimized one. | 769 // Read the ic data array as the function is an optimized one. |
770 (*reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsReference); | 770 (*reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsReference); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 | 856 |
857 // Allocate field object. | 857 // Allocate field object. |
858 Field& field = Field::ZoneHandle(reader->zone(), Field::New()); | 858 Field& field = Field::ZoneHandle(reader->zone(), Field::New()); |
859 reader->AddBackRef(object_id, &field, kIsDeserialized); | 859 reader->AddBackRef(object_id, &field, kIsDeserialized); |
860 | 860 |
861 // Set all non object fields. | 861 // Set all non object fields. |
862 field.set_token_pos(TokenPosition::SnapshotDecode(reader->Read<int32_t>())); | 862 field.set_token_pos(TokenPosition::SnapshotDecode(reader->Read<int32_t>())); |
863 field.set_guarded_cid(reader->Read<int32_t>()); | 863 field.set_guarded_cid(reader->Read<int32_t>()); |
864 field.set_is_nullable(reader->Read<int32_t>()); | 864 field.set_is_nullable(reader->Read<int32_t>()); |
865 field.set_kind_bits(reader->Read<uint8_t>()); | 865 field.set_kind_bits(reader->Read<uint8_t>()); |
866 field.set_kernel_field(NULL); | 866 field.set_kernel_offset(0); |
867 | 867 |
868 // Set all the object fields. | 868 // Set all the object fields. |
869 READ_OBJECT_FIELDS(field, field.raw()->from(), field.raw()->to_snapshot(kind), | 869 READ_OBJECT_FIELDS(field, field.raw()->from(), field.raw()->to_snapshot(kind), |
870 kAsReference); | 870 kAsReference); |
871 field.StorePointer(&field.raw_ptr()->dependent_code_, Array::null()); | 871 field.StorePointer(&field.raw_ptr()->dependent_code_, Array::null()); |
872 | 872 |
873 if (!reader->isolate()->use_field_guards()) { | 873 if (!reader->isolate()->use_field_guards()) { |
874 field.set_guarded_cid(kDynamicCid); | 874 field.set_guarded_cid(kDynamicCid); |
875 field.set_is_nullable(true); | 875 field.set_is_nullable(true); |
876 field.set_guarded_list_length(Field::kNoFixedLength); | 876 field.set_guarded_list_length(Field::kNoFixedLength); |
(...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3063 // We do not allow objects with native fields in an isolate message. | 3063 // We do not allow objects with native fields in an isolate message. |
3064 writer->SetWriteException(Exceptions::kArgument, | 3064 writer->SetWriteException(Exceptions::kArgument, |
3065 "Illegal argument in isolate message" | 3065 "Illegal argument in isolate message" |
3066 " : (object is a UserTag)"); | 3066 " : (object is a UserTag)"); |
3067 } else { | 3067 } else { |
3068 UNREACHABLE(); | 3068 UNREACHABLE(); |
3069 } | 3069 } |
3070 } | 3070 } |
3071 | 3071 |
3072 } // namespace dart | 3072 } // namespace dart |
OLD | NEW |