Refactor marking to share embedded pointer visitor.

R=ulan@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10826079

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12246 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7dd2e977
......@@ -175,15 +175,6 @@ class IncrementalMarkingMarkingVisitor
table_.Register(kVisitJSRegExp, &VisitJSRegExp);
}
static inline void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo) {
ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
Object* target = rinfo->target_object();
if (target->NonFailureIsHeapObject()) {
heap->mark_compact_collector()->RecordRelocSlot(rinfo, target);
MarkObject(heap, target);
}
}
static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) {
ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
......
......@@ -1078,15 +1078,6 @@ class MarkCompactMarkingVisitor
heap->mark_compact_collector()->MarkObject(object, mark);
}
static inline void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo) {
ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
// TODO(mstarzinger): We do not short-circuit cons strings here, verify
// that there can be no such embedded pointers and add assertion here.
HeapObject* object = HeapObject::cast(rinfo->target_object());
heap->mark_compact_collector()->RecordRelocSlot(rinfo, object);
MarkObject(heap, object);
}
static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) {
ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
......
......@@ -175,6 +175,17 @@ void StaticMarkingVisitor<StaticVisitor>::VisitCodeEntry(
}
template<typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer(
Heap* heap, RelocInfo* rinfo) {
ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
ASSERT(!rinfo->target_object()->IsConsString());
HeapObject* object = HeapObject::cast(rinfo->target_object());
heap->mark_compact_collector()->RecordRelocSlot(rinfo, object);
StaticVisitor::MarkObject(heap, object);
}
template<typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitGlobalPropertyCell(
Heap* heap, RelocInfo* rinfo) {
......
......@@ -387,6 +387,7 @@ class StaticMarkingVisitor : public StaticVisitorBase {
}
static inline void VisitCodeEntry(Heap* heap, Address entry_address);
static inline void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo);
static inline void VisitGlobalPropertyCell(Heap* heap, RelocInfo* rinfo);
static inline void VisitDebugTarget(Heap* heap, RelocInfo* rinfo);
static inline void VisitExternalReference(RelocInfo* rinfo) { }
......
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