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 #include "src/snapshot/serializer-common.h" | 5 #include "src/snapshot/serializer-common.h" |
6 | 6 |
7 #include "src/external-reference-table.h" | 7 #include "src/external-reference-table.h" |
8 #include "src/ic/stub-cache.h" | 8 #include "src/ic/stub-cache.h" |
9 #include "src/list-inl.h" | 9 #include "src/list-inl.h" |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 size_ = size; | 52 size_ = size; |
53 owns_data_ = true; | 53 owns_data_ = true; |
54 DCHECK(IsAligned(reinterpret_cast<intptr_t>(data_), kPointerAlignment)); | 54 DCHECK(IsAligned(reinterpret_cast<intptr_t>(data_), kPointerAlignment)); |
55 } | 55 } |
56 | 56 |
57 // The partial snapshot cache is terminated by undefined. We visit the | 57 // The partial snapshot cache is terminated by undefined. We visit the |
58 // partial snapshot... | 58 // partial snapshot... |
59 // - during deserialization to populate it. | 59 // - during deserialization to populate it. |
60 // - during normal GC to keep its content alive. | 60 // - during normal GC to keep its content alive. |
61 // - not during serialization. The partial serializer adds to it explicitly. | 61 // - not during serialization. The partial serializer adds to it explicitly. |
| 62 DISABLE_CFI_PERF |
62 void SerializerDeserializer::Iterate(Isolate* isolate, ObjectVisitor* visitor) { | 63 void SerializerDeserializer::Iterate(Isolate* isolate, ObjectVisitor* visitor) { |
63 List<Object*>* cache = isolate->partial_snapshot_cache(); | 64 List<Object*>* cache = isolate->partial_snapshot_cache(); |
64 for (int i = 0;; ++i) { | 65 for (int i = 0;; ++i) { |
65 // Extend the array ready to get a value when deserializing. | 66 // Extend the array ready to get a value when deserializing. |
66 if (cache->length() <= i) cache->Add(Smi::FromInt(0)); | 67 if (cache->length() <= i) cache->Add(Smi::FromInt(0)); |
67 // During deserialization, the visitor populates the partial snapshot cache | 68 // During deserialization, the visitor populates the partial snapshot cache |
68 // and eventually terminates the cache with undefined. | 69 // and eventually terminates the cache with undefined. |
69 visitor->VisitPointer(&cache->at(i)); | 70 visitor->VisitPointer(&cache->at(i)); |
70 if (cache->at(i)->IsUndefined(isolate)) break; | 71 if (cache->at(i)->IsUndefined(isolate)) break; |
71 } | 72 } |
72 } | 73 } |
73 | 74 |
74 bool SerializerDeserializer::CanBeDeferred(HeapObject* o) { | 75 bool SerializerDeserializer::CanBeDeferred(HeapObject* o) { |
75 return !o->IsString() && !o->IsScript(); | 76 return !o->IsString() && !o->IsScript(); |
76 } | 77 } |
77 | 78 |
78 } // namespace internal | 79 } // namespace internal |
79 } // namespace v8 | 80 } // namespace v8 |
OLD | NEW |