Commit 807ae243 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Adjust assertions in UpdateSlot to match UpdatePointer in PointersUpdatingVisitor.

R=erik.corry@gmail.com
BUG=v8:1740

Review URL: http://codereview.chromium.org/8081001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent de7b222e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment