Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1692)

Unified Diff: runtime/vm/scavenger.cc

Issue 11055007: Scavenge watched objects by scavenging their watchers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698