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

Unified Diff: vm/scavenger.cc

Issue 11038004: - WeakProperty keys in other generations are black. Avoid trying to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 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
« vm/object_test.cc ('K') | « vm/object_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/scavenger.cc
===================================================================
--- vm/scavenger.cc (revision 13085)
+++ vm/scavenger.cc (working copy)
@@ -499,16 +499,17 @@
ScavengerVisitor* visitor) {
// The fate of the weak property is determined by its key.
RawObject* raw_key = raw_weak->ptr()->key_;
- uword raw_addr = RawObject::ToAddr(raw_key);
- uword header = *reinterpret_cast<uword*>(raw_addr);
- if (!IsForwarding(header)) {
- // Key is white. Delay the weak property.
- visitor->DelayWeakProperty(raw_weak);
- return raw_weak->Size();
- } else {
- // Key is gray or black. Make the weak property black.
- return raw_weak->VisitPointers(visitor);
+ if (raw_key->IsHeapObject() && raw_key->IsNewObject()) {
+ uword raw_addr = RawObject::ToAddr(raw_key);
+ uword header = *reinterpret_cast<uword*>(raw_addr);
+ if (!IsForwarding(header)) {
+ // Key is white. Delay the weak property.
+ visitor->DelayWeakProperty(raw_weak);
+ return raw_weak->Size();
+ }
}
+ // Key is gray or black. Make the weak property black.
+ return raw_weak->VisitPointers(visitor);
}
« vm/object_test.cc ('K') | « vm/object_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698