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

Unified Diff: src/snapshot/partial-serializer.cc

Issue 2090563002: [serializer] encode recent long-encoded root list items as hot objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: address comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/snapshot/deserializer.cc ('k') | src/snapshot/serializer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/partial-serializer.cc
diff --git a/src/snapshot/partial-serializer.cc b/src/snapshot/partial-serializer.cc
index d1d33538ba5e28a50f20fad92485b27cfa50137a..b46f6755f0badab8e01e85b8b2eba317aeec724e 100644
--- a/src/snapshot/partial-serializer.cc
+++ b/src/snapshot/partial-serializer.cc
@@ -51,12 +51,16 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
// Replace typed arrays by undefined.
if (obj->IsJSTypedArray()) obj = isolate_->heap()->undefined_value();
+ if (SerializeHotObject(obj, how_to_code, where_to_point, skip)) return;
+
int root_index = root_index_map_.Lookup(obj);
if (root_index != RootIndexMap::kInvalidRootIndex) {
PutRoot(root_index, obj, how_to_code, where_to_point, skip);
return;
}
+ if (SerializeBackReference(obj, how_to_code, where_to_point, skip)) return;
+
if (ShouldBeInThePartialSnapshotCache(obj)) {
FlushSkip(skip);
@@ -77,16 +81,16 @@ void PartialSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
// Function and object templates are not context specific.
DCHECK(!obj->IsTemplateInfo());
- if (SerializeKnownObject(obj, how_to_code, where_to_point, skip)) return;
-
FlushSkip(skip);
// Clear literal boilerplates.
if (obj->IsJSFunction()) {
- LiteralsArray* literals = JSFunction::cast(obj)->literals();
+ JSFunction* function = JSFunction::cast(obj);
+ LiteralsArray* literals = function->literals();
for (int i = 0; i < literals->literals_count(); i++) {
literals->set_literal_undefined(i);
}
+ function->ClearTypeFeedbackInfo();
}
// Object has not yet been serialized. Serialize it here.
« no previous file with comments | « src/snapshot/deserializer.cc ('k') | src/snapshot/serializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698