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

[api] Remove deprecated EmbedderHeapTracer APIs

Also fully deprecate AbortTracing.

Bug: chromium:843903
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I852d28d8ce0f02b3a048b1061de29c9fce71ce62
Reviewed-on: https://chromium-review.googlesource.com/c/1278811
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56655}
parent c113f71a
...@@ -6964,15 +6964,6 @@ class V8_EXPORT EmbedderHeapTracer { ...@@ -6964,15 +6964,6 @@ class V8_EXPORT EmbedderHeapTracer {
kEmpty, kEmpty,
}; };
enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION };
struct AdvanceTracingActions {
explicit AdvanceTracingActions(ForceCompletionAction force_completion_)
: force_completion(force_completion_) {}
ForceCompletionAction force_completion;
};
virtual ~EmbedderHeapTracer() = default; virtual ~EmbedderHeapTracer() = default;
/** /**
...@@ -6989,25 +6980,6 @@ class V8_EXPORT EmbedderHeapTracer { ...@@ -6989,25 +6980,6 @@ class V8_EXPORT EmbedderHeapTracer {
*/ */
virtual void TracePrologue() = 0; virtual void TracePrologue() = 0;
/**
* Called to make a tracing step in the embedder.
*
* The embedder is expected to trace its heap starting from wrappers reported
* by RegisterV8References method, and report back all reachable wrappers.
* Furthermore, the embedder is expected to stop tracing by the given
* deadline.
*
* Returns true if there is still work to do.
*
* Note: Only one of the AdvanceTracing methods needs to be overriden by the
* embedder.
*/
V8_DEPRECATED("Use void AdvanceTracing(deadline_in_ms)",
virtual bool AdvanceTracing(double deadline_in_ms,
AdvanceTracingActions actions)) {
return false;
}
/** /**
* Called to advance tracing in the embedder. * Called to advance tracing in the embedder.
* *
...@@ -7017,17 +6989,14 @@ class V8_EXPORT EmbedderHeapTracer { ...@@ -7017,17 +6989,14 @@ class V8_EXPORT EmbedderHeapTracer {
* deadline. A deadline of infinity means that tracing should be finished. * deadline. A deadline of infinity means that tracing should be finished.
* *
* Returns |true| if tracing is done, and false otherwise. * Returns |true| if tracing is done, and false otherwise.
*
* Note: Only one of the AdvanceTracing methods needs to be overriden by the
* embedder.
*/ */
virtual bool AdvanceTracing(double deadline_in_ms); virtual bool AdvanceTracing(double deadline_in_ms) = 0;
/* /*
* Returns true if there no more tracing work to be done (see AdvanceTracing) * Returns true if there no more tracing work to be done (see AdvanceTracing)
* and false otherwise. * and false otherwise.
*/ */
virtual bool IsTracingDone(); virtual bool IsTracingDone() = 0;
/** /**
* Called at the end of a GC cycle. * Called at the end of a GC cycle.
...@@ -7039,13 +7008,8 @@ class V8_EXPORT EmbedderHeapTracer { ...@@ -7039,13 +7008,8 @@ class V8_EXPORT EmbedderHeapTracer {
/** /**
* Called upon entering the final marking pause. No more incremental marking * Called upon entering the final marking pause. No more incremental marking
* steps will follow this call. * steps will follow this call.
*
* Note: Only one of the EnterFinalPause methods needs to be overriden by the
* embedder.
*/ */
V8_DEPRECATED("Use void EnterFinalPause(EmbedderStackState)", virtual void EnterFinalPause(EmbedderStackState stack_state) = 0;
virtual void EnterFinalPause()) {}
virtual void EnterFinalPause(EmbedderStackState stack_state);
/** /**
* Called when tracing is aborted. * Called when tracing is aborted.
...@@ -7053,7 +7017,7 @@ class V8_EXPORT EmbedderHeapTracer { ...@@ -7053,7 +7017,7 @@ class V8_EXPORT EmbedderHeapTracer {
* The embedder is expected to throw away all intermediate data and reset to * The embedder is expected to throw away all intermediate data and reset to
* the initial state. * the initial state.
*/ */
V8_DEPRECATE_SOON("Obsolete as V8 will not abort tracing anymore.", V8_DEPRECATED("Obsolete as V8 will not abort tracing anymore.",
virtual void AbortTracing()) {} virtual void AbortTracing()) {}
/* /*
...@@ -7080,13 +7044,6 @@ class V8_EXPORT EmbedderHeapTracer { ...@@ -7080,13 +7044,6 @@ class V8_EXPORT EmbedderHeapTracer {
*/ */
v8::Isolate* isolate() const { return isolate_; } v8::Isolate* isolate() const { return isolate_; }
/**
* Returns the number of wrappers that are still to be traced by the embedder.
*/
V8_DEPRECATED("Use IsTracingDone", virtual size_t NumberOfWrappersToTrace()) {
return 0;
}
protected: protected:
v8::Isolate* isolate_ = nullptr; v8::Isolate* isolate_ = nullptr;
......
...@@ -10505,44 +10505,6 @@ void EmbedderHeapTracer::GarbageCollectionForTesting( ...@@ -10505,44 +10505,6 @@ void EmbedderHeapTracer::GarbageCollectionForTesting(
kGCCallbackFlagForced); kGCCallbackFlagForced);
} }
bool EmbedderHeapTracer::AdvanceTracing(double deadline_in_ms) {
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
return !this->AdvanceTracing(
deadline_in_ms, AdvanceTracingActions(std::isinf(deadline_in_ms)
? FORCE_COMPLETION
: DO_NOT_FORCE_COMPLETION));
#if __clang__
#pragma clang diagnostic pop
#endif
}
void EmbedderHeapTracer::EnterFinalPause(EmbedderStackState stack_state) {
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
this->EnterFinalPause();
#if __clang__
#pragma clang diagnostic pop
#endif
}
bool EmbedderHeapTracer::IsTracingDone() {
// TODO(mlippautz): Implement using "return true" after removing the deprecated
// call.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
return NumberOfWrappersToTrace() == 0;
#if __clang__
#pragma clang diagnostic pop
#endif
}
namespace internal { namespace internal {
void HandleScopeImplementer::FreeThreadResources() { void HandleScopeImplementer::FreeThreadResources() {
......
...@@ -49,15 +49,16 @@ class TestEmbedderHeapTracer final : public v8::EmbedderHeapTracer { ...@@ -49,15 +49,16 @@ class TestEmbedderHeapTracer final : public v8::EmbedderHeapTracer {
to_register_with_v8_.push_back(persistent); to_register_with_v8_.push_back(persistent);
} }
bool AdvanceTracing(double deadline_in_ms, bool AdvanceTracing(double deadline_in_ms) final {
AdvanceTracingActions actions) final {
for (auto persistent : to_register_with_v8_) { for (auto persistent : to_register_with_v8_) {
persistent->RegisterExternalReference(isolate_); persistent->RegisterExternalReference(isolate_);
} }
to_register_with_v8_.clear(); to_register_with_v8_.clear();
return false; return true;
} }
bool IsTracingDone() final { return to_register_with_v8_.empty(); }
void TracePrologue() final {} void TracePrologue() final {}
void TraceEpilogue() final {} void TraceEpilogue() final {}
void AbortTracing() final {} void AbortTracing() final {}
......
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