Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/snapshot/serializer-common.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/snapshot/serializer.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/snapshot/serializer.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698