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_STARTUP_SERIALIZER_H_ | 5 #ifndef V8_SNAPSHOT_STARTUP_SERIALIZER_H_ |
6 #define V8_SNAPSHOT_STARTUP_SERIALIZER_H_ | 6 #define V8_SNAPSHOT_STARTUP_SERIALIZER_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 #include "include/v8.h" | 9 #include "include/v8.h" |
10 #include "src/snapshot/serializer.h" | 10 #include "src/snapshot/serializer.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 private: | 50 private: |
51 DisallowHeapAllocation no_allocation_; | 51 DisallowHeapAllocation no_allocation_; |
52 HeapObjectToIndexHashMap map_; | 52 HeapObjectToIndexHashMap map_; |
53 int next_index_; | 53 int next_index_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(PartialCacheIndexMap); | 55 DISALLOW_COPY_AND_ASSIGN(PartialCacheIndexMap); |
56 }; | 56 }; |
57 | 57 |
58 // The StartupSerializer has to serialize the root array, which is slightly | 58 // The StartupSerializer has to serialize the root array, which is slightly |
59 // different. | 59 // different. |
60 void VisitPointers(Object** start, Object** end) override; | 60 void VisitRootPointers(Root root, Object** start, Object** end) override; |
61 void SerializeObject(HeapObject* o, HowToCode how_to_code, | 61 void SerializeObject(HeapObject* o, HowToCode how_to_code, |
62 WhereToPoint where_to_point, int skip) override; | 62 WhereToPoint where_to_point, int skip) override; |
63 void Synchronize(VisitorSynchronization::SyncTag tag) override; | 63 void Synchronize(VisitorSynchronization::SyncTag tag) override; |
64 | 64 |
65 // Some roots should not be serialized, because their actual value depends on | 65 // Some roots should not be serialized, because their actual value depends on |
66 // absolute addresses and they are reset after deserialization, anyway. | 66 // absolute addresses and they are reset after deserialization, anyway. |
67 // In the first pass over the root list, we only serialize immortal immovable | 67 // In the first pass over the root list, we only serialize immortal immovable |
68 // roots. In the second pass, we serialize the rest. | 68 // roots. In the second pass, we serialize the rest. |
69 bool RootShouldBeSkipped(int root_index); | 69 bool RootShouldBeSkipped(int root_index); |
70 | 70 |
71 bool clear_function_code_; | 71 bool clear_function_code_; |
72 bool serializing_builtins_; | 72 bool serializing_builtins_; |
73 bool serializing_immortal_immovables_roots_; | 73 bool serializing_immortal_immovables_roots_; |
74 std::bitset<Heap::kStrongRootListLength> root_has_been_serialized_; | 74 std::bitset<Heap::kStrongRootListLength> root_has_been_serialized_; |
75 PartialCacheIndexMap partial_cache_index_map_; | 75 PartialCacheIndexMap partial_cache_index_map_; |
76 List<AccessorInfo*> accessor_infos_; | 76 List<AccessorInfo*> accessor_infos_; |
77 DISALLOW_COPY_AND_ASSIGN(StartupSerializer); | 77 DISALLOW_COPY_AND_ASSIGN(StartupSerializer); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace internal | 80 } // namespace internal |
81 } // namespace v8 | 81 } // namespace v8 |
82 | 82 |
83 #endif // V8_SNAPSHOT_STARTUP_SERIALIZER_H_ | 83 #endif // V8_SNAPSHOT_STARTUP_SERIALIZER_H_ |
OLD | NEW |