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

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

Issue 2076083002: [snapshot] support including templates in the snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@externalref
Patch Set: fix build 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/heap/heap-inl.h ('k') | test/cctest/test-serialize.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/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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return; 67 return;
68 } 68 }
69 69
70 // Pointers from the partial snapshot to the objects in the startup snapshot 70 // Pointers from the partial snapshot to the objects in the startup snapshot
71 // should go through the root array or through the partial snapshot cache. 71 // should go through the root array or through the partial snapshot cache.
72 // If this is not the case you may have to add something to the root array. 72 // If this is not the case you may have to add something to the root array.
73 DCHECK(!startup_serializer_->reference_map()->Lookup(obj).is_valid()); 73 DCHECK(!startup_serializer_->reference_map()->Lookup(obj).is_valid());
74 // All the internalized strings that the partial snapshot needs should be 74 // All the internalized strings that the partial snapshot needs should be
75 // either in the root table or in the partial snapshot cache. 75 // either in the root table or in the partial snapshot cache.
76 DCHECK(!obj->IsInternalizedString()); 76 DCHECK(!obj->IsInternalizedString());
77 // Function and object templates are not context specific.
78 DCHECK(!obj->IsTemplateInfo());
77 79
78 if (SerializeKnownObject(obj, how_to_code, where_to_point, skip)) return; 80 if (SerializeKnownObject(obj, how_to_code, where_to_point, skip)) return;
79 81
80 FlushSkip(skip); 82 FlushSkip(skip);
81 83
82 // Clear literal boilerplates. 84 // Clear literal boilerplates.
83 if (obj->IsJSFunction()) { 85 if (obj->IsJSFunction()) {
84 LiteralsArray* literals = JSFunction::cast(obj)->literals(); 86 LiteralsArray* literals = JSFunction::cast(obj)->literals();
85 for (int i = 0; i < literals->literals_count(); i++) { 87 for (int i = 0; i < literals->literals_count(); i++) {
86 literals->set_literal_undefined(i); 88 literals->set_literal_undefined(i);
(...skipping 12 matching lines...) Expand all
99 // would cause dupes. 101 // would cause dupes.
100 DCHECK(!o->IsScript()); 102 DCHECK(!o->IsScript());
101 return o->IsName() || o->IsSharedFunctionInfo() || o->IsHeapNumber() || 103 return o->IsName() || o->IsSharedFunctionInfo() || o->IsHeapNumber() ||
102 o->IsCode() || o->IsScopeInfo() || o->IsAccessorInfo() || 104 o->IsCode() || o->IsScopeInfo() || o->IsAccessorInfo() ||
103 o->map() == 105 o->map() ==
104 startup_serializer_->isolate()->heap()->fixed_cow_array_map(); 106 startup_serializer_->isolate()->heap()->fixed_cow_array_map();
105 } 107 }
106 108
107 } // namespace internal 109 } // namespace internal
108 } // namespace v8 110 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap-inl.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698