Chromium Code Reviews| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 } | 361 } |
| 362 } | 362 } |
| 363 visitor->set_update_store_buffers(false); | 363 visitor->set_update_store_buffers(false); |
| 364 } | 364 } |
| 365 | 365 |
| 366 | 366 |
| 367 void GCMarker::ProcessWeakProperty(RawWeakProperty* raw_weak, | 367 void GCMarker::ProcessWeakProperty(RawWeakProperty* raw_weak, |
| 368 MarkingVisitor* visitor) { | 368 MarkingVisitor* visitor) { |
| 369 // The fate of the weak property is determined by its key. | 369 // The fate of the weak property is determined by its key. |
| 370 RawObject* raw_key = raw_weak->ptr()->key_; | 370 RawObject* raw_key = raw_weak->ptr()->key_; |
| 371 if (!raw_key->IsMarked()) { | 371 if (raw_key->IsHeapObject() && |
|
cshapiro
2012/10/01 22:22:14
Can we use IsUnreachable instead of the explicit c
Ivan Posva
2012/10/01 22:27:39
Different CL.
| |
| 372 raw_key->IsOldObject() && | |
| 373 !raw_key->IsMarked()) { | |
| 372 // Key is white. Delay the weak property. | 374 // Key is white. Delay the weak property. |
| 373 visitor->DelayWeakProperty(raw_weak); | 375 visitor->DelayWeakProperty(raw_weak); |
| 374 } else { | 376 } else { |
| 375 // Key is gray or black. Make the weak property black. | 377 // Key is gray or black. Make the weak property black. |
| 376 raw_weak->VisitPointers(visitor); | 378 raw_weak->VisitPointers(visitor); |
| 377 } | 379 } |
| 378 } | 380 } |
| 379 | 381 |
| 380 | 382 |
| 381 void GCMarker::ProcessPeerReferents(PageSpace* page_space) { | 383 void GCMarker::ProcessPeerReferents(PageSpace* page_space) { |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 405 DrainMarkingStack(isolate, &mark); | 407 DrainMarkingStack(isolate, &mark); |
| 406 IterateWeakReferences(isolate, &mark); | 408 IterateWeakReferences(isolate, &mark); |
| 407 MarkingWeakVisitor mark_weak; | 409 MarkingWeakVisitor mark_weak; |
| 408 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); | 410 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); |
| 409 mark.Finalize(); | 411 mark.Finalize(); |
| 410 ProcessPeerReferents(page_space); | 412 ProcessPeerReferents(page_space); |
| 411 Epilogue(isolate, invoke_api_callbacks); | 413 Epilogue(isolate, invoke_api_callbacks); |
| 412 } | 414 } |
| 413 | 415 |
| 414 } // namespace dart | 416 } // namespace dart |
| OLD | NEW |