api: Forward deprecations around EmbedderHeapTracer

- TracedGlobal is now fully deprecated
- Removed GarbageCollectionForTesting

Bug: v8:12603
Change-Id: Iaaea924888d60f936c34461654d78d74792919f0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3471557
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79207}
This commit is contained in:
Michael Lippautz 2022-02-17 15:36:01 +01:00 committed by V8 LUCI CQ
parent d63b18c275
commit df696e72b1
3 changed files with 5 additions and 26 deletions

View File

@ -52,7 +52,7 @@ class V8_EXPORT EmbedderRootsHandler {
*/
virtual bool IsRoot(const v8::TracedReference<v8::Value>& handle) = 0;
V8_DEPRECATE_SOON("See v8::TracedGlobal class comment.")
V8_DEPRECATED("See v8::TracedGlobal class comment.")
virtual bool IsRoot(const v8::TracedGlobal<v8::Value>& handle) {
return true;
}
@ -92,7 +92,7 @@ class V8_EXPORT EmbedderHeapTracer {
class V8_EXPORT TracedGlobalHandleVisitor {
public:
virtual ~TracedGlobalHandleVisitor() = default;
V8_DEPRECATE_SOON("See v8::TracedGlobal class comment.")
V8_DEPRECATED("See v8::TracedGlobal class comment.")
virtual void VisitTracedGlobalHandle(const TracedGlobal<Value>& handle) {}
virtual void VisitTracedReference(const TracedReference<Value>& handle) {}
};
@ -194,7 +194,7 @@ class V8_EXPORT EmbedderHeapTracer {
*/
virtual bool IsRootForNonTracingGC(
const v8::TracedReference<v8::Value>& handle);
V8_DEPRECATE_SOON("See v8::TracedGlobal class comment.")
V8_DEPRECATED("See v8::TracedGlobal class comment.")
virtual bool IsRootForNonTracingGC(const v8::TracedGlobal<v8::Value>& handle);
/**
@ -203,14 +203,6 @@ class V8_EXPORT EmbedderHeapTracer {
virtual void ResetHandleInNonTracingGC(
const v8::TracedReference<v8::Value>& handle);
/*
* Called by the embedder to immediately perform a full garbage collection.
*
* Should only be used in testing code.
*/
V8_DEPRECATED("Use Isolate::RequestGarbageCollectionForTesting instead")
void GarbageCollectionForTesting(EmbedderStackState stack_state);
/*
* Called by the embedder to signal newly allocated or freed memory. Not bound
* to tracing phases. Embedders should trade off when increments are reported

View File

@ -226,7 +226,7 @@ class TracedGlobal : public BasicTracedReference<T> {
/**
* An empty TracedGlobal without storage cell.
*/
V8_DEPRECATE_SOON("See class comment.")
V8_DEPRECATED("See class comment.")
TracedGlobal() : BasicTracedReference<T>() {}
/**
@ -236,7 +236,7 @@ class TracedGlobal : public BasicTracedReference<T> {
* pointing to the same object.
*/
template <class S>
V8_DEPRECATE_SOON("See class comment.")
V8_DEPRECATED("See class comment.")
TracedGlobal(Isolate* isolate, Local<S> that) : BasicTracedReference<T>() {
this->val_ =
this->New(isolate, that.val_, &this->val_,

View File

@ -10243,19 +10243,6 @@ void EmbedderHeapTracer::FinalizeTracing() {
}
}
void EmbedderHeapTracer::GarbageCollectionForTesting(
EmbedderStackState stack_state) {
CHECK(isolate_);
Utils::ApiCheck(i::FLAG_expose_gc,
"v8::EmbedderHeapTracer::GarbageCollectionForTesting",
"Must use --expose-gc");
i::Heap* const heap = reinterpret_cast<i::Isolate*>(isolate_)->heap();
heap->SetEmbedderStackStateForNextFinalization(stack_state);
heap->PreciseCollectAllGarbage(i::Heap::kNoGCFlags,
i::GarbageCollectionReason::kTesting,
kGCCallbackFlagForced);
}
void EmbedderHeapTracer::IncreaseAllocatedSize(size_t bytes) {
if (isolate_) {
i::LocalEmbedderHeapTracer* const tracer =