| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/gc_marker.h" | 5 #include "vm/gc_marker.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 for (; it != delay_set_.end(); ++it) { | 157 for (; it != delay_set_.end(); ++it) { |
| 158 WeakProperty::Clear(it->second); | 158 WeakProperty::Clear(it->second); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 void set_update_store_buffers(bool val) { update_store_buffers_ = val; } | 162 void set_update_store_buffers(bool val) { update_store_buffers_ = val; } |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 void MarkAndPush(RawObject* raw_obj) { | 165 void MarkAndPush(RawObject* raw_obj) { |
| 166 ASSERT(raw_obj->IsHeapObject()); | 166 ASSERT(raw_obj->IsHeapObject()); |
| 167 ASSERT(page_space_->Contains(RawObject::ToAddr(raw_obj))); | 167 ASSERT((FLAG_verify_before_gc || FLAG_verify_before_gc) ? |
| 168 page_space_->Contains(RawObject::ToAddr(raw_obj)) : |
| 169 true); |
| 168 | 170 |
| 169 // Mark the object and push it on the marking stack. | 171 // Mark the object and push it on the marking stack. |
| 170 ASSERT(!raw_obj->IsMarked()); | 172 ASSERT(!raw_obj->IsMarked()); |
| 171 RawClass* raw_class = isolate()->class_table()->At(raw_obj->GetClassId()); | 173 RawClass* raw_class = isolate()->class_table()->At(raw_obj->GetClassId()); |
| 172 raw_obj->SetMarkBit(); | 174 raw_obj->SetMarkBit(); |
| 173 if (raw_obj->IsWatched()) { | 175 if (raw_obj->IsWatched()) { |
| 174 std::pair<DelaySet::iterator, DelaySet::iterator> ret; | 176 std::pair<DelaySet::iterator, DelaySet::iterator> ret; |
| 175 // Visit all elements with a key equal to raw_obj. | 177 // Visit all elements with a key equal to raw_obj. |
| 176 ret = delay_set_.equal_range(raw_obj); | 178 ret = delay_set_.equal_range(raw_obj); |
| 177 for (DelaySet::iterator it = ret.first; it != ret.second; ++it) { | 179 for (DelaySet::iterator it = ret.first; it != ret.second; ++it) { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 IterateRoots(isolate, &mark, !invoke_api_callbacks); | 388 IterateRoots(isolate, &mark, !invoke_api_callbacks); |
| 387 DrainMarkingStack(isolate, &mark); | 389 DrainMarkingStack(isolate, &mark); |
| 388 IterateWeakReferences(isolate, &mark); | 390 IterateWeakReferences(isolate, &mark); |
| 389 MarkingWeakVisitor mark_weak; | 391 MarkingWeakVisitor mark_weak; |
| 390 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); | 392 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); |
| 391 mark.Finalize(); | 393 mark.Finalize(); |
| 392 Epilogue(isolate, invoke_api_callbacks); | 394 Epilogue(isolate, invoke_api_callbacks); |
| 393 } | 395 } |
| 394 | 396 |
| 395 } // namespace dart | 397 } // namespace dart |
| OLD | NEW |