[heap] Remove unnecessary marking specializations

R=hpayer@chromium.org
BUG=chromium:651828

Review-Url: https://codereview.chromium.org/2377203003
Cr-Commit-Position: refs/heads/master@{#39917}
This commit is contained in:
mlippautz 2016-09-30 06:57:27 -07:00 committed by Commit bot
parent db8dcd1a22
commit a5dfdb755d
5 changed files with 25 additions and 57 deletions

View File

@ -179,7 +179,6 @@ class IncrementalMarkingMarkingVisitor
StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize();
table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental); table_.Register(kVisitFixedArray, &VisitFixedArrayIncremental);
table_.Register(kVisitNativeContext, &VisitNativeContextIncremental); table_.Register(kVisitNativeContext, &VisitNativeContextIncremental);
table_.Register(kVisitJSRegExp, &VisitJSRegExp);
} }
static const int kProgressBarScanningChunk = 32 * 1024; static const int kProgressBarScanningChunk = 32 * 1024;

View File

@ -1246,7 +1246,7 @@ class MarkCompactMarkingVisitor
Heap* heap = map->GetHeap(); Heap* heap = map->GetHeap();
MarkCompactCollector* collector = heap->mark_compact_collector(); MarkCompactCollector* collector = heap->mark_compact_collector();
if (!collector->is_code_flushing_enabled()) { if (!collector->is_code_flushing_enabled()) {
VisitJSRegExp(map, object); JSObjectVisitor::Visit(map, object);
return; return;
} }
JSRegExp* re = reinterpret_cast<JSRegExp*>(object); JSRegExp* re = reinterpret_cast<JSRegExp*>(object);
@ -1254,7 +1254,7 @@ class MarkCompactMarkingVisitor
UpdateRegExpCodeAgeAndFlush(heap, re, true); UpdateRegExpCodeAgeAndFlush(heap, re, true);
UpdateRegExpCodeAgeAndFlush(heap, re, false); UpdateRegExpCodeAgeAndFlush(heap, re, false);
// Visit the fields of the RegExp, including the updated FixedArray. // Visit the fields of the RegExp, including the updated FixedArray.
VisitJSRegExp(map, object); JSObjectVisitor::Visit(map, object);
} }
}; };

View File

