| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_SNAPSHOT_SERIALIZE_H_ | 5 #ifndef V8_SNAPSHOT_SERIALIZE_H_ |
| 6 #define V8_SNAPSHOT_SERIALIZE_H_ | 6 #define V8_SNAPSHOT_SERIALIZE_H_ |
| 7 | 7 |
| 8 #include "src/hashmap.h" | 8 #include "src/hashmap.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/snapshot/snapshot-source-sink.h" | 10 #include "src/snapshot/snapshot-source-sink.h" |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 void DecodeReservation(Vector<const SerializedData::Reservation> res); | 569 void DecodeReservation(Vector<const SerializedData::Reservation> res); |
| 570 | 570 |
| 571 bool ReserveSpace(); | 571 bool ReserveSpace(); |
| 572 | 572 |
| 573 void UnalignedCopy(Object** dest, Object** src) { | 573 void UnalignedCopy(Object** dest, Object** src) { |
| 574 memcpy(dest, src, sizeof(*src)); | 574 memcpy(dest, src, sizeof(*src)); |
| 575 } | 575 } |
| 576 | 576 |
| 577 void DeserializeDeferredObjects(); | 577 void DeserializeDeferredObjects(); |
| 578 | 578 |
| 579 void CommitNewInternalizedStrings(Isolate* isolate); | 579 void CommitPostProcessedObjects(Isolate* isolate); |
| 580 | 580 |
| 581 // Fills in some heap data in an area from start to end (non-inclusive). The | 581 // Fills in some heap data in an area from start to end (non-inclusive). The |
| 582 // space id is used for the write barrier. The object_address is the address | 582 // space id is used for the write barrier. The object_address is the address |
| 583 // of the object we are writing into, or NULL if we are not writing into an | 583 // of the object we are writing into, or NULL if we are not writing into an |
| 584 // object, i.e. if we are writing a series of tagged values that are not on | 584 // object, i.e. if we are writing a series of tagged values that are not on |
| 585 // the heap. Return false if the object content has been deferred. | 585 // the heap. Return false if the object content has been deferred. |
| 586 bool ReadData(Object** start, Object** end, int space, | 586 bool ReadData(Object** start, Object** end, int space, |
| 587 Address object_address); | 587 Address object_address); |
| 588 void ReadObject(int space_number, Object** write_back); | 588 void ReadObject(int space_number, Object** write_back); |
| 589 Address Allocate(int space_index, int size); | 589 Address Allocate(int space_index, int size); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 613 // current chunk of the target space by bumping up high water mark. | 613 // current chunk of the target space by bumping up high water mark. |
| 614 Heap::Reservation reservations_[kNumberOfSpaces]; | 614 Heap::Reservation reservations_[kNumberOfSpaces]; |
| 615 uint32_t current_chunk_[kNumberOfPreallocatedSpaces]; | 615 uint32_t current_chunk_[kNumberOfPreallocatedSpaces]; |
| 616 Address high_water_[kNumberOfPreallocatedSpaces]; | 616 Address high_water_[kNumberOfPreallocatedSpaces]; |
| 617 | 617 |
| 618 ExternalReferenceTable* external_reference_table_; | 618 ExternalReferenceTable* external_reference_table_; |
| 619 | 619 |
| 620 List<HeapObject*> deserialized_large_objects_; | 620 List<HeapObject*> deserialized_large_objects_; |
| 621 List<Code*> new_code_objects_; | 621 List<Code*> new_code_objects_; |
| 622 List<Handle<String> > new_internalized_strings_; | 622 List<Handle<String> > new_internalized_strings_; |
| 623 List<Handle<Script> > new_scripts_; |
| 623 | 624 |
| 624 bool deserializing_user_code_; | 625 bool deserializing_user_code_; |
| 625 | 626 |
| 626 AllocationAlignment next_alignment_; | 627 AllocationAlignment next_alignment_; |
| 627 | 628 |
| 628 DISALLOW_COPY_AND_ASSIGN(Deserializer); | 629 DISALLOW_COPY_AND_ASSIGN(Deserializer); |
| 629 }; | 630 }; |
| 630 | 631 |
| 631 | 632 |
| 632 class CodeAddressMap; | 633 class CodeAddressMap; |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; | 1053 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; |
| 1053 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 1054 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
| 1054 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 1055 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
| 1055 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 1056 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
| 1056 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 1057 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
| 1057 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 1058 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
| 1058 }; | 1059 }; |
| 1059 } } // namespace v8::internal | 1060 } } // namespace v8::internal |
| 1060 | 1061 |
| 1061 #endif // V8_SNAPSHOT_SERIALIZE_H_ | 1062 #endif // V8_SNAPSHOT_SERIALIZE_H_ |
| OLD | NEW |