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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 bool deserializing_user_code() { return deserializing_user_code_; } | 565 bool deserializing_user_code() { return deserializing_user_code_; } |
566 | 566 |
567 void DecodeReservation(Vector<const SerializedData::Reservation> res); | 567 void DecodeReservation(Vector<const SerializedData::Reservation> res); |
568 | 568 |
569 bool ReserveSpace(); | 569 bool ReserveSpace(); |
570 | 570 |
571 void UnalignedCopy(Object** dest, Object** src) { | 571 void UnalignedCopy(Object** dest, Object** src) { |
572 memcpy(dest, src, sizeof(*src)); | 572 memcpy(dest, src, sizeof(*src)); |
573 } | 573 } |
574 | 574 |
| 575 void SetAlignment(byte data) { |
| 576 DCHECK_EQ(kWordAligned, next_alignment_); |
| 577 int alignment = data - (kAlignmentPrefix - 1); |
| 578 DCHECK_LE(kWordAligned, alignment); |
| 579 DCHECK_LE(alignment, kSimd128Unaligned); |
| 580 next_alignment_ = static_cast<AllocationAlignment>(alignment); |
| 581 } |
| 582 |
575 void DeserializeDeferredObjects(); | 583 void DeserializeDeferredObjects(); |
576 | 584 |
577 void FlushICacheForNewIsolate(); | 585 void FlushICacheForNewIsolate(); |
578 void FlushICacheForNewCodeObjects(); | 586 void FlushICacheForNewCodeObjects(); |
579 | 587 |
580 void CommitNewInternalizedStrings(Isolate* isolate); | 588 void CommitNewInternalizedStrings(Isolate* isolate); |
581 | 589 |
582 // Fills in some heap data in an area from start to end (non-inclusive). The | 590 // Fills in some heap data in an area from start to end (non-inclusive). The |
583 // space id is used for the write barrier. The object_address is the address | 591 // space id is used for the write barrier. The object_address is the address |
584 // of the object we are writing into, or NULL if we are not writing into an | 592 // of the object we are writing into, or NULL if we are not writing into an |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; | 1061 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; |
1054 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 1062 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
1055 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 1063 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
1056 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 1064 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
1057 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 1065 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
1058 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 1066 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
1059 }; | 1067 }; |
1060 } } // namespace v8::internal | 1068 } } // namespace v8::internal |
1061 | 1069 |
1062 #endif // V8_SNAPSHOT_SERIALIZE_H_ | 1070 #endif // V8_SNAPSHOT_SERIALIZE_H_ |
OLD | NEW |