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

Unified Diff: src/snapshot/serialize.cc

Issue 1211803002: Reland 2 "Keep a canonical list of shared function infos." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add test case Created 5 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/runtime/runtime-function.cc ('k') | src/typing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serialize.cc
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc
index 66da378617571ccb915303bb828cd01fe0e8448d..a0bc2db9104c9320ff35f8c3a70a489f12d73406 100644
--- a/src/snapshot/serialize.cc
+++ b/src/snapshot/serialize.cc
@@ -1897,6 +1897,10 @@ void Serializer::ObjectSerializer::Serialize() {
// Clear cached line ends.
Object* undefined = serializer_->isolate()->heap()->undefined_value();
Script::cast(object_)->set_line_ends(undefined);
+ Object* shared_list = Script::cast(object_)->shared_function_infos();
+ if (shared_list->IsWeakFixedArray()) {
+ WeakFixedArray::cast(shared_list)->Compact();
+ }
}
if (object_->IsExternalString()) {
@@ -2321,7 +2325,7 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
DCHECK(code_object->has_reloc_info_for_serialization());
// Only serialize the code for the toplevel function unless specified
// by flag. Replace code of inner functions by the lazy compile builtin.
- // This is safe, as checked in Compiler::BuildFunctionInfo.
+ // This is safe, as checked in Compiler::GetSharedFunctionInfo.
if (code_object != main_code_ && !FLAG_serialize_inner) {
SerializeBuiltin(Builtins::kCompileLazy, how_to_code, where_to_point);
} else {
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698