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

Unified Diff: src/objects-visiting-inl.h

Issue 203583007: Support weak heap references in the ConstantPool to support IsWeakObjectInOptimizedCode objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/objects-printer.cc ('k') | test/cctest/test-constantpool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-visiting-inl.h
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h
index 4f1498844dc496c4aed94996b0d509cccba1602e..9cd50c425ac9e3bc5849c92d6a1087e91f9030af 100644
--- a/src/objects-visiting-inl.h
+++ b/src/objects-visiting-inl.h
@@ -501,6 +501,14 @@ void StaticMarkingVisitor<StaticVisitor>::VisitConstantPoolArray(
StaticVisitor::VisitPointer(heap,
ulan 2014/03/19 08:50:00 IIUC, each heap object pointer in constant pool is
constant_pool->RawFieldOfElementAt(index));
}
+ for (int i = 0; i < constant_pool->count_of_weak_ptr_entries(); i++) {
+ int index = constant_pool->first_weak_ptr_index() + i;
+ Object** slot = constant_pool->RawFieldOfElementAt(index);
+ HeapObject* object = HeapObject::cast(*slot);
+ if (!object->IsCell()) {
+ heap->mark_compact_collector()->RecordSlot(slot, slot, object);
+ }
+ }
}
« no previous file with comments | « src/objects-printer.cc ('k') | test/cctest/test-constantpool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698