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

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

Issue 2490783004: [serializer] small fixes for blink snapshot. (Closed)
Patch Set: rebase and fix Created 4 years, 1 month 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/deserializer.cc ('k') | src/snapshot/serializer.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 bool PartialSerializer::ShouldBeInThePartialSnapshotCache(HeapObject* o) { 113 bool PartialSerializer::ShouldBeInThePartialSnapshotCache(HeapObject* o) {
114 // Scripts should be referred only through shared function infos. We can't 114 // Scripts should be referred only through shared function infos. We can't
115 // allow them to be part of the partial snapshot because they contain a 115 // allow them to be part of the partial snapshot because they contain a
116 // unique ID, and deserializing several partial snapshots containing script 116 // unique ID, and deserializing several partial snapshots containing script
117 // would cause dupes. 117 // would cause dupes.
118 DCHECK(!o->IsScript()); 118 DCHECK(!o->IsScript());
119 return o->IsName() || o->IsSharedFunctionInfo() || o->IsHeapNumber() || 119 return o->IsName() || o->IsSharedFunctionInfo() || o->IsHeapNumber() ||
120 o->IsCode() || o->IsScopeInfo() || o->IsAccessorInfo() || 120 o->IsCode() || o->IsScopeInfo() || o->IsAccessorInfo() ||
121 o->IsTemplateInfo() ||
121 o->map() == 122 o->map() ==
122 startup_serializer_->isolate()->heap()->fixed_cow_array_map(); 123 startup_serializer_->isolate()->heap()->fixed_cow_array_map();
123 } 124 }
124 125
125 void PartialSerializer::SerializeInternalFields() { 126 void PartialSerializer::SerializeInternalFields() {
126 int count = internal_field_holders_.length(); 127 int count = internal_field_holders_.length();
127 if (count == 0) return; 128 if (count == 0) return;
128 DisallowHeapAllocation no_gc; 129 DisallowHeapAllocation no_gc;
129 DisallowJavascriptExecution no_js(isolate()); 130 DisallowJavascriptExecution no_js(isolate());
130 DisallowCompilation no_compile(isolate()); 131 DisallowCompilation no_compile(isolate());
(...skipping 15 matching lines...) Expand all
146 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size, 147 sink_.PutRaw(reinterpret_cast<const byte*>(data.data), data.raw_size,
147 "internal fields data"); 148 "internal fields data");
148 delete[] data.data; 149 delete[] data.data;
149 } 150 }
150 } 151 }
151 sink_.Put(kSynchronize, "Finished with internal fields data"); 152 sink_.Put(kSynchronize, "Finished with internal fields data");
152 } 153 }
153 154
154 } // namespace internal 155 } // namespace internal
155 } // namespace v8 156 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/deserializer.cc ('k') | src/snapshot/serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698