Commit 72249208 authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[Jobs]: Deprecate IsCompleted and IsRunning.

Follow up on https://chromium-review.googlesource.com/c/v8/v8/+/2510969
Now that gin implements the new version:
https://chromium-review.googlesource.com/c/chromium/src/+/2566052
These can be deprecated.

Change-Id: Ie1e5448655e40eb3c11089f59510f269a9873e66
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2566430Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71700}
parent 0b96e5b0
......@@ -225,22 +225,24 @@ class JobHandle {
virtual void CancelAndDetach() { Cancel(); }
/**
* Returns true if there's currently no work pending and no worker running.
* TODO(etiennep): Deprecate IsCompleted in favor of IsActive once implemented
* by all embedders.
* Returns true if there's any work pending or any worker running.
*/
virtual bool IsCompleted() = 0;
virtual bool IsActive() { return !IsCompleted(); }
virtual bool IsActive() = 0;
// TODO(etiennep): Clean up once all overrides are removed.
V8_DEPRECATED("Use !IsActive() instead.")
virtual bool IsCompleted() { return !IsActive(); }
/**
* Returns true if associated with a Job and other methods may be called.
* Returns false after Join() or Cancel() was called. This may return true
* even if no workers are running and IsCompleted() returns true
* TODO(etiennep): Deprecate IsRunning in favor of IsValid once implemented by
* all embedders.
*/
virtual bool IsRunning() = 0;
virtual bool IsValid() { return IsRunning(); }
virtual bool IsValid() = 0;
// TODO(etiennep): Clean up once all overrides are removed.
V8_DEPRECATED("Use IsValid() instead.")
virtual bool IsRunning() { return IsValid(); }
/**
* Returns true if job priority can be changed.
......
......@@ -198,7 +198,7 @@ void ConcurrentMarkerBase::JoinForTesting() {
}
bool ConcurrentMarkerBase::IsActive() const {
return concurrent_marking_handle_ && concurrent_marking_handle_->IsRunning();
return concurrent_marking_handle_ && concurrent_marking_handle_->IsValid();
}
ConcurrentMarkerBase::~ConcurrentMarkerBase() {
......
......@@ -247,7 +247,7 @@ void Sweeper::SupportConcurrentSweeping() {
}
bool Sweeper::AreSweeperTasksRunning() {
return job_handle_ && job_handle_->IsValid() && !job_handle_->IsCompleted();
return job_handle_ && job_handle_->IsValid() && job_handle_->IsActive();
}
V8_INLINE size_t Sweeper::FreeAndProcessFreedMemory(
......
......@@ -116,9 +116,7 @@ class V8_PLATFORM_EXPORT DefaultJobHandle : public JobHandle {
void Join() override;
void Cancel() override;
void CancelAndDetach() override;
bool IsCompleted() override { return !IsActive(); }
bool IsActive() override;
bool IsRunning() override { return IsValid(); }
bool IsValid() override { return state_ != nullptr; }
bool UpdatePriorityEnabled() const override { return true; }
......
......@@ -132,9 +132,7 @@ class MockPlatform final : public TestPlatform {
void Join() override { orig_handle_->Join(); }
void Cancel() override { orig_handle_->Cancel(); }
void CancelAndDetach() override { orig_handle_->CancelAndDetach(); }
bool IsCompleted() override { return orig_handle_->IsCompleted(); }
bool IsActive() override { return orig_handle_->IsActive(); }
bool IsRunning() override { return orig_handle_->IsRunning(); }
bool IsValid() override { return orig_handle_->IsValid(); }
private:
......
......@@ -127,9 +127,7 @@ class MockPlatform final : public TestPlatform {
void Join() override { orig_handle_->Join(); }
void Cancel() override { orig_handle_->Cancel(); }
void CancelAndDetach() override { orig_handle_->CancelAndDetach(); }
bool IsRunning() override { return orig_handle_->IsRunning(); }
bool IsValid() override { return orig_handle_->IsValid(); }
bool IsCompleted() override { return orig_handle_->IsCompleted(); }
bool IsActive() override { return orig_handle_->IsActive(); }
private:
......
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