Commit 00967a61 authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

cppgc: Reoder decls in MarkerBase

Change-Id: Ifb69e0d12359b7781665729d3abf91db4c1505bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3579361
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79893}
parent d2b95432
...@@ -87,6 +87,23 @@ size_t GetNextIncrementalStepDuration(IncrementalMarkingSchedule& schedule, ...@@ -87,6 +87,23 @@ size_t GetNextIncrementalStepDuration(IncrementalMarkingSchedule& schedule,
constexpr v8::base::TimeDelta MarkerBase::kMaximumIncrementalStepDuration; constexpr v8::base::TimeDelta MarkerBase::kMaximumIncrementalStepDuration;
class MarkerBase::IncrementalMarkingTask final : public cppgc::Task {
public:
using Handle = SingleThreadedHandle;
IncrementalMarkingTask(MarkerBase*, MarkingConfig::StackState);
static Handle Post(cppgc::TaskRunner*, MarkerBase*);
private:
void Run() final;
MarkerBase* const marker_;
MarkingConfig::StackState stack_state_;
// TODO(chromium:1056170): Change to CancelableTask.
Handle handle_;
};
MarkerBase::IncrementalMarkingTask::IncrementalMarkingTask( MarkerBase::IncrementalMarkingTask::IncrementalMarkingTask(
MarkerBase* marker, MarkingConfig::StackState stack_state) MarkerBase* marker, MarkingConfig::StackState stack_state)
: marker_(marker), : marker_(marker),
......
...@@ -36,6 +36,8 @@ class HeapBase; ...@@ -36,6 +36,8 @@ class HeapBase;
// Alternatively, FinishMarking combines steps 3.-5. // Alternatively, FinishMarking combines steps 3.-5.
class V8_EXPORT_PRIVATE MarkerBase { class V8_EXPORT_PRIVATE MarkerBase {
public: public:
class IncrementalMarkingTask;
struct MarkingConfig { struct MarkingConfig {
enum class CollectionType : uint8_t { enum class CollectionType : uint8_t {
kMinor, kMinor,
...@@ -105,41 +107,25 @@ class V8_EXPORT_PRIVATE MarkerBase { ...@@ -105,41 +107,25 @@ class V8_EXPORT_PRIVATE MarkerBase {
HeapBase& heap() { return heap_; } HeapBase& heap() { return heap_; }
MarkingWorklists& MarkingWorklistsForTesting() { return marking_worklists_; }
MutatorMarkingState& MutatorMarkingStateForTesting() {
return mutator_marking_state_;
}
cppgc::Visitor& Visitor() { return visitor(); } cppgc::Visitor& Visitor() { return visitor(); }
void ClearAllWorklistsForTesting();
bool IncrementalMarkingStepForTesting(MarkingConfig::StackState);
class IncrementalMarkingTask final : public cppgc::Task {
public:
using Handle = SingleThreadedHandle;
IncrementalMarkingTask(MarkerBase*, MarkingConfig::StackState);
static Handle Post(cppgc::TaskRunner*, MarkerBase*);
private:
void Run() final;
MarkerBase* const marker_; bool IsMarking() const { return is_marking_; }
MarkingConfig::StackState stack_state_;
// TODO(chromium:1056170): Change to CancelableTask.
Handle handle_;
};
void SetMainThreadMarkingDisabledForTesting(bool); void SetMainThreadMarkingDisabledForTesting(bool);
void WaitForConcurrentMarkingForTesting(); void WaitForConcurrentMarkingForTesting();
void ClearAllWorklistsForTesting();
bool IncrementalMarkingStepForTesting(MarkingConfig::StackState);
bool IsMarking() const { return is_marking_; } MarkingWorklists& MarkingWorklistsForTesting() { return marking_worklists_; }
MutatorMarkingState& MutatorMarkingStateForTesting() {
return mutator_marking_state_;
}
protected: protected:
class IncrementalMarkingAllocationObserver; class IncrementalMarkingAllocationObserver;
using IncrementalMarkingTaskHandle = SingleThreadedHandle;
static constexpr v8::base::TimeDelta kMaximumIncrementalStepDuration = static constexpr v8::base::TimeDelta kMaximumIncrementalStepDuration =
v8::base::TimeDelta::FromMilliseconds(2); v8::base::TimeDelta::FromMilliseconds(2);
...@@ -172,7 +158,7 @@ class V8_EXPORT_PRIVATE MarkerBase { ...@@ -172,7 +158,7 @@ class V8_EXPORT_PRIVATE MarkerBase {
cppgc::Platform* platform_; cppgc::Platform* platform_;
std::shared_ptr<cppgc::TaskRunner> foreground_task_runner_; std::shared_ptr<cppgc::TaskRunner> foreground_task_runner_;
IncrementalMarkingTask::Handle incremental_marking_handle_; IncrementalMarkingTaskHandle incremental_marking_handle_;
std::unique_ptr<IncrementalMarkingAllocationObserver> std::unique_ptr<IncrementalMarkingAllocationObserver>
incremental_marking_allocation_observer_; incremental_marking_allocation_observer_;
......
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