Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/cctest/heap/test-embedder-tracing.cc')
-rw-r--r--deps/v8/test/cctest/heap/test-embedder-tracing.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/deps/v8/test/cctest/heap/test-embedder-tracing.cc b/deps/v8/test/cctest/heap/test-embedder-tracing.cc
index 47f48c0c7aa..d54ffcf377d 100644
--- a/deps/v8/test/cctest/heap/test-embedder-tracing.cc
+++ b/deps/v8/test/cctest/heap/test-embedder-tracing.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "include/v8.h"
-#include "src/api.h"
+#include "src/api-inl.h"
#include "src/objects-inl.h"
#include "src/objects/module.h"
#include "src/objects/script.h"
@@ -61,7 +61,7 @@ class TestEmbedderHeapTracer final : public v8::EmbedderHeapTracer {
void TracePrologue() final {}
void TraceEpilogue() final {}
void AbortTracing() final {}
- void EnterFinalPause() final {}
+ void EnterFinalPause(EmbedderStackState) final {}
bool IsRegisteredFromV8(void* first_field) const {
for (auto pair : registered_from_v8_) {
@@ -251,6 +251,20 @@ TEST(FinalizeTracingWhenMarking) {
CHECK(marking->IsStopped());
}
+TEST(GarbageCollectionForTesting) {
+ ManualGCScope manual_gc;
+ i::FLAG_expose_gc = true;
+ CcTest::InitializeVM();
+ v8::Isolate* isolate = CcTest::isolate();
+ Isolate* i_isolate = CcTest::i_isolate();
+ TestEmbedderHeapTracer tracer(isolate);
+ TemporaryEmbedderHeapTracerScope tracer_scope(isolate, &tracer);
+
+ int saved_gc_counter = i_isolate->heap()->gc_count();
+ tracer.GarbageCollectionForTesting(EmbedderHeapTracer::kUnknown);
+ CHECK_GT(i_isolate->heap()->gc_count(), saved_gc_counter);
+}
+
} // namespace heap
} // namespace internal
} // namespace v8