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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 void SerializerDeserializer::Iterate(Isolate* isolate, ObjectVisitor* visitor) { | 62 void SerializerDeserializer::Iterate(Isolate* isolate, ObjectVisitor* visitor) { |
63 List<Object*>* cache = isolate->partial_snapshot_cache(); | 63 List<Object*>* cache = isolate->partial_snapshot_cache(); |
64 for (int i = 0;; ++i) { | 64 for (int i = 0;; ++i) { |
65 // Extend the array ready to get a value when deserializing. | 65 // Extend the array ready to get a value when deserializing. |
66 if (cache->length() <= i) cache->Add(Smi::FromInt(0)); | 66 if (cache->length() <= i) cache->Add(Smi::FromInt(0)); |
67 // During deserialization, the visitor populates the partial snapshot cache | 67 // During deserialization, the visitor populates the partial snapshot cache |
68 // and eventually terminates the cache with undefined. | 68 // and eventually terminates the cache with undefined. |
69 visitor->VisitPointer(&cache->at(i)); | 69 visitor->VisitPointer(&cache->at(i)); |
70 if (cache->at(i)->IsUndefined()) break; | 70 if (cache->at(i)->IsUndefined(isolate)) break; |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 bool SerializerDeserializer::CanBeDeferred(HeapObject* o) { | 74 bool SerializerDeserializer::CanBeDeferred(HeapObject* o) { |
75 return !o->IsString() && !o->IsScript(); | 75 return !o->IsString() && !o->IsScript(); |
76 } | 76 } |
77 | 77 |
78 } // namespace internal | 78 } // namespace internal |
79 } // namespace v8 | 79 } // namespace v8 |
OLD | NEW |