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 {
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;
/**
......@@ -6989,25 +6980,6 @@ class V8_EXPORT EmbedderHeapTracer {
*/
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.
*
......@@ -7017,17 +6989,14 @@ class V8_EXPORT EmbedderHeapTracer {
* deadline. A deadline of infinity means that tracing should be finished.
*
* 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)
* and false otherwise.
*/
virtual bool IsTracingDone();
virtual bool IsTracingDone() = 0;
/**
* Called at the end of a GC cycle.
......@@ -7039,13 +7008,8 @@ class V8_EXPORT EmbedderHeapTracer {
/**
* Called upon entering the final marking pause. No more incremental marking
* 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()) {}
virtual void EnterFinalPause(EmbedderStackState stack_state);
virtual void EnterFinalPause(EmbedderStackState stack_state) = 0;
/**
* Called when tracing is aborted.
......@@ -7053,8 +7017,8 @@ class V8_EXPORT EmbedderHeapTracer {
* The embedder is expected to throw away all intermediate data and reset to
* the initial state.
*/
V8_DEPRECATE_SOON("Obsolete as V8 will not abort tracing anymore.",
virtual void AbortTracing()) {}
V8_DEPRECATED("Obsolete as V8 will not abort tracing anymore.",
virtual void AbortTracing()) {}
/*
* Called by the embedder to request immediate finalization of the currently
......@@ -7080,13 +7044,6 @@ class V8_EXPORT EmbedderHeapTracer {
*/
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:
v8::Isolate* isolate_ = nullptr;
......
......@@ -10505,44 +10505,6 @@ void EmbedderHeapTracer::GarbageCollectionForTesting(
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 {
void HandleScopeImplementer::FreeThreadResources() {
......
......@@ -49,15 +49,16 @@ class TestEmbedderHeapTracer final : public v8::EmbedderHeapTracer {
to_register_with_v8_.push_back(persistent);
}
bool AdvanceTracing(double deadline_in_ms,
AdvanceTracingActions actions) final {
bool AdvanceTracing(double deadline_in_ms) final {
for (auto persistent : to_register_with_v8_) {
persistent->RegisterExternalReference(isolate_);
}
to_register_with_v8_.clear();
return false;
return true;
}
bool IsTracingDone() final { return to_register_with_v8_.empty(); }
void TracePrologue() final {}
void TraceEpilogue() 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