Commit ed172d31 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

heap: Trivial ThreadState cleanups

Bug: 982754
Change-Id: I68592a4110322c5d53af343f7d7bf45bf027702e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776019
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691569}
parent 74dbf0fe
......@@ -69,7 +69,7 @@ class ResurrectingPreFinalizer
} // namespace
TEST_F(MarkingVerifierDeathTest, DiesOnResurrectedMember) {
if (!ThreadState::Current()->VerifyMarkingEnabled())
if (!ThreadState::Current()->IsVerifyMarkingEnabled())
return;
Persistent<ResurrectingPreFinalizer::GlobalStorage> storage(
......@@ -82,7 +82,7 @@ TEST_F(MarkingVerifierDeathTest, DiesOnResurrectedMember) {
}
TEST_F(MarkingVerifierDeathTest, DiesOnResurrectedWeakMember) {
if (!ThreadState::Current()->VerifyMarkingEnabled())
if (!ThreadState::Current()->IsVerifyMarkingEnabled())
return;
Persistent<ResurrectingPreFinalizer::GlobalStorage> storage(
......
......@@ -1724,7 +1724,7 @@ bool ThreadState::MarkPhaseAdvanceMarking(base::TimeTicks deadline) {
deadline);
}
bool ThreadState::VerifyMarkingEnabled() const {
bool ThreadState::IsVerifyMarkingEnabled() const {
bool should_verify_marking = base::FeatureList::IsEnabled(
blink::features::kBlinkHeapIncrementalMarkingStress);
#if BUILDFLAG(BLINK_HEAP_VERIFICATION)
......@@ -1770,7 +1770,7 @@ void ThreadState::MarkPhaseEpilogue(BlinkGC::MarkingType marking_type) {
void ThreadState::VerifyMarking(BlinkGC::MarkingType marking_type) {
DCHECK_NE(BlinkGC::kTakeSnapshot, marking_type);
if (VerifyMarkingEnabled())
if (IsVerifyMarkingEnabled())
Heap().VerifyMarking();
}
......
......@@ -257,7 +257,6 @@ class PLATFORM_EXPORT ThreadState final : private RAILModeObserver {
void ScheduleV8FollowupGCIfNeeded(BlinkGC::V8GCType);
void ScheduleForcedGCForTesting();
void ScheduleGCIfNeeded();
void PostIdleGCTask();
void WillStartV8GC(BlinkGC::V8GCType);
void SetGCState(GCState);
GCState GetGCState() const { return gc_state_; }
......@@ -330,8 +329,6 @@ class PLATFORM_EXPORT ThreadState final : private RAILModeObserver {
bool IsIncrementalMarking() const { return incremental_marking_; }
void SetIncrementalMarking(bool value) { incremental_marking_ = value; }
void FlushHeapDoesNotContainCacheIfNeeded();
void SafePoint(BlinkGC::StackState);
// A region of non-weak PersistentNodes allocated on the given thread.
......@@ -386,12 +383,15 @@ class PLATFORM_EXPORT ThreadState final : private RAILModeObserver {
int GcAge() const { return gc_age_; }
MarkingVisitor* CurrentVisitor() { return current_gc_data_.visitor.get(); }
MarkingVisitor* CurrentVisitor() const {
return current_gc_data_.visitor.get();
}
// Implementation for RAILModeObserver
void OnRAILModeChanged(RAILMode new_mode) override;
bool VerifyMarkingEnabled() const;
// Returns true if the marking verifier is enabled, false otherwise.
bool IsVerifyMarkingEnabled() const;
private:
// Stores whether some ThreadState is currently in incremental marking.
......@@ -512,7 +512,6 @@ class PLATFORM_EXPORT ThreadState final : private RAILModeObserver {
// to the event loop. If both return false, we don't need to
// collect garbage at this point.
bool ShouldForceConservativeGC();
bool ShouldScheduleIncrementalMarking();
// V8 minor or major GC is likely to drop a lot of references to objects
// on Oilpan's heap. We give a chance to schedule a GC.
bool ShouldScheduleV8FollowupGC();
......@@ -551,7 +550,7 @@ class PLATFORM_EXPORT ThreadState final : private RAILModeObserver {
// The argument must be registered before calling this.
void RemoveObserver(BlinkGCObserver*);
bool IsForcedGC(BlinkGC::GCReason reason) {
bool IsForcedGC(BlinkGC::GCReason reason) const {
return reason == BlinkGC::GCReason::kThreadTerminationGC ||
reason == BlinkGC::GCReason::kForcedGCForTesting;
}
......
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