| 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/bigint_operations.h" | 5 #include "vm/bigint_operations.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/visitor.h" | 9 #include "vm/visitor.h" |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 reader->AddBackRef(object_id, &cls, kIsDeserialized); | 44 reader->AddBackRef(object_id, &cls, kIsDeserialized); |
| 45 | 45 |
| 46 // Set the object tags. | 46 // Set the object tags. |
| 47 cls.set_tags(tags); | 47 cls.set_tags(tags); |
| 48 | 48 |
| 49 // Set all non object fields. | 49 // Set all non object fields. |
| 50 cls.set_instance_size(reader->ReadIntptrValue()); | 50 cls.set_instance_size(reader->ReadIntptrValue()); |
| 51 cls.set_type_arguments_instance_field_offset(reader->ReadIntptrValue()); | 51 cls.set_type_arguments_instance_field_offset(reader->ReadIntptrValue()); |
| 52 cls.set_next_field_offset(reader->ReadIntptrValue()); | 52 cls.set_next_field_offset(reader->ReadIntptrValue()); |
| 53 cls.set_num_native_fields(reader->ReadIntptrValue()); | 53 cls.set_num_native_fields(reader->ReadIntptrValue()); |
| 54 cls.set_token_index(reader->ReadIntptrValue()); | 54 cls.set_token_pos(reader->ReadIntptrValue()); |
| 55 cls.set_class_state(reader->Read<int8_t>()); | 55 cls.set_class_state(reader->Read<int8_t>()); |
| 56 if (reader->Read<bool>()) { | 56 if (reader->Read<bool>()) { |
| 57 cls.set_is_const(); | 57 cls.set_is_const(); |
| 58 } | 58 } |
| 59 if (reader->Read<bool>()) { | 59 if (reader->Read<bool>()) { |
| 60 cls.set_is_interface(); | 60 cls.set_is_interface(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Set all the object fields. | 63 // Set all the object fields. |
| 64 // TODO(5411462): Need to assert No GC can happen here, even though | 64 // TODO(5411462): Need to assert No GC can happen here, even though |
| (...skipping 23 matching lines...) Expand all Loading... |
| 88 // Write out the class and tags information. | 88 // Write out the class and tags information. |
| 89 writer->WriteObjectHeader(Object::kClassClass, writer->GetObjectTags(this)); | 89 writer->WriteObjectHeader(Object::kClassClass, writer->GetObjectTags(this)); |
| 90 | 90 |
| 91 // Write out all the non object pointer fields. | 91 // Write out all the non object pointer fields. |
| 92 // NOTE: cpp_vtable_ is not written. | 92 // NOTE: cpp_vtable_ is not written. |
| 93 writer->Write<ObjectKind>(ptr()->instance_kind_); | 93 writer->Write<ObjectKind>(ptr()->instance_kind_); |
| 94 writer->WriteIntptrValue(ptr()->instance_size_); | 94 writer->WriteIntptrValue(ptr()->instance_size_); |
| 95 writer->WriteIntptrValue(ptr()->type_arguments_instance_field_offset_); | 95 writer->WriteIntptrValue(ptr()->type_arguments_instance_field_offset_); |
| 96 writer->WriteIntptrValue(ptr()->next_field_offset_); | 96 writer->WriteIntptrValue(ptr()->next_field_offset_); |
| 97 writer->WriteIntptrValue(ptr()->num_native_fields_); | 97 writer->WriteIntptrValue(ptr()->num_native_fields_); |
| 98 writer->WriteIntptrValue(ptr()->token_index_); | 98 writer->WriteIntptrValue(ptr()->token_pos_); |
| 99 writer->Write<int8_t>(ptr()->class_state_); | 99 writer->Write<int8_t>(ptr()->class_state_); |
| 100 writer->Write<bool>(ptr()->is_const_); | 100 writer->Write<bool>(ptr()->is_const_); |
| 101 writer->Write<bool>(ptr()->is_interface_); | 101 writer->Write<bool>(ptr()->is_interface_); |
| 102 | 102 |
| 103 // Write out all the object pointer fields. | 103 // Write out all the object pointer fields. |
| 104 SnapshotWriterVisitor visitor(writer); | 104 SnapshotWriterVisitor visitor(writer); |
| 105 visitor.VisitPointers(from(), to()); | 105 visitor.VisitPointers(from(), to()); |
| 106 } else { | 106 } else { |
| 107 writer->WriteClassId(this); | 107 writer->WriteClassId(this); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 | 111 |
| 112 RawUnresolvedClass* UnresolvedClass::ReadFrom(SnapshotReader* reader, | 112 RawUnresolvedClass* UnresolvedClass::ReadFrom(SnapshotReader* reader, |
| 113 intptr_t object_id, | 113 intptr_t object_id, |
| 114 intptr_t tags, | 114 intptr_t tags, |
| 115 Snapshot::Kind kind) { | 115 Snapshot::Kind kind) { |
| 116 ASSERT(reader != NULL); | 116 ASSERT(reader != NULL); |
| 117 | 117 |
| 118 // Allocate parameterized type object. | 118 // Allocate parameterized type object. |
| 119 UnresolvedClass& unresolved_class = UnresolvedClass::ZoneHandle( | 119 UnresolvedClass& unresolved_class = UnresolvedClass::ZoneHandle( |
| 120 reader->isolate(), NEW_OBJECT(UnresolvedClass)); | 120 reader->isolate(), NEW_OBJECT(UnresolvedClass)); |
| 121 reader->AddBackRef(object_id, &unresolved_class, kIsDeserialized); | 121 reader->AddBackRef(object_id, &unresolved_class, kIsDeserialized); |
| 122 | 122 |
| 123 // Set the object tags. | 123 // Set the object tags. |
| 124 unresolved_class.set_tags(tags); | 124 unresolved_class.set_tags(tags); |
| 125 | 125 |
| 126 // Set all non object fields. | 126 // Set all non object fields. |
| 127 unresolved_class.set_token_index(reader->ReadIntptrValue()); | 127 unresolved_class.set_token_pos(reader->ReadIntptrValue()); |
| 128 | 128 |
| 129 // Set all the object fields. | 129 // Set all the object fields. |
| 130 // TODO(5411462): Need to assert No GC can happen here, even though | 130 // TODO(5411462): Need to assert No GC can happen here, even though |
| 131 // allocations may happen. | 131 // allocations may happen. |
| 132 intptr_t num_flds = (unresolved_class.raw()->to() - | 132 intptr_t num_flds = (unresolved_class.raw()->to() - |
| 133 unresolved_class.raw()->from()); | 133 unresolved_class.raw()->from()); |
| 134 for (intptr_t i = 0; i <= num_flds; i++) { | 134 for (intptr_t i = 0; i <= num_flds; i++) { |
| 135 *(unresolved_class.raw()->from() + i) = reader->ReadObjectRef(); | 135 *(unresolved_class.raw()->from() + i) = reader->ReadObjectRef(); |
| 136 } | 136 } |
| 137 return unresolved_class.raw(); | 137 return unresolved_class.raw(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 | 140 |
| 141 void RawUnresolvedClass::WriteTo(SnapshotWriter* writer, | 141 void RawUnresolvedClass::WriteTo(SnapshotWriter* writer, |
| 142 intptr_t object_id, | 142 intptr_t object_id, |
| 143 Snapshot::Kind kind) { | 143 Snapshot::Kind kind) { |
| 144 ASSERT(writer != NULL); | 144 ASSERT(writer != NULL); |
| 145 | 145 |
| 146 // Write out the serialization header value for this object. | 146 // Write out the serialization header value for this object. |
| 147 writer->WriteSerializationMarker(kInlined, object_id); | 147 writer->WriteSerializationMarker(kInlined, object_id); |
| 148 | 148 |
| 149 // Write out the class and tags information. | 149 // Write out the class and tags information. |
| 150 writer->WriteObjectHeader(Object::kUnresolvedClassClass, | 150 writer->WriteObjectHeader(Object::kUnresolvedClassClass, |
| 151 writer->GetObjectTags(this)); | 151 writer->GetObjectTags(this)); |
| 152 | 152 |
| 153 // Write out all the non object pointer fields. | 153 // Write out all the non object pointer fields. |
| 154 writer->WriteIntptrValue(ptr()->token_index_); | 154 writer->WriteIntptrValue(ptr()->token_pos_); |
| 155 | 155 |
| 156 // Write out all the object pointer fields. | 156 // Write out all the object pointer fields. |
| 157 SnapshotWriterVisitor visitor(writer); | 157 SnapshotWriterVisitor visitor(writer); |
| 158 visitor.VisitPointers(from(), to()); | 158 visitor.VisitPointers(from(), to()); |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 RawAbstractType* AbstractType::ReadFrom(SnapshotReader* reader, | 162 RawAbstractType* AbstractType::ReadFrom(SnapshotReader* reader, |
| 163 intptr_t object_id, | 163 intptr_t object_id, |
| 164 intptr_t tags, | 164 intptr_t tags, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 183 | 183 |
| 184 // Allocate parameterized type object. | 184 // Allocate parameterized type object. |
| 185 Type& parameterized_type = Type::ZoneHandle( | 185 Type& parameterized_type = Type::ZoneHandle( |
| 186 reader->isolate(), NEW_OBJECT(Type)); | 186 reader->isolate(), NEW_OBJECT(Type)); |
| 187 reader->AddBackRef(object_id, ¶meterized_type, kIsDeserialized); | 187 reader->AddBackRef(object_id, ¶meterized_type, kIsDeserialized); |
| 188 | 188 |
| 189 // Set the object tags. | 189 // Set the object tags. |
| 190 parameterized_type.set_tags(tags); | 190 parameterized_type.set_tags(tags); |
| 191 | 191 |
| 192 // Set all non object fields. | 192 // Set all non object fields. |
| 193 parameterized_type.set_token_index(reader->ReadIntptrValue()); | 193 parameterized_type.set_token_pos(reader->ReadIntptrValue()); |
| 194 parameterized_type.set_type_state(reader->Read<int8_t>()); | 194 parameterized_type.set_type_state(reader->Read<int8_t>()); |
| 195 | 195 |
| 196 // Set all the object fields. | 196 // Set all the object fields. |
| 197 // TODO(5411462): Need to assert No GC can happen here, even though | 197 // TODO(5411462): Need to assert No GC can happen here, even though |
| 198 // allocations may happen. | 198 // allocations may happen. |
| 199 intptr_t num_flds = (parameterized_type.raw()->to() - | 199 intptr_t num_flds = (parameterized_type.raw()->to() - |
| 200 parameterized_type.raw()->from()); | 200 parameterized_type.raw()->from()); |
| 201 for (intptr_t i = 0; i <= num_flds; i++) { | 201 for (intptr_t i = 0; i <= num_flds; i++) { |
| 202 *(parameterized_type.raw()->from() + i) = reader->ReadObjectImpl(); | 202 *(parameterized_type.raw()->from() + i) = reader->ReadObjectImpl(); |
| 203 } | 203 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 215 Snapshot::Kind kind) { | 215 Snapshot::Kind kind) { |
| 216 ASSERT(writer != NULL); | 216 ASSERT(writer != NULL); |
| 217 | 217 |
| 218 // Write out the serialization header value for this object. | 218 // Write out the serialization header value for this object. |
| 219 writer->WriteSerializationMarker(kInlined, object_id); | 219 writer->WriteSerializationMarker(kInlined, object_id); |
| 220 | 220 |
| 221 // Write out the class and tags information. | 221 // Write out the class and tags information. |
| 222 writer->WriteObjectHeader(Object::kTypeClass, writer->GetObjectTags(this)); | 222 writer->WriteObjectHeader(Object::kTypeClass, writer->GetObjectTags(this)); |
| 223 | 223 |
| 224 // Write out all the non object pointer fields. | 224 // Write out all the non object pointer fields. |
| 225 writer->WriteIntptrValue(ptr()->token_index_); | 225 writer->WriteIntptrValue(ptr()->token_pos_); |
| 226 writer->Write<int8_t>(ptr()->type_state_); | 226 writer->Write<int8_t>(ptr()->type_state_); |
| 227 | 227 |
| 228 // Write out all the object pointer fields. | 228 // Write out all the object pointer fields. |
| 229 SnapshotWriterVisitor visitor(writer, false); | 229 SnapshotWriterVisitor visitor(writer, false); |
| 230 visitor.VisitPointers(from(), to()); | 230 visitor.VisitPointers(from(), to()); |
| 231 } | 231 } |
| 232 | 232 |
| 233 | 233 |
| 234 RawTypeParameter* TypeParameter::ReadFrom(SnapshotReader* reader, | 234 RawTypeParameter* TypeParameter::ReadFrom(SnapshotReader* reader, |
| 235 intptr_t object_id, | 235 intptr_t object_id, |
| 236 intptr_t tags, | 236 intptr_t tags, |
| 237 Snapshot::Kind kind) { | 237 Snapshot::Kind kind) { |
| 238 ASSERT(reader != NULL); | 238 ASSERT(reader != NULL); |
| 239 | 239 |
| 240 // Allocate type parameter object. | 240 // Allocate type parameter object. |
| 241 TypeParameter& type_parameter = TypeParameter::ZoneHandle( | 241 TypeParameter& type_parameter = TypeParameter::ZoneHandle( |
| 242 reader->isolate(), NEW_OBJECT(TypeParameter)); | 242 reader->isolate(), NEW_OBJECT(TypeParameter)); |
| 243 reader->AddBackRef(object_id, &type_parameter, kIsDeserialized); | 243 reader->AddBackRef(object_id, &type_parameter, kIsDeserialized); |
| 244 | 244 |
| 245 // Set the object tags. | 245 // Set the object tags. |
| 246 type_parameter.set_tags(tags); | 246 type_parameter.set_tags(tags); |
| 247 | 247 |
| 248 // Set all non object fields. | 248 // Set all non object fields. |
| 249 type_parameter.set_index(reader->ReadIntptrValue()); | 249 type_parameter.set_index(reader->ReadIntptrValue()); |
| 250 type_parameter.set_token_index(reader->ReadIntptrValue()); | 250 type_parameter.set_token_pos(reader->ReadIntptrValue()); |
| 251 type_parameter.set_type_state(reader->Read<int8_t>()); | 251 type_parameter.set_type_state(reader->Read<int8_t>()); |
| 252 | 252 |
| 253 // Set all the object fields. | 253 // Set all the object fields. |
| 254 // TODO(5411462): Need to assert No GC can happen here, even though | 254 // TODO(5411462): Need to assert No GC can happen here, even though |
| 255 // allocations may happen. | 255 // allocations may happen. |
| 256 intptr_t num_flds = (type_parameter.raw()->to() - | 256 intptr_t num_flds = (type_parameter.raw()->to() - |
| 257 type_parameter.raw()->from()); | 257 type_parameter.raw()->from()); |
| 258 for (intptr_t i = 0; i <= num_flds; i++) { | 258 for (intptr_t i = 0; i <= num_flds; i++) { |
| 259 *(type_parameter.raw()->from() + i) = reader->ReadObjectImpl(); | 259 *(type_parameter.raw()->from() + i) = reader->ReadObjectImpl(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 return type_parameter.raw(); | 262 return type_parameter.raw(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 | 265 |
| 266 void RawTypeParameter::WriteTo(SnapshotWriter* writer, | 266 void RawTypeParameter::WriteTo(SnapshotWriter* writer, |
| 267 intptr_t object_id, | 267 intptr_t object_id, |
| 268 Snapshot::Kind kind) { | 268 Snapshot::Kind kind) { |
| 269 ASSERT(writer != NULL); | 269 ASSERT(writer != NULL); |
| 270 | 270 |
| 271 // Write out the serialization header value for this object. | 271 // Write out the serialization header value for this object. |
| 272 writer->WriteSerializationMarker(kInlined, object_id); | 272 writer->WriteSerializationMarker(kInlined, object_id); |
| 273 | 273 |
| 274 // Write out the class and tags information. | 274 // Write out the class and tags information. |
| 275 writer->WriteObjectHeader(Object::kTypeParameterClass, | 275 writer->WriteObjectHeader(Object::kTypeParameterClass, |
| 276 writer->GetObjectTags(this)); | 276 writer->GetObjectTags(this)); |
| 277 | 277 |
| 278 // Write out all the non object pointer fields. | 278 // Write out all the non object pointer fields. |
| 279 writer->WriteIntptrValue(ptr()->index_); | 279 writer->WriteIntptrValue(ptr()->index_); |
| 280 writer->WriteIntptrValue(ptr()->token_index_); | 280 writer->WriteIntptrValue(ptr()->token_pos_); |
| 281 writer->Write<int8_t>(ptr()->type_state_); | 281 writer->Write<int8_t>(ptr()->type_state_); |
| 282 | 282 |
| 283 // Write out all the object pointer fields. | 283 // Write out all the object pointer fields. |
| 284 SnapshotWriterVisitor visitor(writer, false); | 284 SnapshotWriterVisitor visitor(writer, false); |
| 285 visitor.VisitPointers(from(), to()); | 285 visitor.VisitPointers(from(), to()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 | 288 |
| 289 RawAbstractTypeArguments* AbstractTypeArguments::ReadFrom( | 289 RawAbstractTypeArguments* AbstractTypeArguments::ReadFrom( |
| 290 SnapshotReader* reader, | 290 SnapshotReader* reader, |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 // Allocate function object. | 416 // Allocate function object. |
| 417 Function& func = Function::ZoneHandle( | 417 Function& func = Function::ZoneHandle( |
| 418 reader->isolate(), NEW_OBJECT(Function)); | 418 reader->isolate(), NEW_OBJECT(Function)); |
| 419 reader->AddBackRef(object_id, &func, kIsDeserialized); | 419 reader->AddBackRef(object_id, &func, kIsDeserialized); |
| 420 | 420 |
| 421 // Set the object tags. | 421 // Set the object tags. |
| 422 func.set_tags(tags); | 422 func.set_tags(tags); |
| 423 | 423 |
| 424 // Set all the non object fields. | 424 // Set all the non object fields. |
| 425 func.set_token_index(reader->ReadIntptrValue()); | 425 func.set_token_pos(reader->ReadIntptrValue()); |
| 426 func.set_end_token_index(reader->ReadIntptrValue()); | 426 func.set_end_token_pos(reader->ReadIntptrValue()); |
| 427 func.set_num_fixed_parameters(reader->ReadIntptrValue()); | 427 func.set_num_fixed_parameters(reader->ReadIntptrValue()); |
| 428 func.set_num_optional_parameters(reader->ReadIntptrValue()); | 428 func.set_num_optional_parameters(reader->ReadIntptrValue()); |
| 429 func.set_usage_counter(reader->ReadIntptrValue()); | 429 func.set_usage_counter(reader->ReadIntptrValue()); |
| 430 func.set_deoptimization_counter(reader->ReadIntptrValue()); | 430 func.set_deoptimization_counter(reader->ReadIntptrValue()); |
| 431 func.set_kind(static_cast<RawFunction::Kind >(reader->ReadIntptrValue())); | 431 func.set_kind(static_cast<RawFunction::Kind >(reader->ReadIntptrValue())); |
| 432 func.set_is_static(reader->Read<bool>()); | 432 func.set_is_static(reader->Read<bool>()); |
| 433 func.set_is_const(reader->Read<bool>()); | 433 func.set_is_const(reader->Read<bool>()); |
| 434 func.set_is_optimizable(reader->Read<bool>()); | 434 func.set_is_optimizable(reader->Read<bool>()); |
| 435 func.set_is_native(reader->Read<bool>()); | 435 func.set_is_native(reader->Read<bool>()); |
| 436 | 436 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 454 !RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))); | 454 !RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))); |
| 455 | 455 |
| 456 // Write out the serialization header value for this object. | 456 // Write out the serialization header value for this object. |
| 457 writer->WriteSerializationMarker(kInlined, object_id); | 457 writer->WriteSerializationMarker(kInlined, object_id); |
| 458 | 458 |
| 459 // Write out the class and tags information. | 459 // Write out the class and tags information. |
| 460 writer->WriteObjectHeader(Object::kFunctionClass, | 460 writer->WriteObjectHeader(Object::kFunctionClass, |
| 461 writer->GetObjectTags(this)); | 461 writer->GetObjectTags(this)); |
| 462 | 462 |
| 463 // Write out all the non object fields. | 463 // Write out all the non object fields. |
| 464 writer->WriteIntptrValue(ptr()->token_index_); | 464 writer->WriteIntptrValue(ptr()->token_pos_); |
| 465 writer->WriteIntptrValue(ptr()->end_token_index_); | 465 writer->WriteIntptrValue(ptr()->end_token_pos_); |
| 466 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); | 466 writer->WriteIntptrValue(ptr()->num_fixed_parameters_); |
| 467 writer->WriteIntptrValue(ptr()->num_optional_parameters_); | 467 writer->WriteIntptrValue(ptr()->num_optional_parameters_); |
| 468 writer->WriteIntptrValue(ptr()->usage_counter_); | 468 writer->WriteIntptrValue(ptr()->usage_counter_); |
| 469 writer->WriteIntptrValue(ptr()->deoptimization_counter_); | 469 writer->WriteIntptrValue(ptr()->deoptimization_counter_); |
| 470 writer->WriteIntptrValue(ptr()->kind_); | 470 writer->WriteIntptrValue(ptr()->kind_); |
| 471 writer->Write<bool>(ptr()->is_static_); | 471 writer->Write<bool>(ptr()->is_static_); |
| 472 writer->Write<bool>(ptr()->is_const_); | 472 writer->Write<bool>(ptr()->is_const_); |
| 473 writer->Write<bool>(ptr()->is_optimizable_); | 473 writer->Write<bool>(ptr()->is_optimizable_); |
| 474 writer->Write<bool>(ptr()->is_native_); | 474 writer->Write<bool>(ptr()->is_native_); |
| 475 | 475 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 487 ASSERT(kind != Snapshot::kMessage && !RawObject::IsCreatedFromSnapshot(tags)); | 487 ASSERT(kind != Snapshot::kMessage && !RawObject::IsCreatedFromSnapshot(tags)); |
| 488 | 488 |
| 489 // Allocate field object. | 489 // Allocate field object. |
| 490 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); | 490 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); |
| 491 reader->AddBackRef(object_id, &field, kIsDeserialized); | 491 reader->AddBackRef(object_id, &field, kIsDeserialized); |
| 492 | 492 |
| 493 // Set the object tags. | 493 // Set the object tags. |
| 494 field.set_tags(tags); | 494 field.set_tags(tags); |
| 495 | 495 |
| 496 // Set all non object fields. | 496 // Set all non object fields. |
| 497 field.set_token_index(reader->ReadIntptrValue()); | 497 field.set_token_pos(reader->ReadIntptrValue()); |
| 498 field.set_is_static(reader->Read<bool>()); | 498 field.set_is_static(reader->Read<bool>()); |
| 499 field.set_is_final(reader->Read<bool>()); | 499 field.set_is_final(reader->Read<bool>()); |
| 500 field.set_has_initializer(reader->Read<bool>()); | 500 field.set_has_initializer(reader->Read<bool>()); |
| 501 | 501 |
| 502 // Set all the object fields. | 502 // Set all the object fields. |
| 503 // TODO(5411462): Need to assert No GC can happen here, even though | 503 // TODO(5411462): Need to assert No GC can happen here, even though |
| 504 // allocations may happen. | 504 // allocations may happen. |
| 505 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); | 505 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); |
| 506 for (intptr_t i = 0; i <= num_flds; i++) { | 506 for (intptr_t i = 0; i <= num_flds; i++) { |
| 507 *(field.raw()->from() + i) = reader->ReadObjectRef(); | 507 *(field.raw()->from() + i) = reader->ReadObjectRef(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 518 ASSERT(kind != Snapshot::kMessage && | 518 ASSERT(kind != Snapshot::kMessage && |
| 519 !RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))); | 519 !RawObject::IsCreatedFromSnapshot(writer->GetObjectTags(this))); |
| 520 | 520 |
| 521 // Write out the serialization header value for this object. | 521 // Write out the serialization header value for this object. |
| 522 writer->WriteSerializationMarker(kInlined, object_id); | 522 writer->WriteSerializationMarker(kInlined, object_id); |
| 523 | 523 |
| 524 // Write out the class and tags information. | 524 // Write out the class and tags information. |
| 525 writer->WriteObjectHeader(Object::kFieldClass, writer->GetObjectTags(this)); | 525 writer->WriteObjectHeader(Object::kFieldClass, writer->GetObjectTags(this)); |
| 526 | 526 |
| 527 // Write out all the non object fields. | 527 // Write out all the non object fields. |
| 528 writer->WriteIntptrValue(ptr()->token_index_); | 528 writer->WriteIntptrValue(ptr()->token_pos_); |
| 529 writer->Write<bool>(ptr()->is_static_); | 529 writer->Write<bool>(ptr()->is_static_); |
| 530 writer->Write<bool>(ptr()->is_final_); | 530 writer->Write<bool>(ptr()->is_final_); |
| 531 writer->Write<bool>(ptr()->has_initializer_); | 531 writer->Write<bool>(ptr()->has_initializer_); |
| 532 | 532 |
| 533 // Write out all the object pointer fields. | 533 // Write out all the object pointer fields. |
| 534 SnapshotWriterVisitor visitor(writer); | 534 SnapshotWriterVisitor visitor(writer); |
| 535 visitor.VisitPointers(from(), to()); | 535 visitor.VisitPointers(from(), to()); |
| 536 } | 536 } |
| 537 | 537 |
| 538 | 538 |
| (...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); | 1969 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); |
| 1970 writer->WriteObjectImpl(ptr()->pattern_); | 1970 writer->WriteObjectImpl(ptr()->pattern_); |
| 1971 writer->WriteIntptrValue(ptr()->type_); | 1971 writer->WriteIntptrValue(ptr()->type_); |
| 1972 writer->WriteIntptrValue(ptr()->flags_); | 1972 writer->WriteIntptrValue(ptr()->flags_); |
| 1973 | 1973 |
| 1974 // Do not write out the data part which is native. | 1974 // Do not write out the data part which is native. |
| 1975 } | 1975 } |
| 1976 | 1976 |
| 1977 | 1977 |
| 1978 } // namespace dart | 1978 } // namespace dart |
| OLD | NEW |