| 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/symbols.h" | 9 #include "vm/symbols.h" |
| 10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); | 491 Field& field = Field::ZoneHandle(reader->isolate(), NEW_OBJECT(Field)); |
| 492 reader->AddBackRef(object_id, &field, kIsDeserialized); | 492 reader->AddBackRef(object_id, &field, kIsDeserialized); |
| 493 | 493 |
| 494 // Set the object tags. | 494 // Set the object tags. |
| 495 field.set_tags(tags); | 495 field.set_tags(tags); |
| 496 | 496 |
| 497 // Set all non object fields. | 497 // Set all non object fields. |
| 498 field.set_token_pos(reader->ReadIntptrValue()); | 498 field.set_token_pos(reader->ReadIntptrValue()); |
| 499 field.set_is_static(reader->Read<bool>()); | 499 field.set_is_static(reader->Read<bool>()); |
| 500 field.set_is_final(reader->Read<bool>()); | 500 field.set_is_final(reader->Read<bool>()); |
| 501 field.set_is_const(reader->Read<bool>()); |
| 501 field.set_has_initializer(reader->Read<bool>()); | 502 field.set_has_initializer(reader->Read<bool>()); |
| 502 | 503 |
| 503 // Set all the object fields. | 504 // Set all the object fields. |
| 504 // TODO(5411462): Need to assert No GC can happen here, even though | 505 // TODO(5411462): Need to assert No GC can happen here, even though |
| 505 // allocations may happen. | 506 // allocations may happen. |
| 506 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); | 507 intptr_t num_flds = (field.raw()->to() - field.raw()->from()); |
| 507 for (intptr_t i = 0; i <= num_flds; i++) { | 508 for (intptr_t i = 0; i <= num_flds; i++) { |
| 508 *(field.raw()->from() + i) = reader->ReadObjectRef(); | 509 *(field.raw()->from() + i) = reader->ReadObjectRef(); |
| 509 } | 510 } |
| 510 | 511 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 522 // Write out the serialization header value for this object. | 523 // Write out the serialization header value for this object. |
| 523 writer->WriteSerializationMarker(kInlined, object_id); | 524 writer->WriteSerializationMarker(kInlined, object_id); |
| 524 | 525 |
| 525 // Write out the class and tags information. | 526 // Write out the class and tags information. |
| 526 writer->WriteObjectHeader(Object::kFieldClass, writer->GetObjectTags(this)); | 527 writer->WriteObjectHeader(Object::kFieldClass, writer->GetObjectTags(this)); |
| 527 | 528 |
| 528 // Write out all the non object fields. | 529 // Write out all the non object fields. |
| 529 writer->WriteIntptrValue(ptr()->token_pos_); | 530 writer->WriteIntptrValue(ptr()->token_pos_); |
| 530 writer->Write<bool>(ptr()->is_static_); | 531 writer->Write<bool>(ptr()->is_static_); |
| 531 writer->Write<bool>(ptr()->is_final_); | 532 writer->Write<bool>(ptr()->is_final_); |
| 533 writer->Write<bool>(ptr()->is_const_); |
| 532 writer->Write<bool>(ptr()->has_initializer_); | 534 writer->Write<bool>(ptr()->has_initializer_); |
| 533 | 535 |
| 534 // Write out all the object pointer fields. | 536 // Write out all the object pointer fields. |
| 535 SnapshotWriterVisitor visitor(writer); | 537 SnapshotWriterVisitor visitor(writer); |
| 536 visitor.VisitPointers(from(), to()); | 538 visitor.VisitPointers(from(), to()); |
| 537 } | 539 } |
| 538 | 540 |
| 539 | 541 |
| 540 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, | 542 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader, |
| 541 intptr_t object_id, | 543 intptr_t object_id, |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1987 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); | 1989 writer->Write<RawObject*>(ptr()->num_bracket_expressions_); |
| 1988 writer->WriteObjectImpl(ptr()->pattern_); | 1990 writer->WriteObjectImpl(ptr()->pattern_); |
| 1989 writer->WriteIntptrValue(ptr()->type_); | 1991 writer->WriteIntptrValue(ptr()->type_); |
| 1990 writer->WriteIntptrValue(ptr()->flags_); | 1992 writer->WriteIntptrValue(ptr()->flags_); |
| 1991 | 1993 |
| 1992 // Do not write out the data part which is native. | 1994 // Do not write out the data part which is native. |
| 1993 } | 1995 } |
| 1994 | 1996 |
| 1995 | 1997 |
| 1996 } // namespace dart | 1998 } // namespace dart |
| OLD | NEW |