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

Unified Diff: runtime/vm/object.cc

Issue 13406004: - Remember objects (not addresses) in the old generation containing new pointers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/vm/object.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 20732)
+++ runtime/vm/object.cc (working copy)
@@ -1201,20 +1201,26 @@
class StoreBufferUpdateVisitor : public ObjectPointerVisitor {
public:
- explicit StoreBufferUpdateVisitor(Isolate* isolate) :
- ObjectPointerVisitor(isolate) { }
+ explicit StoreBufferUpdateVisitor(Isolate* isolate, RawObject* obj) :
+ ObjectPointerVisitor(isolate), old_obj_(obj) {
+ ASSERT(old_obj_->IsOldObject());
+ }
void VisitPointers(RawObject** first, RawObject** last) {
for (RawObject** curr = first; curr <= last; ++curr) {
RawObject* raw_obj = *curr;
if (raw_obj->IsHeapObject() && raw_obj->IsNewObject()) {
- uword ptr = reinterpret_cast<uword>(curr);
+ uword ptr = reinterpret_cast<uword>(old_obj_);
isolate()->store_buffer()->AddPointer(ptr);
+ // Remembered this object. There is not need to continue searching.
siva 2013/04/02 20:20:22 no need ...
Ivan Posva 2013/04/02 23:23:11 Done.
Ivan Posva 2013/04/02 23:23:11 Done.
+ return;
}
}
}
private:
+ RawObject* old_obj_;
+
DISALLOW_COPY_AND_ASSIGN(StoreBufferUpdateVisitor);
};
@@ -1237,7 +1243,7 @@
NoGCScope no_gc;
memmove(raw_obj->ptr(), src.raw()->ptr(), size);
if (space == Heap::kOld) {
- StoreBufferUpdateVisitor visitor(Isolate::Current());
+ StoreBufferUpdateVisitor visitor(Isolate::Current(), raw_obj);
raw_obj->VisitPointers(&visitor);
}
return raw_obj;
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698