| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_DESERIALIZER_H_ | 5 #ifndef V8_SNAPSHOT_DESERIALIZER_H_ |
| 6 #define V8_SNAPSHOT_DESERIALIZER_H_ | 6 #define V8_SNAPSHOT_DESERIALIZER_H_ |
| 7 | 7 |
| 8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 #include "src/snapshot/serializer-common.h" | 10 #include "src/snapshot/serializer-common.h" |
| 11 #include "src/snapshot/snapshot-source-sink.h" | 11 #include "src/snapshot/snapshot-source-sink.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 // Used for platforms with embedded constant pools to trigger deserialization |
| 17 // of objects found in code. |
| 18 #if defined(V8_TARGET_ARCH_MIPS) || defined(V8_TARGET_ARCH_MIPS64) || \ |
| 19 defined(V8_TARGET_ARCH_PPC) || defined(V8_TARGET_ARCH_S390) || \ |
| 20 V8_EMBEDDED_CONSTANT_POOL |
| 21 #define V8_CODE_EMBEDS_OBJECT_POINTER 1 |
| 22 #else |
| 23 #define V8_CODE_EMBEDS_OBJECT_POINTER 0 |
| 24 #endif |
| 25 |
| 16 class Heap; | 26 class Heap; |
| 17 | 27 |
| 18 // A Deserializer reads a snapshot and reconstructs the Object graph it defines. | 28 // A Deserializer reads a snapshot and reconstructs the Object graph it defines. |
| 19 class Deserializer : public SerializerDeserializer { | 29 class Deserializer : public SerializerDeserializer { |
| 20 public: | 30 public: |
| 21 // Create a deserializer from a snapshot byte source. | 31 // Create a deserializer from a snapshot byte source. |
| 22 template <class Data> | 32 template <class Data> |
| 23 explicit Deserializer(Data* data) | 33 explicit Deserializer(Data* data) |
| 24 : isolate_(NULL), | 34 : isolate_(NULL), |
| 25 source_(data->Payload()), | 35 source_(data->Payload()), |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 141 |
| 132 AllocationAlignment next_alignment_; | 142 AllocationAlignment next_alignment_; |
| 133 | 143 |
| 134 DISALLOW_COPY_AND_ASSIGN(Deserializer); | 144 DISALLOW_COPY_AND_ASSIGN(Deserializer); |
| 135 }; | 145 }; |
| 136 | 146 |
| 137 } // namespace internal | 147 } // namespace internal |
| 138 } // namespace v8 | 148 } // namespace v8 |
| 139 | 149 |
| 140 #endif // V8_SNAPSHOT_DESERIALIZER_H_ | 150 #endif // V8_SNAPSHOT_DESERIALIZER_H_ |
| OLD | NEW |