| 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/snapshot.h" | 5 #include "vm/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/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 WriteIndexedObject(ObjectStore::kTrueValue); | 487 WriteIndexedObject(ObjectStore::kTrueValue); |
| 488 return; | 488 return; |
| 489 } | 489 } |
| 490 | 490 |
| 491 // Check if it is a singleton boolean false value. | 491 // Check if it is a singleton boolean false value. |
| 492 if (rawobj == object_store()->false_value()) { | 492 if (rawobj == object_store()->false_value()) { |
| 493 WriteIndexedObject(ObjectStore::kFalseValue); | 493 WriteIndexedObject(ObjectStore::kFalseValue); |
| 494 return; | 494 return; |
| 495 } | 495 } |
| 496 | 496 |
| 497 // Check if it is a code object in that case just write a Null object |
| 498 // as we do not want code objects in the snapshot. |
| 499 if (rawobj->ptr()->class_ == Object::code_class()) { |
| 500 WriteIndexedObject(Object::kNullObject); |
| 501 return; |
| 502 } |
| 503 |
| 497 // Check if classes are not being serialized and it is preinitialized type. | 504 // Check if classes are not being serialized and it is preinitialized type. |
| 498 if (kind_ != Snapshot::kFull) { | 505 if (kind_ != Snapshot::kFull) { |
| 499 RawType* raw_type = reinterpret_cast<RawType*>(rawobj); | 506 RawType* raw_type = reinterpret_cast<RawType*>(rawobj); |
| 500 index = object_store()->GetTypeIndex(raw_type); | 507 index = object_store()->GetTypeIndex(raw_type); |
| 501 if (index != ObjectStore::kInvalidIndex) { | 508 if (index != ObjectStore::kInvalidIndex) { |
| 502 WriteIndexedObject(index); | 509 WriteIndexedObject(index); |
| 503 return; | 510 return; |
| 504 } | 511 } |
| 505 } | 512 } |
| 506 | 513 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 652 |
| 646 | 653 |
| 647 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { | 654 void SnapshotWriterVisitor::VisitPointers(RawObject** first, RawObject** last) { |
| 648 for (RawObject** current = first; current <= last; current++) { | 655 for (RawObject** current = first; current <= last; current++) { |
| 649 RawObject* raw_obj = *current; | 656 RawObject* raw_obj = *current; |
| 650 writer_->WriteObject(raw_obj); | 657 writer_->WriteObject(raw_obj); |
| 651 } | 658 } |
| 652 } | 659 } |
| 653 | 660 |
| 654 } // namespace dart | 661 } // namespace dart |
| OLD | NEW |