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

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

Issue 2968003004: Revert "The current growth strategy for growable arrays allocates a backing array of size 2 at (emp… (Closed)
Patch Set: Created 3 years, 5 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 | « runtime/vm/object_test.cc ('k') | runtime/vm/parser.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/address_sanitizer.h" 7 #include "platform/address_sanitizer.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/compiler_stats.h" 9 #include "vm/compiler_stats.h"
10 #include "vm/gc_marker.h" 10 #include "vm/gc_marker.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 Heap::RegionName(heap_, is_exec ? Heap::kCode : Heap::kOld, vm_name, 282 Heap::RegionName(heap_, is_exec ? Heap::kCode : Heap::kOld, vm_name,
283 kVmNameSize); 283 kVmNameSize);
284 HeapPage* page = HeapPage::Allocate(page_size_in_words, type, vm_name); 284 HeapPage* page = HeapPage::Allocate(page_size_in_words, type, vm_name);
285 if (page == NULL) { 285 if (page == NULL) {
286 return NULL; 286 return NULL;
287 } 287 }
288 page->set_next(large_pages_); 288 page->set_next(large_pages_);
289 large_pages_ = page; 289 large_pages_ = page;
290 IncreaseCapacityInWords(page_size_in_words); 290 IncreaseCapacityInWords(page_size_in_words);
291 // Only one object in this page (at least until String::MakeExternal or 291 // Only one object in this page (at least until String::MakeExternal or
292 // Array::MakeFixedLength is called). 292 // Array::MakeArray is called).
293 page->set_object_end(page->object_start() + size); 293 page->set_object_end(page->object_start() + size);
294 return page; 294 return page;
295 } 295 }
296 296
297 297
298 void PageSpace::TruncateLargePage(HeapPage* page, 298 void PageSpace::TruncateLargePage(HeapPage* page,
299 intptr_t new_object_size_in_bytes) { 299 intptr_t new_object_size_in_bytes) {
300 const intptr_t old_object_size_in_bytes = 300 const intptr_t old_object_size_in_bytes =
301 page->object_end() - page->object_start(); 301 page->object_end() - page->object_start();
302 ASSERT(new_object_size_in_bytes <= old_object_size_in_bytes); 302 ASSERT(new_object_size_in_bytes <= old_object_size_in_bytes);
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 return 0; 1319 return 0;
1320 } else { 1320 } else {
1321 ASSERT(total_time >= gc_time); 1321 ASSERT(total_time >= gc_time);
1322 int result = static_cast<int>( 1322 int result = static_cast<int>(
1323 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100); 1323 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100);
1324 return result; 1324 return result;
1325 } 1325 }
1326 } 1326 }
1327 1327
1328 } // namespace dart 1328 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_test.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698