5 #ifndef V8_HEAP_INVALIDATED_SLOTS_INL_H_ 6 #define V8_HEAP_INVALIDATED_SLOTS_INL_H_ 10 #include "src/allocation.h" 11 #include "src/heap/invalidated-slots.h" 12 #include "src/heap/spaces.h" 13 #include "src/objects-body-descriptors-inl.h" 14 #include "src/objects-body-descriptors.h" 15 #include "src/objects.h" 20 bool InvalidatedSlotsFilter::IsValid(Address slot) {
22 DCHECK_LT(slot, sentinel_);
24 DCHECK_LE(last_slot_, slot);
27 while (slot >= invalidated_end_) {
29 if (iterator_ != iterator_end_) {
31 DCHECK_LE(invalidated_end_, iterator_->first->address());
32 invalidated_start_ = iterator_->first->address();
33 invalidated_end_ = invalidated_start_ + iterator_->second;
34 invalidated_object_ =
nullptr;
35 invalidated_object_size_ = 0;
37 invalidated_start_ = sentinel_;
38 invalidated_end_ = sentinel_;
42 if (slot < invalidated_start_) {
48 if (invalidated_object_ ==
nullptr) {
49 invalidated_object_ = HeapObject::FromAddress(invalidated_start_);
50 DCHECK(!invalidated_object_->IsFiller());
51 invalidated_object_size_ =
52 invalidated_object_->SizeFromMap(invalidated_object_->map());
54 int offset =
static_cast<int>(slot - invalidated_start_);
56 DCHECK_LE(invalidated_object_size_,
57 static_cast<int>(invalidated_end_ - invalidated_start_));
59 if (offset >= invalidated_object_size_) {
60 return slots_in_free_space_are_valid_;
62 return invalidated_object_->IsValidSlot(invalidated_object_->map(), offset);
68 #endif // V8_HEAP_INVALIDATED_SLOTS_INL_H_