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

Unified Diff: runtime/vm/clustered_snapshot.cc

Issue 2517683002: Don't include usage counters, etc in snapshots with code. If we already have code, eagerly recompil… (Closed)
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/clustered_snapshot.cc
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index d8ae13404bee5c821b87426e484f451040f63eaa..e561a54f2f0b0c315fcdc13f63afbd8f7e98f704 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -563,7 +563,7 @@ class FunctionSerializationCluster : public SerializationCluster {
s->Write<uint32_t>(func->ptr()->kind_tag_);
if (kind == Snapshot::kAppNoJIT) {
// Omit fields used to support de/reoptimization.
- } else {
+ } else if (!Snapshot::IncludesCode(kind)) {
#if !defined(DART_PRECOMPILED_RUNTIME)
bool is_optimized = Code::IsOptimized(func->ptr()->code_);
if (is_optimized) {
@@ -571,9 +571,6 @@ class FunctionSerializationCluster : public SerializationCluster {
} else {
s->Write<int32_t>(0);
}
- s->Write<int8_t>(func->ptr()->deoptimization_counter_);
- s->Write<uint16_t>(func->ptr()->optimized_instruction_count_);
- s->Write<uint16_t>(func->ptr()->optimized_call_site_count_);
#endif
}
}
@@ -643,10 +640,14 @@ class FunctionDeserializationCluster : public DeserializationCluster {
// Omit fields used to support de/reoptimization.
} else {
#if !defined(DART_PRECOMPILED_RUNTIME)
- func->ptr()->usage_counter_ = d->Read<int32_t>();
- func->ptr()->deoptimization_counter_ = d->Read<int8_t>();
- func->ptr()->optimized_instruction_count_ = d->Read<uint16_t>();
- func->ptr()->optimized_call_site_count_ = d->Read<uint16_t>();
+ if (Snapshot::IncludesCode(kind)) {
+ func->ptr()->usage_counter_ = 0;
+ } else {
+ func->ptr()->usage_counter_ = d->Read<int32_t>();
+ }
+ func->ptr()->deoptimization_counter_ = 0;
+ func->ptr()->optimized_instruction_count_ = 0;
+ func->ptr()->optimized_call_site_count_ = 0;
#endif
}
}
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698