Commit 5295d7a4 authored by epertoso's avatar epertoso Committed by Commit bot

Revert of [heap] Simplify marking of JSFunction and SFI (patchset #3 id:40001...

Revert of [heap] Simplify marking of JSFunction and SFI (patchset #3 id:40001 of https://codereview.chromium.org/2389183002/ )

Reason for revert:
Broke GCStress.

Original issue's description:
> [heap] Simplify marking of JSFunction and SFI
>
> BUG=chromium:651828
>
> Committed: https://crrev.com/4d45ed4597d537cf9624cb6683dc4bd646d11242
> Cr-Commit-Position: refs/heads/master@{#39975}

TBR=hpayer@chromium.org,mlippautz@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:651828

Review-Url: https://codereview.chromium.org/2389963007
Cr-Commit-Position: refs/heads/master@{#39983}
parent 1cb133e3
...@@ -449,11 +449,11 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( ...@@ -449,11 +449,11 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
// optimized code. // optimized code.
collector->code_flusher()->AddCandidate(shared); collector->code_flusher()->AddCandidate(shared);
// Treat the reference to the code object weakly. // Treat the reference to the code object weakly.
VisitSharedFunctionInfoWeakCode(map, object); VisitSharedFunctionInfoWeakCode(heap, object);
return; return;
} }
} }
VisitSharedFunctionInfoStrongCode(map, object); VisitSharedFunctionInfoStrongCode(heap, object);
} }
...@@ -621,23 +621,39 @@ bool StaticMarkingVisitor<StaticVisitor>::IsFlushable( ...@@ -621,23 +621,39 @@ bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(
return true; return true;
} }
template <typename StaticVisitor> template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoStrongCode( void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoStrongCode(
Map* map, HeapObject* object) { Heap* heap, HeapObject* object) {
FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptor, Object** start_slot = HeapObject::RawField(
void>::Visit(map, object); object, SharedFunctionInfo::BodyDescriptor::kStartOffset);
Object** end_slot = HeapObject::RawField(
object, SharedFunctionInfo::BodyDescriptor::kEndOffset);
StaticVisitor::VisitPointers(heap, object, start_slot, end_slot);
} }
template <typename StaticVisitor> template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoWeakCode( void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoWeakCode(
Map* map, HeapObject* object) { Heap* heap, HeapObject* object) {
Object** name_slot =
HeapObject::RawField(object, SharedFunctionInfo::kNameOffset);
StaticVisitor::VisitPointer(heap, object, name_slot);
// Skip visiting kCodeOffset as it is treated weakly here. // Skip visiting kCodeOffset as it is treated weakly here.
STATIC_ASSERT(SharedFunctionInfo::kCodeOffset < STATIC_ASSERT(SharedFunctionInfo::kNameOffset + kPointerSize ==
SharedFunctionInfo::BodyDescriptorWeakCode::kStartOffset); SharedFunctionInfo::kCodeOffset);
FixedBodyVisitor<StaticVisitor, SharedFunctionInfo::BodyDescriptorWeakCode, STATIC_ASSERT(SharedFunctionInfo::kCodeOffset + kPointerSize ==
void>::Visit(map, object); SharedFunctionInfo::kOptimizedCodeMapOffset);
Object** start_slot =
HeapObject::RawField(object, SharedFunctionInfo::kOptimizedCodeMapOffset);
Object** end_slot = HeapObject::RawField(
object, SharedFunctionInfo::BodyDescriptor::kEndOffset);
StaticVisitor::VisitPointers(heap, object, start_slot, end_slot);
} }
template <typename StaticVisitor> template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitJSFunctionStrongCode( void StaticMarkingVisitor<StaticVisitor>::VisitJSFunctionStrongCode(
Map* map, HeapObject* object) { Map* map, HeapObject* object) {
......
...@@ -386,8 +386,8 @@ class StaticMarkingVisitor : public StaticVisitorBase { ...@@ -386,8 +386,8 @@ class StaticMarkingVisitor : public StaticVisitorBase {
// Helpers used by code flushing support that visit pointer fields and treat // Helpers used by code flushing support that visit pointer fields and treat
// references to code objects either strongly or weakly. // references to code objects either strongly or weakly.
static void VisitSharedFunctionInfoStrongCode(Map* map, HeapObject* object); static void VisitSharedFunctionInfoStrongCode(Heap* heap, HeapObject* object);
static void VisitSharedFunctionInfoWeakCode(Map* map, HeapObject* object); static void VisitSharedFunctionInfoWeakCode(Heap* heap, HeapObject* object);
static void VisitJSFunctionStrongCode(Map* map, HeapObject* object); static void VisitJSFunctionStrongCode(Map* map, HeapObject* object);
static void VisitJSFunctionWeakCode(Map* map, HeapObject* object); static void VisitJSFunctionWeakCode(Map* map, HeapObject* object);
......
...@@ -7543,9 +7543,9 @@ class SharedFunctionInfo: public HeapObject { ...@@ -7543,9 +7543,9 @@ class SharedFunctionInfo: public HeapObject {
// Layout description. // Layout description.
// Pointer fields. // Pointer fields.
static const int kCodeOffset = HeapObject::kHeaderSize; static const int kNameOffset = HeapObject::kHeaderSize;
static const int kNameOffset = kCodeOffset + kPointerSize; static const int kCodeOffset = kNameOffset + kPointerSize;
static const int kOptimizedCodeMapOffset = kNameOffset + kPointerSize; static const int kOptimizedCodeMapOffset = kCodeOffset + kPointerSize;
static const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize; static const int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize;
static const int kOuterScopeInfoOffset = kScopeInfoOffset + kPointerSize; static const int kOuterScopeInfoOffset = kScopeInfoOffset + kPointerSize;
static const int kConstructStubOffset = kOuterScopeInfoOffset + kPointerSize; static const int kConstructStubOffset = kOuterScopeInfoOffset + kPointerSize;
...@@ -7670,12 +7670,9 @@ class SharedFunctionInfo: public HeapObject { ...@@ -7670,12 +7670,9 @@ class SharedFunctionInfo: public HeapObject {
static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize);
typedef FixedBodyDescriptor<kCodeOffset,
kLastPointerFieldOffset + kPointerSize, kSize>
BodyDescriptor;
typedef FixedBodyDescriptor<kNameOffset, typedef FixedBodyDescriptor<kNameOffset,
kLastPointerFieldOffset + kPointerSize, kSize> kLastPointerFieldOffset + kPointerSize,
BodyDescriptorWeakCode; kSize> BodyDescriptor;
// Bit positions in start_position_and_type. // Bit positions in start_position_and_type.
// The source code start position is in the 30 most significant bits of // The source code start position is in the 30 most significant bits of
......
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