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

Side by Side Diff: runtime/vm/clustered_snapshot.cc

Issue 2916173002: Avoid allocating a whole new page for two one-element arrays when finalizing the VM isolate. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/pages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/clustered_snapshot.h" 5 #include "vm/clustered_snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 5284 matching lines...) Expand 10 before | Expand all | Expand 10 after
5295 5295
5296 #if defined(DEBUG) 5296 #if defined(DEBUG)
5297 int32_t section_marker = Read<int32_t>(); 5297 int32_t section_marker = Read<int32_t>();
5298 ASSERT(section_marker == kSectionMarker); 5298 ASSERT(section_marker == kSectionMarker);
5299 #endif 5299 #endif
5300 5300
5301 refs = refs_; 5301 refs = refs_;
5302 refs_ = NULL; 5302 refs_ = NULL;
5303 } 5303 }
5304 5304
5305 // Move remaining bump allocation space to the freelist so it used by C++
5306 // allocations (e.g., FinalizeVMIsolate) before allocating new pages.
5307 heap_->old_space()->AbandonBumpAllocation();
5308
5305 Symbols::InitOnceFromSnapshot(isolate()); 5309 Symbols::InitOnceFromSnapshot(isolate());
5306 5310
5307 Object::set_vm_isolate_snapshot_object_table(refs); 5311 Object::set_vm_isolate_snapshot_object_table(refs);
5308 5312
5309 #if defined(DEBUG) 5313 #if defined(DEBUG)
5310 isolate()->ValidateClassTable(); 5314 isolate()->ValidateClassTable();
5311 #endif 5315 #endif
5312 } 5316 }
5313 5317
5314 void Deserializer::ReadIsolateSnapshot(ObjectStore* object_store) { 5318 void Deserializer::ReadIsolateSnapshot(ObjectStore* object_store) {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
5635 thread_->isolate()->SetupImagePage(data_buffer_, 5639 thread_->isolate()->SetupImagePage(data_buffer_,
5636 /* is_executable */ false); 5640 /* is_executable */ false);
5637 } 5641 }
5638 5642
5639 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); 5643 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store());
5640 5644
5641 return ApiError::null(); 5645 return ApiError::null();
5642 } 5646 }
5643 5647
5644 } // namespace dart 5648 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698