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

Unified Diff: src/mark-compact.cc

Issue 8081001: Adjust assertions in UpdateSlot to match UpdatePointer in PointersUpdatingVisitor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
« no previous file with comments | « no previous file | no next file » | 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 27e37636f2b71b242ddb0ab333b59052396d5a58..6fb6d65a390c3c5d11ca9212886d365afe7412b8 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -2467,22 +2467,30 @@ class PointersUpdatingVisitor: public ObjectVisitor {
rinfo->set_call_address(Code::cast(target)->instruction_start());
}
- private:
- inline void UpdatePointer(Object** p) {
- if (!(*p)->IsHeapObject()) return;
+ static inline void UpdateSlot(Heap* heap, Object** slot) {
+ Object* obj = *slot;
+
+ if (!obj->IsHeapObject()) return;
- HeapObject* obj = HeapObject::cast(*p);
+ HeapObject* heap_obj = HeapObject::cast(obj);
- MapWord map_word = obj->map_word();
+ MapWord map_word = heap_obj->map_word();
if (map_word.IsForwardingAddress()) {
- ASSERT(heap_->InFromSpace(obj) ||
- MarkCompactCollector::IsOnEvacuationCandidate(obj));
- *p = obj->map_word().ToForwardingAddress();
- ASSERT(!heap_->InFromSpace(*p) &&
- !MarkCompactCollector::IsOnEvacuationCandidate(*p));
+ ASSERT(heap->InFromSpace(heap_obj) ||
+ MarkCompactCollector::IsOnEvacuationCandidate(heap_obj));
+ HeapObject* target = map_word.ToForwardingAddress();
+ *slot = target;
+ ASSERT(!heap->InFromSpace(target) &&
+ !MarkCompactCollector::IsOnEvacuationCandidate(target));
}
}
+ private:
+
+ inline void UpdatePointer(Object** p) {
+ UpdateSlot(heap_, p);
+ }
+
Heap* heap_;
};
@@ -2726,21 +2734,6 @@ class EvacuationWeakObjectRetainer : public WeakObjectRetainer {
};
-static inline void UpdateSlot(Object** slot) {
- Object* obj = *slot;
- if (!obj->IsHeapObject()) return;
-
- HeapObject* heap_obj = HeapObject::cast(obj);
-
- MapWord map_word = heap_obj->map_word();
- if (map_word.IsForwardingAddress()) {
- ASSERT(MarkCompactCollector::IsOnEvacuationCandidate(*slot));
- *slot = map_word.ToForwardingAddress();
- ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(*slot));
- }
-}
-
-
static inline void UpdateSlot(ObjectVisitor* v,
SlotsBuffer::SlotType slot_type,
Address addr) {
@@ -3757,7 +3750,7 @@ void SlotsBuffer::UpdateSlots(Heap* heap) {
for (int slot_idx = 0; slot_idx < idx_; ++slot_idx) {
ObjectSlot slot = slots_[slot_idx];
if (!IsTypedSlot(slot)) {
- UpdateSlot(slot);
+ PointersUpdatingVisitor::UpdateSlot(heap, slot);
} else {
++slot_idx;
ASSERT(slot_idx < idx_);
@@ -3776,7 +3769,7 @@ void SlotsBuffer::UpdateSlotsWithFilter(Heap* heap) {
ObjectSlot slot = slots_[slot_idx];
if (!IsTypedSlot(slot)) {
if (!IsOnInvalidatedCodeObject(reinterpret_cast<Address>(slot))) {
- UpdateSlot(slot);
+ PointersUpdatingVisitor::UpdateSlot(heap, slot);
}
} else {
++slot_idx;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698