@ -147,11 +147,17 @@ void StaticMarkingVisitor<StaticVisitor>::Initialize() {
table_.Register(kVisitNativeContext, &VisitNativeContext); table_.Register(kVisitNativeContext, &VisitNativeContext);
table_.Register(kVisitAllocationSite, &VisitAllocationSite); table_.Register(
kVisitAllocationSite,
&FixedBodyVisitor<StaticVisitor, AllocationSite::MarkingBodyDescriptor,
void>::Visit);
table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); table_.Register(kVisitByteArray, &DataObjectVisitor::Visit);
table_.Register(kVisitBytecodeArray, &VisitBytecodeArray); table_.Register(
kVisitBytecodeArray,
&FixedBodyVisitor<StaticVisitor, BytecodeArray::MarkingBodyDescriptor,
void>::Visit);
table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit);
@ -178,13 +184,15 @@ void StaticMarkingVisitor<StaticVisitor>::Initialize() {
&FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, &FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor,
void>::Visit); void>::Visit);
// Registration for kVisitJSRegExp is done by StaticVisitor. table_.Register(kVisitJSRegExp, &JSObjectVisitor::Visit);
table_.Register( table_.Register(
kVisitCell, kVisitCell,
&FixedBodyVisitor<StaticVisitor, Cell::BodyDescriptor, void>::Visit); &FixedBodyVisitor<StaticVisitor, Cell::BodyDescriptor, void>::Visit);
table_.Register(kVisitPropertyCell, &VisitPropertyCell); table_.Register(kVisitPropertyCell,
&FixedBodyVisitor<StaticVisitor, PropertyCell::BodyDescriptor,
void>::Visit);
table_.Register(kVisitWeakCell, &VisitWeakCell); table_.Register(kVisitWeakCell, &VisitWeakCell);
@ -319,19 +327,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitMap(Map* map,
} }
} }
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitPropertyCell(
Map* map, HeapObject* object) {
Heap* heap = map->GetHeap();
StaticVisitor::VisitPointers(
heap, object,
HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset),
HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset));
}
template <typename StaticVisitor> template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map, void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map,
HeapObject* object) { HeapObject* object) {
@ -384,19 +379,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitTransitionArray(
} }
} }
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite(
Map* map, HeapObject* object) {
Heap* heap = map->GetHeap();
StaticVisitor::VisitPointers(
heap, object,
HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset),
HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset));
}
template <typename StaticVisitor> template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitWeakCollection( void StaticMarkingVisitor<StaticVisitor>::VisitWeakCollection(
Map* map, HeapObject* object) { Map* map, HeapObject* object) {
@ -504,23 +486,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(Map* map,
VisitJSFunctionStrongCode(map, object); VisitJSFunctionStrongCode(map, object);
} }
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp(Map* map,
HeapObject* object) {
JSObjectVisitor::Visit(map, object);
}
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray(
Map* map, HeapObject* object) {
StaticVisitor::VisitPointers(
map->GetHeap(), object,
HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset),
HeapObject::RawField(object, BytecodeArray::kFrameSizeOffset));
}
template <typename StaticVisitor> template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap, void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(Heap* heap,
Map* map) { Map* map) {

View File

@ -354,7 +354,6 @@ class StaticMarkingVisitor : public StaticVisitorBase {
table_.GetVisitor(map)(map, obj); table_.GetVisitor(map)(map, obj);
} }
INLINE(static void VisitPropertyCell(Map* map, HeapObject* object));
INLINE(static void VisitWeakCell(Map* map, HeapObject* object)); INLINE(static void VisitWeakCell(Map* map, HeapObject* object));
INLINE(static void VisitTransitionArray(Map* map, HeapObject* object)); INLINE(static void VisitTransitionArray(Map* map, HeapObject* object));
INLINE(static void VisitCodeEntry(Heap* heap, HeapObject* object, INLINE(static void VisitCodeEntry(Heap* heap, HeapObject* object,
@ -374,12 +373,9 @@ class StaticMarkingVisitor : public StaticVisitorBase {
INLINE(static void VisitMap(Map* map, HeapObject* object)); INLINE(static void VisitMap(Map* map, HeapObject* object));
INLINE(static void VisitCode(Map* map, HeapObject* object)); INLINE(static void VisitCode(Map* map, HeapObject* object));
INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object));
INLINE(static void VisitAllocationSite(Map* map, HeapObject* object));
INLINE(static void VisitWeakCollection(Map* map, HeapObject* object)); INLINE(static void VisitWeakCollection(Map* map, HeapObject* object));
INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); INLINE(static void VisitJSFunction(Map* map, HeapObject* object));
INLINE(static void VisitJSRegExp(Map* map, HeapObject* object));
INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); INLINE(static void VisitNativeContext(Map* map, HeapObject* object));
INLINE(static void VisitBytecodeArray(Map* map, HeapObject* object));
// Mark pointers in a Map treating some elements of the descriptor array weak. // Mark pointers in a Map treating some elements of the descriptor array weak.
static void MarkMapContents(Heap* heap, Map* map); static void MarkMapContents(Heap* heap, Map* map);

View File

@ -4858,6 +4858,13 @@ class BytecodeArray : public FixedArrayBase {
// Maximal length of a single BytecodeArray. // Maximal length of a single BytecodeArray.
static const int kMaxLength = kMaxSize - kHeaderSize; static const int kMaxLength = kMaxSize - kHeaderSize;
static const int kPointerFieldsBeginOffset = kConstantPoolOffset;
static const int kPointerFieldsEndOffset = kFrameSizeOffset;
typedef FixedBodyDescriptor<kPointerFieldsBeginOffset,
kPointerFieldsEndOffset, kHeaderSize>
MarkingBodyDescriptor;
class BodyDescriptor; class BodyDescriptor;
private: private:
@ -8920,6 +8927,10 @@ class AllocationSite: public Struct {
static const int kPointerFieldsBeginOffset = kTransitionInfoOffset; static const int kPointerFieldsBeginOffset = kTransitionInfoOffset;
static const int kPointerFieldsEndOffset = kWeakNextOffset; static const int kPointerFieldsEndOffset = kWeakNextOffset;
typedef FixedBodyDescriptor<kPointerFieldsBeginOffset,
kPointerFieldsEndOffset, kSize>
MarkingBodyDescriptor;
// For other visitors, use the fixed body descriptor below. // For other visitors, use the fixed body descriptor below.
typedef FixedBodyDescriptor<HeapObject::kHeaderSize, kSize, kSize> typedef FixedBodyDescriptor<HeapObject::kHeaderSize, kSize, kSize>
BodyDescriptor; BodyDescriptor;
@ -10170,9 +10181,6 @@ class PropertyCell : public HeapObject {
static const int kDependentCodeOffset = kValueOffset + kPointerSize; static const int kDependentCodeOffset = kValueOffset + kPointerSize;
static const int kSize = kDependentCodeOffset + kPointerSize; static const int kSize = kDependentCodeOffset + kPointerSize;
static const int kPointerFieldsBeginOffset = kValueOffset;
static const int kPointerFieldsEndOffset = kSize;
typedef FixedBodyDescriptor<kValueOffset, typedef FixedBodyDescriptor<kValueOffset,
kSize, kSize,
kSize> BodyDescriptor; kSize> BodyDescriptor;