11cb0ef41Sopenharmony_ci// Copyright 2017 the V8 project authors. All rights reserved. 21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be 31cb0ef41Sopenharmony_ci// found in the LICENSE file. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ci#include "src/heap/stress-marking-observer.h" 61cb0ef41Sopenharmony_ci#include "src/heap/incremental-marking.h" 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_cinamespace v8 { 91cb0ef41Sopenharmony_cinamespace internal { 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ci// TODO(majeski): meaningful step_size 121cb0ef41Sopenharmony_ciStressMarkingObserver::StressMarkingObserver(Heap* heap) 131cb0ef41Sopenharmony_ci : AllocationObserver(64), heap_(heap) {} 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_civoid StressMarkingObserver::Step(int bytes_allocated, Address soon_object, 161cb0ef41Sopenharmony_ci size_t size) { 171cb0ef41Sopenharmony_ci heap_->StartIncrementalMarkingIfAllocationLimitIsReached(Heap::kNoGCFlags, 181cb0ef41Sopenharmony_ci kNoGCCallbackFlags); 191cb0ef41Sopenharmony_ci heap_->incremental_marking()->EnsureBlackAllocated(soon_object, size); 201cb0ef41Sopenharmony_ci} 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ci} // namespace internal 231cb0ef41Sopenharmony_ci} // namespace v8 24