Chromium Code Reviews| Index: runtime/vm/scavenger.cc |
| diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc |
| index 9767e03c6760ecca0f233b057a1b4a3ccda67af5..0c2364a212f7fbc15a05d8a88d009392037c8f03 100644 |
| --- a/runtime/vm/scavenger.cc |
| +++ b/runtime/vm/scavenger.cc |
| @@ -122,18 +122,22 @@ class ScavengerVisitor : public ObjectPointerVisitor { |
| if (IsForwarding(header)) { |
| // Get the new location of the object. |
| new_addr = ForwardedAddr(header); |
| - } else { |
| - if (raw_obj->IsWatched()) { |
| - std::pair<DelaySet::iterator, DelaySet::iterator> ret; |
| - // Visit all elements with a key equal to raw_obj. |
| - ret = delay_set_.equal_range(raw_obj); |
| - for (DelaySet::iterator it = ret.first; it != ret.second; ++it) { |
| - // Visit through the associated WeakProperty at this time. |
| - it->second->VisitPointers(this); |
| - } |
| - delay_set_.erase(ret.first, ret.second); |
| - raw_obj->ClearWatchedBit(); |
| + } else if (raw_obj->IsWatched()) { |
| + // Forward the object by scavenging its watchers. |
|
Ivan Posva
2012/10/02 23:02:31
Can you add a comment here that we delayed visitin
cshapiro
2012/10/03 01:39:42
Done.
|
| + raw_obj->ClearWatchedBit(); |
| + std::pair<DelaySet::iterator, DelaySet::iterator> ret; |
| + // Visit all elements with a key equal to raw_obj. |
| + ret = delay_set_.equal_range(raw_obj); |
| + for (DelaySet::iterator it = ret.first; it != ret.second; ++it) { |
| + // Visit through the associated WeakProperty at this time. |
| + it->second->VisitPointers(this); |
| } |
| + delay_set_.erase(ret.first, ret.second); |
| + // Reread the header word to get the new location of the object. |
| + header = *reinterpret_cast<uword*>(raw_addr); |
| + ASSERT(IsForwarding(header)); |
| + new_addr = ForwardedAddr(header); |
| + } else { |
| intptr_t size = raw_obj->Size(); |
| // Check whether object should be promoted. |
| if (scavenger_->survivor_end_ <= raw_addr) { |