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

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

Issue 1811263002: [serializer] tweak startup serializer for warming up. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 9 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/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/startup-serializer.cc
diff --git a/src/snapshot/startup-serializer.cc b/src/snapshot/startup-serializer.cc
index bcb85456c98113c6e954c929107635178a0b2c3e..86b0f833c1e147f0553203413a68f1e26906dc72 100644
--- a/src/snapshot/startup-serializer.cc
+++ b/src/snapshot/startup-serializer.cc
@@ -27,18 +27,26 @@ void StartupSerializer::SerializeObject(HeapObject* obj, HowToCode how_to_code,
WhereToPoint where_to_point, int skip) {
DCHECK(!obj->IsJSFunction());
- if (obj->IsCode()) {
+ if (function_code_handling_ == CLEAR_FUNCTION_CODE) {
+ if (obj->IsCode()) {
+ Code* code = Code::cast(obj);
+ // If the function code is compiled (either as native code or bytecode),
+ // replace it with lazy-compile builtin. Only exception is when we are
+ // serializing the canonical interpreter-entry-trampoline builtin.
+ if (code->kind() == Code::FUNCTION ||
+ (!serializing_builtins_ && code->is_interpreter_entry_trampoline())) {
+ obj = isolate()->builtins()->builtin(Builtins::kCompileLazy);
+ }
+ } else if (obj->IsBytecodeArray()) {
+ obj = isolate()->heap()->undefined_value();
+ }
+ } else if (obj->IsCode()) {
+ DCHECK_EQ(KEEP_FUNCTION_CODE, function_code_handling_);
Code* code = Code::cast(obj);
- // If the function code is compiled (either as native code or bytecode),
- // replace it with lazy-compile builtin. Only exception is when we are
- // serializing the canonical interpreter-entry-trampoline builtin.
- if (function_code_handling_ == CLEAR_FUNCTION_CODE &&
- (code->kind() == Code::FUNCTION ||
- (!serializing_builtins_ && code->is_interpreter_entry_trampoline()))) {
- obj = isolate()->builtins()->builtin(Builtins::kCompileLazy);
+ if (code->kind() == Code::FUNCTION) {
+ code->ClearInlineCaches();
+ code->set_profiler_ticks(0);
}
- } else if (obj->IsBytecodeArray()) {
- obj = isolate()->heap()->undefined_value();
}
int root_index = root_index_map_.Lookup(obj);
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698