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/partial-serializer.h" | 5 #include "src/snapshot/partial-serializer.h" |
6 #include "src/snapshot/startup-serializer.h" | 6 #include "src/snapshot/startup-serializer.h" |
7 | 7 |
8 #include "src/objects-inl.h" | 8 #include "src/objects-inl.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 23 matching lines...) Expand all Loading... |
34 // explicitly when it's loaded. | 34 // explicitly when it's loaded. |
35 if (context->IsNativeContext()) { | 35 if (context->IsNativeContext()) { |
36 context->set(Context::NEXT_CONTEXT_LINK, | 36 context->set(Context::NEXT_CONTEXT_LINK, |
37 isolate_->heap()->undefined_value()); | 37 isolate_->heap()->undefined_value()); |
38 DCHECK(!context->global_object()->IsUndefined(context->GetIsolate())); | 38 DCHECK(!context->global_object()->IsUndefined(context->GetIsolate())); |
39 // Reset math random cache to get fresh random numbers. | 39 // Reset math random cache to get fresh random numbers. |
40 context->set_math_random_index(Smi::kZero); | 40 context->set_math_random_index(Smi::kZero); |
41 context->set_math_random_cache(isolate_->heap()->undefined_value()); | 41 context->set_math_random_cache(isolate_->heap()->undefined_value()); |
42 } | 42 } |
43 } | 43 } |
44 VisitPointer(o); | 44 VisitRootPointer(Root::kPartialSnapshotCache, o); |
45 SerializeDeferredObjects(); | 45 SerializeDeferredObjects(); |
46 SerializeEmbedderFields(); | 46 SerializeEmbedderFields(); |
47 Pad(); | 47 Pad(); |
48 } | 48 } |
49 | 49 |
50 void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, | 50 void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code, |
51 WhereToPoint where_to_point, int skip) { | 51 WhereToPoint where_to_point, int skip) { |
52 if (obj->IsMap()) { | 52 if (obj->IsMap()) { |
53 // The code-caches link to context-specific code objects, which | 53 // The code-caches link to context-specific code objects, which |
54 // the startup and context serializes cannot currently handle. | 54 // the startup and context serializes cannot currently handle. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size, | 147 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size, |
148 "embedder fields data"); | 148 "embedder fields data"); |
149 delete[] data.data; | 149 delete[] data.data; |
150 } | 150 } |
151 } | 151 } |
152 sink_.Put(kSynchronize, "Finished with embedder fields data"); | 152 sink_.Put(kSynchronize, "Finished with embedder fields data"); |
153 } | 153 } |
154 | 154 |
155 } // namespace internal | 155 } // namespace internal |
156 } // namespace v8 | 156 } // namespace v8 |
OLD | NEW |