Commit 1a9df4ce authored by mlippautz's avatar mlippautz Committed by Commit bot

Reland of [heap] Simplify marking of JSFunction and SFI (patchset #1 id:1 of...

Reland of [heap] Simplify marking of JSFunction and SFI (patchset #1 id:1 of https://codereview.chromium.org/2389963007/ )

Reason for revert:
Wrong culprit as this was already broken before.

Original issue's description:
> 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
>
> Committed: https://crrev.com/5295d7a463cbcc78a4b694a7fb84af8e8e400303
> Cr-Commit-Position: refs/heads/master@{#39983}

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