• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "src/heap/stress-marking-observer.h"
6 #include "src/heap/incremental-marking.h"
7 
8 namespace v8 {
9 namespace internal {
10 
11 // TODO(majeski): meaningful step_size
StressMarkingObserver(Heap * heap)12 StressMarkingObserver::StressMarkingObserver(Heap* heap)
13     : AllocationObserver(64), heap_(heap) {}
14 
Step(int bytes_allocated,Address soon_object,size_t size)15 void StressMarkingObserver::Step(int bytes_allocated, Address soon_object,
16                                  size_t size) {
17   heap_->StartIncrementalMarkingIfAllocationLimitIsReached(Heap::kNoGCFlags,
18                                                            kNoGCCallbackFlags);
19   heap_->incremental_marking()->EnsureBlackAllocated(soon_object, size);
20 }
21 
22 }  // namespace internal
23 }  // namespace v8
24