OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 5873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5884 if (!InNewSpace(object)) { | 5884 if (!InNewSpace(object)) { |
5885 Address slot_addr = reinterpret_cast<Address>(slot); | 5885 Address slot_addr = reinterpret_cast<Address>(slot); |
5886 Page* page = Page::FromAddress(slot_addr); | 5886 Page* page = Page::FromAddress(slot_addr); |
5887 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); | 5887 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); |
5888 store_buffer()->MoveAllEntriesToRememberedSet(); | 5888 store_buffer()->MoveAllEntriesToRememberedSet(); |
5889 RememberedSet<OLD_TO_NEW>::Remove(page, slot_addr); | 5889 RememberedSet<OLD_TO_NEW>::Remove(page, slot_addr); |
5890 RememberedSet<OLD_TO_OLD>::Remove(page, slot_addr); | 5890 RememberedSet<OLD_TO_OLD>::Remove(page, slot_addr); |
5891 } | 5891 } |
5892 } | 5892 } |
5893 | 5893 |
| 5894 bool Heap::HasRecordedSlot(HeapObject* object, Object** slot) { |
| 5895 if (InNewSpace(object)) { |
| 5896 return false; |
| 5897 } |
| 5898 Address slot_addr = reinterpret_cast<Address>(slot); |
| 5899 Page* page = Page::FromAddress(slot_addr); |
| 5900 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); |
| 5901 store_buffer()->MoveAllEntriesToRememberedSet(); |
| 5902 return RememberedSet<OLD_TO_NEW>::Contains(page, slot_addr) || |
| 5903 RememberedSet<OLD_TO_OLD>::Contains(page, slot_addr); |
| 5904 } |
| 5905 |
5894 void Heap::ClearRecordedSlotRange(Address start, Address end) { | 5906 void Heap::ClearRecordedSlotRange(Address start, Address end) { |
5895 Page* page = Page::FromAddress(start); | 5907 Page* page = Page::FromAddress(start); |
5896 if (!page->InNewSpace()) { | 5908 if (!page->InNewSpace()) { |
5897 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); | 5909 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); |
5898 store_buffer()->MoveAllEntriesToRememberedSet(); | 5910 store_buffer()->MoveAllEntriesToRememberedSet(); |
5899 RememberedSet<OLD_TO_NEW>::RemoveRange(page, start, end, | 5911 RememberedSet<OLD_TO_NEW>::RemoveRange(page, start, end, |
5900 SlotSet::PREFREE_EMPTY_BUCKETS); | 5912 SlotSet::PREFREE_EMPTY_BUCKETS); |
5901 RememberedSet<OLD_TO_OLD>::RemoveRange(page, start, end, | 5913 RememberedSet<OLD_TO_OLD>::RemoveRange(page, start, end, |
5902 SlotSet::FREE_EMPTY_BUCKETS); | 5914 SlotSet::FREE_EMPTY_BUCKETS); |
5903 } | 5915 } |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6467 } | 6479 } |
6468 | 6480 |
6469 | 6481 |
6470 // static | 6482 // static |
6471 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6483 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6472 return StaticVisitorBase::GetVisitorId(map); | 6484 return StaticVisitorBase::GetVisitorId(map); |
6473 } | 6485 } |
6474 | 6486 |
6475 } // namespace internal | 6487 } // namespace internal |
6476 } // namespace v8 | 6488 } // namespace v8 |
OLD | NEW |