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

[embedder-tracing] Only expose GC call when used with --expose_gc

Bug: chromium:843903
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: Ie959e443fdf5dce92c4cd42ef62ec914a13b867e
Reviewed-on: https://chromium-review.googlesource.com/1187151
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55376}
parent c8f9ba06
......@@ -10456,7 +10456,8 @@ void EmbedderHeapTracer::FinalizeTracing() {
void EmbedderHeapTracer::GarbageCollectionForTesting(
EmbedderStackState stack_state) {
DCHECK(isolate_);
CHECK(isolate_);
CHECK(i::FLAG_expose_gc);
i::Heap* const heap = reinterpret_cast<i::Isolate*>(isolate_)->heap();
heap->SetEmbedderStackStateForNextFinalizaton(stack_state);
heap->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask,
......
......@@ -253,6 +253,7 @@ TEST(FinalizeTracingWhenMarking) {
TEST(GarbageCollectionForTesting) {
ManualGCScope manual_gc;
i::FLAG_expose_gc = true;
CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
Isolate* i_isolate = CcTest::i_isolate();
......
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