Chromium Code Reviews| Index: runtime/vm/scavenger.cc |
| =================================================================== |
| --- runtime/vm/scavenger.cc (revision 34144) |
| +++ runtime/vm/scavenger.cc (working copy) |
| @@ -671,6 +671,24 @@ |
| } |
| +RawObject* Scavenger::FindObject(FindObjectVisitor* visitor) const { |
| + ASSERT(!scavenging_); |
| + uword cur = FirstObjectStart(); |
| + if (visitor->VisitRange(cur, top_)) { |
| + while (cur < top_) { |
| + RawObject* raw_obj = RawObject::FromAddr(cur); |
| + uword next = cur + raw_obj->Size(); |
| + if (visitor->VisitRange(cur, next) && raw_obj->FindObject(visitor)) { |
| + return raw_obj; // Found object, return it. |
| + } |
| + cur = next; |
| + } |
| + ASSERT(cur == top_); |
| + } |
| + return Object::null(); |
| +} |
|
turnidge
2014/03/20 17:01:19
Ditto testing comment from heap.cc. Up to you.
koda
2014/03/20 20:25:37
I think it's sufficient to test it via heap_test.
|
| + |
| + |
| void Scavenger::Scavenge() { |
| // TODO(cshapiro): Add a decision procedure for determining when the |
| // the API callbacks should be invoked. |