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 16 matching lines...) Expand all Loading... |
27 namespace dart { | 27 namespace dart { |
28 | 28 |
29 DEFINE_FLAG(bool, disable_alloc_stubs_after_gc, false, "Stress testing flag."); | 29 DEFINE_FLAG(bool, disable_alloc_stubs_after_gc, false, "Stress testing flag."); |
30 DEFINE_FLAG(bool, gc_at_alloc, false, "GC at every allocation."); | 30 DEFINE_FLAG(bool, gc_at_alloc, false, "GC at every allocation."); |
31 DEFINE_FLAG(int, new_gen_ext_limit, 64, | 31 DEFINE_FLAG(int, new_gen_ext_limit, 64, |
32 "maximum total external size (MB) in new gen before triggering GC"); | 32 "maximum total external size (MB) in new gen before triggering GC"); |
33 DEFINE_FLAG(int, pretenure_interval, 10, | 33 DEFINE_FLAG(int, pretenure_interval, 10, |
34 "Back off pretenuring after this many cycles."); | 34 "Back off pretenuring after this many cycles."); |
35 DEFINE_FLAG(int, pretenure_threshold, 98, | 35 DEFINE_FLAG(int, pretenure_threshold, 98, |
36 "Trigger pretenuring when this many percent are promoted."); | 36 "Trigger pretenuring when this many percent are promoted."); |
37 DEFINE_FLAG(bool, verbose_gc, false, "Enables verbose GC."); | |
38 DEFINE_FLAG(int, verbose_gc_hdr, 40, "Print verbose GC header interval."); | 37 DEFINE_FLAG(int, verbose_gc_hdr, 40, "Print verbose GC header interval."); |
39 DEFINE_FLAG(bool, verify_after_gc, false, | 38 DEFINE_FLAG(bool, verify_after_gc, false, |
40 "Enables heap verification after GC."); | 39 "Enables heap verification after GC."); |
41 DEFINE_FLAG(bool, verify_before_gc, false, | 40 DEFINE_FLAG(bool, verify_before_gc, false, |
42 "Enables heap verification before GC."); | 41 "Enables heap verification before GC."); |
43 DEFINE_FLAG(bool, pretenure_all, false, "Global pretenuring (for testing)."); | |
44 | 42 |
45 | 43 |
46 Heap::Heap(Isolate* isolate, | 44 Heap::Heap(Isolate* isolate, |
47 intptr_t max_new_gen_semi_words, | 45 intptr_t max_new_gen_semi_words, |
48 intptr_t max_old_gen_words, | 46 intptr_t max_old_gen_words, |
49 intptr_t max_external_words) | 47 intptr_t max_external_words) |
50 : isolate_(isolate), | 48 : isolate_(isolate), |
51 new_space_(this, max_new_gen_semi_words, kNewObjectAlignmentOffset), | 49 new_space_(this, max_new_gen_semi_words, kNewObjectAlignmentOffset), |
52 old_space_(this, max_old_gen_words, max_external_words), | 50 old_space_(this, max_old_gen_words, max_external_words), |
53 read_only_(false), | 51 read_only_(false), |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); | 842 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); |
845 } | 843 } |
846 | 844 |
847 | 845 |
848 WritableVMIsolateScope::~WritableVMIsolateScope() { | 846 WritableVMIsolateScope::~WritableVMIsolateScope() { |
849 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 847 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
850 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); | 848 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); |
851 } | 849 } |
852 | 850 |
853 } // namespace dart | 851 } // namespace dart |
OLD | NEW |