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

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

Issue 17895004: Add DependentCode to PropertyCells (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove stray changes Created 7 years, 6 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
Index: src/objects-visiting-inl.h
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h
index 46ca0b10ca6219d9b49e8fe08d20241cad400087..0d15cae485149690650b617c1d4fc64006777655 100644
--- a/src/objects-visiting-inl.h
+++ b/src/objects-visiting-inl.h
@@ -221,10 +221,7 @@ void StaticMarkingVisitor<StaticVisitor>::Initialize() {
Cell::BodyDescriptor,
void>::Visit);
- table_.Register(kVisitPropertyCell,
- &FixedBodyVisitor<StaticVisitor,
- PropertyCell::BodyDescriptor,
- void>::Visit);
+ table_.Register(kVisitPropertyCell, &VisitPropertyCell);
table_.template RegisterSpecializations<DataObjectVisitor,
kVisitDataObject,
@@ -359,6 +356,27 @@ void StaticMarkingVisitor<StaticVisitor>::VisitMap(
template<typename StaticVisitor>
+void StaticMarkingVisitor<StaticVisitor>::VisitPropertyCell(
+ Map* map, HeapObject* object) {
+ Heap* heap = map->GetHeap();
+
+ // Mark property cell dependent codes array but do not push it onto marking
+ // stack, this will make references from it weak. We will clean dead
+ // codes when we iterate over property cells in
+ // ClearNonLivePropertyCellCodeDependencies.
Michael Starzinger 2013/06/26 15:23:31 nit: Comment is outdated, the function is called C
Michael Starzinger 2013/06/26 15:32:04 Also the cleanup pass is only done with FLAG_colle
danno 2013/06/26 15:42:40 Done.
danno 2013/06/26 15:42:40 Done.
+ Object** slot =
+ HeapObject::RawField(object, PropertyCell::kDependentCodeOffset);
+ HeapObject* obj = HeapObject::cast(*slot);
+ heap->mark_compact_collector()->RecordSlot(slot, slot, obj);
+ StaticVisitor::MarkObjectWithoutPush(heap, obj);
+
+ StaticVisitor::VisitPointers(heap,
+ HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset),
+ HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset));
+}
+
+
+template<typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitCode(
Map* map, HeapObject* object) {
Heap* heap = map->GetHeap();

Powered by Google App Engine
This is Rietveld 408576698