| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/clustered_snapshot.h" | 5 #include "vm/clustered_snapshot.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 | 107 |
| 108 void WriteClass(Serializer* s, RawClass* cls) { | 108 void WriteClass(Serializer* s, RawClass* cls) { |
| 109 Snapshot::Kind kind = s->kind(); | 109 Snapshot::Kind kind = s->kind(); |
| 110 RawObject** from = cls->from(); | 110 RawObject** from = cls->from(); |
| 111 RawObject** to = cls->to_snapshot(kind); | 111 RawObject** to = cls->to_snapshot(kind); |
| 112 for (RawObject** p = from; p <= to; p++) { | 112 for (RawObject** p = from; p <= to; p++) { |
| 113 s->WriteRef(*p); | 113 s->WriteRef(*p); |
| 114 } | 114 } |
| 115 intptr_t class_id = cls->ptr()->id_; | 115 intptr_t class_id = cls->ptr()->id_; |
| 116 ASSERT(class_id != kIllegalCid); |
| 116 s->WriteCid(class_id); | 117 s->WriteCid(class_id); |
| 117 s->Write<int32_t>(cls->ptr()->instance_size_in_words_); | 118 s->Write<int32_t>(cls->ptr()->instance_size_in_words_); |
| 118 s->Write<int32_t>(cls->ptr()->next_field_offset_in_words_); | 119 s->Write<int32_t>(cls->ptr()->next_field_offset_in_words_); |
| 119 s->Write<int32_t>(cls->ptr()->type_arguments_field_offset_in_words_); | 120 s->Write<int32_t>(cls->ptr()->type_arguments_field_offset_in_words_); |
| 120 s->Write<uint16_t>(cls->ptr()->num_type_arguments_); | 121 s->Write<uint16_t>(cls->ptr()->num_type_arguments_); |
| 121 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_); | 122 s->Write<uint16_t>(cls->ptr()->num_own_type_arguments_); |
| 122 s->Write<uint16_t>(cls->ptr()->num_native_fields_); | 123 s->Write<uint16_t>(cls->ptr()->num_native_fields_); |
| 123 s->WriteTokenPosition(cls->ptr()->token_pos_); | 124 s->WriteTokenPosition(cls->ptr()->token_pos_); |
| 124 s->Write<uint16_t>(cls->ptr()->state_bits_); | 125 s->Write<uint16_t>(cls->ptr()->state_bits_); |
| 125 } | 126 } |
| (...skipping 4993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5119 | 5120 |
| 5120 deserializer.ReadVMSnapshot(); | 5121 deserializer.ReadVMSnapshot(); |
| 5121 | 5122 |
| 5122 Dart::set_instructions_snapshot_buffer(instructions_buffer_); | 5123 Dart::set_instructions_snapshot_buffer(instructions_buffer_); |
| 5123 Dart::set_data_snapshot_buffer(data_buffer_); | 5124 Dart::set_data_snapshot_buffer(data_buffer_); |
| 5124 | 5125 |
| 5125 return ApiError::null(); | 5126 return ApiError::null(); |
| 5126 } | 5127 } |
| 5127 | 5128 |
| 5128 } // namespace dart | 5129 } // namespace dart |
| OLD | NEW |