| 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 : new_space_(this, max_new_gen_semi_words, kNewObjectAlignmentOffset), | 50 : isolate_(isolate), |
| 51 new_space_(this, max_new_gen_semi_words, kNewObjectAlignmentOffset), |
| 51 old_space_(this, max_old_gen_words, max_external_words), | 52 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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 Dart::vm_isolate()->heap()->WriteProtect(false); | 781 Dart::vm_isolate()->heap()->WriteProtect(false); |
| 782 } | 782 } |
| 783 | 783 |
| 784 | 784 |
| 785 WritableVMIsolateScope::~WritableVMIsolateScope() { | 785 WritableVMIsolateScope::~WritableVMIsolateScope() { |
| 786 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 786 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
| 787 Dart::vm_isolate()->heap()->WriteProtect(true); | 787 Dart::vm_isolate()->heap()->WriteProtect(true); |
| 788 } | 788 } |
| 789 | 789 |
| 790 } // namespace dart | 790 } // namespace dart |
| OLD | NEW |