LCOV - code coverage report
Current view: top level - src/heap - invalidated-slots.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 14 14 100.0 %
Date: 2019-04-17 Functions: 2 2 100.0 %

          Line data    Source code
       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/invalidated-slots.h"
       6             : #include "src/heap/spaces.h"
       7             : 
       8             : namespace v8 {
       9             : namespace internal {
      10             : 
      11       12918 : InvalidatedSlotsFilter::InvalidatedSlotsFilter(MemoryChunk* chunk) {
      12             :   // Adjust slots_in_free_space_are_valid_ if more spaces are added.
      13             :   DCHECK_IMPLIES(chunk->invalidated_slots() != nullptr,
      14             :                  chunk->InOldSpace() || chunk->InLargeObjectSpace());
      15             :   // The sweeper removes invalid slots and makes free space available for
      16             :   // allocation. Slots for new objects can be recorded in the free space.
      17             :   // Note that we cannot simply check for SweepingDone because pages in large
      18             :   // object space are not swept but have SweepingDone() == true.
      19       12918 :   slots_in_free_space_are_valid_ = chunk->SweepingDone() && chunk->InOldSpace();
      20             : 
      21             :   InvalidatedSlots* invalidated_slots =
      22       12910 :       chunk->invalidated_slots() ? chunk->invalidated_slots() : &empty_;
      23       12910 :   iterator_ = invalidated_slots->begin();
      24       12910 :   iterator_end_ = invalidated_slots->end();
      25       12910 :   sentinel_ = chunk->area_end();
      26       12910 :   if (iterator_ != iterator_end_) {
      27         145 :     invalidated_start_ = iterator_->first->address();
      28         145 :     invalidated_end_ = invalidated_start_ + iterator_->second;
      29             :   } else {
      30       12765 :     invalidated_start_ = sentinel_;
      31       12765 :     invalidated_end_ = sentinel_;
      32             :   }
      33             :   // These values will be lazily set when needed.
      34       12910 :   invalidated_object_size_ = 0;
      35             : #ifdef DEBUG
      36             :   last_slot_ = chunk->area_start();
      37             : #endif
      38       12910 : }
      39             : 
      40             : }  // namespace internal
      41      121996 : }  // namespace v8

Generated by: LCOV version 1.10