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

Unified Diff: src/mark-compact.cc

Issue 117483002: Make cells pointing to JSObjects weak in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Set number of gcs to 4 Created 6 years, 11 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/lithium-codegen.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index db28ac343fa7a1934d28c6898fb978dcec0c96d0..c7e98b7bab704c79eb6889437fe260644fdc9604 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -98,6 +98,14 @@ class VerifyMarkingVisitor: public ObjectVisitor {
}
}
+ void VisitCell(RelocInfo* rinfo) {
+ Code* code = rinfo->host();
+ ASSERT(rinfo->rmode() == RelocInfo::CELL);
+ if (!Code::IsWeakEmbeddedObject(code->kind(), rinfo->target_cell())) {
+ ObjectVisitor::VisitCell(rinfo);
+ }
+ }
+
private:
Heap* heap_;
};
@@ -2551,6 +2559,16 @@ void MarkCompactCollector::ClearNonLiveReferences() {
if (!table->IsKey(key)) continue;
uint32_t value_index = table->EntryToValueIndex(i);
Object* value = table->get(value_index);
+ if (key->IsCell() && !IsMarked(key)) {
+ Cell* cell = Cell::cast(key);
+ Object* object = cell->value();
+ if (IsMarked(object)) {
+ MarkBit mark = Marking::MarkBitFrom(cell);
+ SetMark(cell, mark);
+ Object** value_slot = HeapObject::RawField(cell, Cell::kValueOffset);
+ RecordSlot(value_slot, value_slot, *value_slot);
+ }
+ }
if (IsMarked(key)) {
if (!IsMarked(value)) {
HeapObject* obj = HeapObject::cast(value);
« no previous file with comments | « src/lithium-codegen.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698