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

Unified Diff: src/serialize.cc

Issue 737373003: When optimizing deserialized code, make sure IC state is preserved. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects-inl.h ('k') | test/mjsunit/deserialize-optimize-inner.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index f492f5b6cc08c6ff91e15b77214bb3abd346d6af..e502c9559fce70b186d4a911936bf042239e8c71 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -2042,10 +2042,11 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
SerializeIC(code_object, how_to_code, where_to_point);
return;
case Code::FUNCTION:
- // Only serialize the code for the toplevel function. Replace code
- // of included function literals by the lazy compile builtin.
+ 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.
- if (code_object != main_code_) {
+ if (code_object != main_code_ && !FLAG_serialize_inner) {
SerializeBuiltin(Builtins::kCompileLazy, how_to_code, where_to_point);
} else {
code_object->MakeYoung();
@@ -2062,6 +2063,8 @@ void CodeSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
CHECK(!obj->IsJSGlobalProxy() && !obj->IsGlobalObject());
// There should be no hash table embedded. They would require rehashing.
CHECK(!obj->IsHashTable());
+ // We expect no instantiated function objects or contexts.
+ CHECK(!obj->IsJSFunction() && !obj->IsContext());
SerializeGeneric(obj, how_to_code, where_to_point);
}
« no previous file with comments | « src/objects-inl.h ('k') | test/mjsunit/deserialize-optimize-inner.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698