| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 bool Heap::OldContains(uword addr) const { | 171 bool Heap::OldContains(uword addr) const { |
| 172 return old_space_.Contains(addr); | 172 return old_space_.Contains(addr); |
| 173 } | 173 } |
| 174 | 174 |
| 175 | 175 |
| 176 bool Heap::CodeContains(uword addr) const { | 176 bool Heap::CodeContains(uword addr) const { |
| 177 return old_space_.Contains(addr, HeapPage::kExecutable); | 177 return old_space_.Contains(addr, HeapPage::kExecutable); |
| 178 } | 178 } |
| 179 | 179 |
| 180 | 180 |
| 181 bool Heap::DataContains(uword addr) const { |
| 182 return old_space_.DataContains(addr); |
| 183 } |
| 184 |
| 185 |
| 181 void Heap::VisitObjects(ObjectVisitor* visitor) const { | 186 void Heap::VisitObjects(ObjectVisitor* visitor) const { |
| 182 new_space_.VisitObjects(visitor); | 187 new_space_.VisitObjects(visitor); |
| 183 old_space_.VisitObjects(visitor); | 188 old_space_.VisitObjects(visitor); |
| 184 } | 189 } |
| 185 | 190 |
| 186 | 191 |
| 187 HeapIterationScope::HeapIterationScope(bool writable) | 192 HeapIterationScope::HeapIterationScope(bool writable) |
| 188 : StackResource(Thread::Current()), | 193 : StackResource(Thread::Current()), |
| 189 old_space_(isolate()->heap()->old_space()), | 194 old_space_(isolate()->heap()->old_space()), |
| 190 writable_(writable) { | 195 writable_(writable) { |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 Dart::vm_isolate()->heap()->WriteProtect(false); | 827 Dart::vm_isolate()->heap()->WriteProtect(false); |
| 823 } | 828 } |
| 824 | 829 |
| 825 | 830 |
| 826 WritableVMIsolateScope::~WritableVMIsolateScope() { | 831 WritableVMIsolateScope::~WritableVMIsolateScope() { |
| 827 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 832 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
| 828 Dart::vm_isolate()->heap()->WriteProtect(true); | 833 Dart::vm_isolate()->heap()->WriteProtect(true); |
| 829 } | 834 } |
| 830 | 835 |
| 831 } // namespace dart | 836 } // namespace dart |
| OLD | NEW |