OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 "Enables heap verification after GC."); | 40 "Enables heap verification after GC."); |
41 DEFINE_FLAG(bool, verify_before_gc, false, | 41 DEFINE_FLAG(bool, verify_before_gc, false, |
42 "Enables heap verification before GC."); | 42 "Enables heap verification before GC."); |
43 DEFINE_FLAG(bool, pretenure_all, false, "Global pretenuring (for testing)."); | 43 DEFINE_FLAG(bool, pretenure_all, false, "Global pretenuring (for testing)."); |
44 | 44 |
45 | 45 |
46 Heap::Heap(Isolate* isolate, | 46 Heap::Heap(Isolate* isolate, |
47 intptr_t max_new_gen_semi_words, | 47 intptr_t max_new_gen_semi_words, |
48 intptr_t max_old_gen_words, | 48 intptr_t max_old_gen_words, |
49 intptr_t max_external_words) | 49 intptr_t max_external_words) |
50 : isolate_(isolate), | 50 : new_space_(this, max_new_gen_semi_words, kNewObjectAlignmentOffset), |
51 new_space_(this, max_new_gen_semi_words, kNewObjectAlignmentOffset), | |
52 old_space_(this, max_old_gen_words, max_external_words), | 51 old_space_(this, max_old_gen_words, max_external_words), |
| 52 isolate_(isolate), |
53 read_only_(false), | 53 read_only_(false), |
54 gc_in_progress_(false), | 54 gc_in_progress_(false), |
55 pretenure_policy_(0) { | 55 pretenure_policy_(0) { |
56 for (int sel = 0; | 56 for (int sel = 0; |
57 sel < kNumWeakSelectors; | 57 sel < kNumWeakSelectors; |
58 sel++) { | 58 sel++) { |
59 new_weak_tables_[sel] = new WeakTable(); | 59 new_weak_tables_[sel] = new WeakTable(); |
60 old_weak_tables_[sel] = new WeakTable(); | 60 old_weak_tables_[sel] = new WeakTable(); |
61 } | 61 } |
62 stats_.num_ = 0; | 62 stats_.num_ = 0; |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 heap->DisableGrowthControl(); | 773 heap->DisableGrowthControl(); |
774 } | 774 } |
775 | 775 |
776 | 776 |
777 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { | 777 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { |
778 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 778 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
779 heap->SetGrowthControlState(current_growth_controller_state_); | 779 heap->SetGrowthControlState(current_growth_controller_state_); |
780 } | 780 } |
781 | 781 |
782 } // namespace dart | 782 } // namespace dart |
OLD | NEW |