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
This commit is contained in:
mstarzinger@chromium.org 2012-08-01 11:29:48 +00:00
parent 7dd2e9777c
commit d4e6aa33fc
4 changed files with 12 additions and 18 deletions

View File

@ -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());

View File

@ -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());

View File

@ -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) {

View File

@ -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) { }