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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 2326483005: Shrink AOT snapshot size and memory usage. (Closed)
Patch Set: . Created 4 years, 3 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
« runtime/vm/object.h ('K') | « runtime/vm/raw_object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 39d377a8b8184a526dcb9046e69c8398102033af..02ba16069b16eb11cef6e9231afc839c6bf6aac2 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -764,11 +764,14 @@ void RawFunction::WriteTo(SnapshotWriter* writer,
bool is_optimized = Code::IsOptimized(ptr()->code_);
// Write out all the non object fields.
+#if !defined(DART_PRECOMPILED_RUNTIME)
Florian Schneider 2016/09/15 17:17:37 In a separate CL, it may be worth excluding the wr
rmacnak 2016/09/16 21:59:02 Acknowledged.
writer->Write<int32_t>(ptr()->token_pos_.SnapshotEncode());
writer->Write<int32_t>(ptr()->end_token_pos_.SnapshotEncode());
+#endif
writer->Write<int16_t>(ptr()->num_fixed_parameters_);
writer->Write<int16_t>(ptr()->num_optional_parameters_);
writer->Write<uint32_t>(ptr()->kind_tag_);
+#if !defined(DART_PRECOMPILED_RUNTIME)
if (is_optimized) {
writer->Write<int32_t>(FLAG_optimization_counter_threshold);
} else {
@@ -777,6 +780,7 @@ void RawFunction::WriteTo(SnapshotWriter* writer,
writer->Write<int8_t>(ptr()->deoptimization_counter_);
writer->Write<uint16_t>(ptr()->optimized_instruction_count_);
writer->Write<uint16_t>(ptr()->optimized_call_site_count_);
+#endif
// Write out all the object pointer fields.
SnapshotWriterVisitor visitor(writer, kAsReference);
@@ -1542,7 +1546,7 @@ RawICData* ICData::ReadFrom(SnapshotReader* reader,
ICData& result = ICData::ZoneHandle(reader->zone(), ICData::New());
reader->AddBackRef(object_id, &result, kIsDeserialized);
- result.set_deopt_id(reader->Read<int32_t>());
+ NOT_IN_PRECOMPILED(result.set_deopt_id(reader->Read<int32_t>()));
result.set_state_bits(reader->Read<uint32_t>());
#if defined(TAG_IC_DATA)
result.set_tag(reader->Read<int16_t>());
@@ -1572,7 +1576,7 @@ void RawICData::WriteTo(SnapshotWriter* writer,
writer->WriteTags(writer->GetObjectTags(this));
// Write out all the non object fields.
- writer->Write<int32_t>(ptr()->deopt_id_);
+ NOT_IN_PRECOMPILED(writer->Write<int32_t>(ptr()->deopt_id_));
writer->Write<uint32_t>(ptr()->state_bits_);
#if defined(TAG_IC_DATA)
writer->Write<int16_t>(ptr()->tag_);
« runtime/vm/object.h ('K') | « runtime/vm/raw_object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698