From 1f3802a1e718e8315c826cc7cd43a100f896e1ec Mon Sep 17 00:00:00 2001 From: Michael Lippautz Date: Mon, 17 Sep 2018 14:22:34 +0200 Subject: [PATCH] [heap] Remove obsolete AbortTracing calls and deprecate interface V8 does not abort incremental marking anymore. Bug: chromium:843903 Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng Change-Id: Id39e9cf8ef2afc388bab2bbad1d458ee2649f8e8 Reviewed-on: https://chromium-review.googlesource.com/1226889 Reviewed-by: Hannes Payer Reviewed-by: Adam Klein Commit-Queue: Michael Lippautz Cr-Commit-Position: refs/heads/master@{#56009} --- include/v8.h | 3 ++- src/heap/embedder-tracing.cc | 7 ------- src/heap/embedder-tracing.h | 1 - .../heap/embedder-tracing-unittest.cc | 19 ------------------- 4 files changed, 2 insertions(+), 28 deletions(-) diff --git a/include/v8.h b/include/v8.h index 0bab4b928e..9727387287 100644 --- a/include/v8.h +++ b/include/v8.h @@ -7021,7 +7021,8 @@ class V8_EXPORT EmbedderHeapTracer { * The embedder is expected to throw away all intermediate data and reset to * the initial state. */ - virtual void AbortTracing() = 0; + V8_DEPRECATE_SOON("Obsolete as V8 will not abort tracing anymore.", + virtual void AbortTracing()) {} /* * Called by the embedder to request immediate finalization of the currently diff --git a/src/heap/embedder-tracing.cc b/src/heap/embedder-tracing.cc index bf6d5f3b90..198cdd4b1a 100644 --- a/src/heap/embedder-tracing.cc +++ b/src/heap/embedder-tracing.cc @@ -24,13 +24,6 @@ void LocalEmbedderHeapTracer::TraceEpilogue() { remote_tracer_->TraceEpilogue(); } -void LocalEmbedderHeapTracer::AbortTracing() { - if (!InUse()) return; - - cached_wrappers_to_trace_.clear(); - remote_tracer_->AbortTracing(); -} - void LocalEmbedderHeapTracer::EnterFinalPause() { if (!InUse()) return; diff --git a/src/heap/embedder-tracing.h b/src/heap/embedder-tracing.h index ab8a46bb53..8597c6baf5 100644 --- a/src/heap/embedder-tracing.h +++ b/src/heap/embedder-tracing.h @@ -36,7 +36,6 @@ class V8_EXPORT_PRIVATE LocalEmbedderHeapTracer final { void TracePrologue(); void TraceEpilogue(); - void AbortTracing(); void EnterFinalPause(); bool Trace(double deadline); bool IsRemoteTracingDone(); diff --git a/test/unittests/heap/embedder-tracing-unittest.cc b/test/unittests/heap/embedder-tracing-unittest.cc index ac2cb3e2ee..33cc05e692 100644 --- a/test/unittests/heap/embedder-tracing-unittest.cc +++ b/test/unittests/heap/embedder-tracing-unittest.cc @@ -33,7 +33,6 @@ class MockEmbedderHeapTracer : public EmbedderHeapTracer { public: MOCK_METHOD0(TracePrologue, void()); MOCK_METHOD0(TraceEpilogue, void()); - MOCK_METHOD0(AbortTracing, void()); MOCK_METHOD1(EnterFinalPause, void(EmbedderHeapTracer::EmbedderStackState)); MOCK_METHOD0(IsTracingDone, bool()); MOCK_METHOD1(RegisterV8References, @@ -76,24 +75,6 @@ TEST(LocalEmbedderHeapTracer, TraceEpilogueForwards) { local_tracer.TraceEpilogue(); } -TEST(LocalEmbedderHeapTracer, AbortTracingForwards) { - StrictMock remote_tracer; - LocalEmbedderHeapTracer local_tracer(nullptr); - local_tracer.SetRemoteTracer(&remote_tracer); - EXPECT_CALL(remote_tracer, AbortTracing()); - local_tracer.AbortTracing(); -} - -TEST(LocalEmbedderHeapTracer, AbortTracingClearsCachedWrappers) { - StrictMock remote_tracer; - LocalEmbedderHeapTracer local_tracer(nullptr); - local_tracer.SetRemoteTracer(&remote_tracer); - local_tracer.AddWrapperToTrace(CreateWrapperInfo()); - EXPECT_CALL(remote_tracer, AbortTracing()); - local_tracer.AbortTracing(); - EXPECT_EQ(0u, local_tracer.NumberOfCachedWrappersToTrace()); -} - TEST(LocalEmbedderHeapTracer, EnterFinalPauseForwards) { StrictMock remote_tracer; LocalEmbedderHeapTracer local_tracer(nullptr);