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

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

Issue 329163003: Grow new gen (1M -> 4M -> 16M on 32-bit) when there is little garbage. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/scavenger.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) 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/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 15 matching lines...) Expand all
26 DEFINE_FLAG(int, verbose_gc_hdr, 40, "Print verbose GC header interval."); 26 DEFINE_FLAG(int, verbose_gc_hdr, 40, "Print verbose GC header interval.");
27 DEFINE_FLAG(bool, verify_before_gc, false, 27 DEFINE_FLAG(bool, verify_before_gc, false,
28 "Enables heap verification before GC."); 28 "Enables heap verification before GC.");
29 DEFINE_FLAG(bool, verify_after_gc, false, 29 DEFINE_FLAG(bool, verify_after_gc, false,
30 "Enables heap verification after GC."); 30 "Enables heap verification after GC.");
31 DEFINE_FLAG(bool, gc_at_alloc, false, "GC at every allocation."); 31 DEFINE_FLAG(bool, gc_at_alloc, false, "GC at every allocation.");
32 DEFINE_FLAG(int, new_gen_ext_limit, 64, 32 DEFINE_FLAG(int, new_gen_ext_limit, 64,
33 "maximum total external size (MB) in new gen before triggering GC"); 33 "maximum total external size (MB) in new gen before triggering GC");
34 34
35 Heap::Heap(Isolate* isolate, 35 Heap::Heap(Isolate* isolate,
36 intptr_t max_new_gen_words, 36 intptr_t max_new_gen_semi_words,
37 intptr_t max_old_gen_words) 37 intptr_t max_old_gen_words)
38 : isolate_(isolate), read_only_(false), gc_in_progress_(false) { 38 : isolate_(isolate), read_only_(false), gc_in_progress_(false) {
39 for (int sel = 0; 39 for (int sel = 0;
40 sel < kNumWeakSelectors; 40 sel < kNumWeakSelectors;
41 sel++) { 41 sel++) {
42 new_weak_tables_[sel] = new WeakTable(); 42 new_weak_tables_[sel] = new WeakTable();
43 old_weak_tables_[sel] = new WeakTable(); 43 old_weak_tables_[sel] = new WeakTable();
44 } 44 }
45 new_space_ = new Scavenger(this, 45 new_space_ = new Scavenger(this,
46 max_new_gen_words, 46 max_new_gen_semi_words,
47 kNewObjectAlignmentOffset); 47 kNewObjectAlignmentOffset);
48 old_space_ = new PageSpace(this, max_old_gen_words); 48 old_space_ = new PageSpace(this, max_old_gen_words);
49 stats_.num_ = 0; 49 stats_.num_ = 0;
50 } 50 }
51 51
52 52
53 Heap::~Heap() { 53 Heap::~Heap() {
54 delete new_space_; 54 delete new_space_;
55 delete old_space_; 55 delete old_space_;
56 for (int sel = 0; 56 for (int sel = 0;
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 heap->DisableGrowthControl(); 578 heap->DisableGrowthControl();
579 } 579 }
580 580
581 581
582 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { 582 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() {
583 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); 583 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
584 heap->SetGrowthControlState(current_growth_controller_state_); 584 heap->SetGrowthControlState(current_growth_controller_state_);
585 } 585 }
586 586
587 } // namespace dart 587 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698