| 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/heap/heap.h" | 9 #include "src/heap/heap.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 void Deserialize(Isolate* isolate); | 540 void Deserialize(Isolate* isolate); |
| 541 | 541 |
| 542 // Deserialize a single object and the objects reachable from it. | 542 // Deserialize a single object and the objects reachable from it. |
| 543 MaybeHandle<Object> DeserializePartial( | 543 MaybeHandle<Object> DeserializePartial( |
| 544 Isolate* isolate, Handle<JSGlobalProxy> global_proxy, | 544 Isolate* isolate, Handle<JSGlobalProxy> global_proxy, |
| 545 Handle<FixedArray>* outdated_contexts_out); | 545 Handle<FixedArray>* outdated_contexts_out); |
| 546 | 546 |
| 547 // Deserialize a shared function info. Fail gracefully. | 547 // Deserialize a shared function info. Fail gracefully. |
| 548 MaybeHandle<SharedFunctionInfo> DeserializeCode(Isolate* isolate); | 548 MaybeHandle<SharedFunctionInfo> DeserializeCode(Isolate* isolate); |
| 549 | 549 |
| 550 void FlushICacheForNewCodeObjects(); | |
| 551 | |
| 552 // Pass a vector of externally-provided objects referenced by the snapshot. | 550 // Pass a vector of externally-provided objects referenced by the snapshot. |
| 553 // The ownership to its backing store is handed over as well. | 551 // The ownership to its backing store is handed over as well. |
| 554 void SetAttachedObjects(Vector<Handle<Object> > attached_objects) { | 552 void SetAttachedObjects(Vector<Handle<Object> > attached_objects) { |
| 555 attached_objects_ = attached_objects; | 553 attached_objects_ = attached_objects; |
| 556 } | 554 } |
| 557 | 555 |
| 558 private: | 556 private: |
| 559 virtual void VisitPointers(Object** start, Object** end); | 557 virtual void VisitPointers(Object** start, Object** end); |
| 560 | 558 |
| 561 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { | 559 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { |
| 562 UNREACHABLE(); | 560 UNREACHABLE(); |
| 563 } | 561 } |
| 564 | 562 |
| 565 void Initialize(Isolate* isolate); | 563 void Initialize(Isolate* isolate); |
| 566 | 564 |
| 567 bool deserializing_user_code() { return deserializing_user_code_; } | 565 bool deserializing_user_code() { return deserializing_user_code_; } |
| 568 | 566 |
| 569 void DecodeReservation(Vector<const SerializedData::Reservation> res); | 567 void DecodeReservation(Vector<const SerializedData::Reservation> res); |
| 570 | 568 |
| 571 bool ReserveSpace(); | 569 bool ReserveSpace(); |
| 572 | 570 |
| 573 void UnalignedCopy(Object** dest, Object** src) { | 571 void UnalignedCopy(Object** dest, Object** src) { |
| 574 memcpy(dest, src, sizeof(*src)); | 572 memcpy(dest, src, sizeof(*src)); |
| 575 } | 573 } |
| 576 | 574 |
| 577 void DeserializeDeferredObjects(); | 575 void DeserializeDeferredObjects(); |
| 578 | 576 |
| 577 void FlushICacheForNewIsolate(); |
| 578 void FlushICacheForNewCodeObjects(); |
| 579 |
| 579 void CommitPostProcessedObjects(Isolate* isolate); | 580 void CommitPostProcessedObjects(Isolate* isolate); |
| 580 | 581 |
| 581 // Fills in some heap data in an area from start to end (non-inclusive). The | 582 // 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 | 583 // 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 | 584 // 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 | 585 // 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. | 586 // the heap. Return false if the object content has been deferred. |
| 586 bool ReadData(Object** start, Object** end, int space, | 587 bool ReadData(Object** start, Object** end, int space, |
| 587 Address object_address); | 588 Address object_address); |
| 588 void ReadObject(int space_number, Object** write_back); | 589 void ReadObject(int space_number, Object** write_back); |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; | 977 static const int kNumReservationsOffset = kFlagHashOffset + kInt32Size; |
| 977 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; | 978 static const int kNumCodeStubKeysOffset = kNumReservationsOffset + kInt32Size; |
| 978 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; | 979 static const int kPayloadLengthOffset = kNumCodeStubKeysOffset + kInt32Size; |
| 979 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; | 980 static const int kChecksum1Offset = kPayloadLengthOffset + kInt32Size; |
| 980 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; | 981 static const int kChecksum2Offset = kChecksum1Offset + kInt32Size; |
| 981 static const int kHeaderSize = kChecksum2Offset + kInt32Size; | 982 static const int kHeaderSize = kChecksum2Offset + kInt32Size; |
| 982 }; | 983 }; |
| 983 } } // namespace v8::internal | 984 } } // namespace v8::internal |
| 984 | 985 |
| 985 #endif // V8_SNAPSHOT_SERIALIZE_H_ | 986 #endif // V8_SNAPSHOT_SERIALIZE_H_ |
| OLD | NEW |