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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 ReportStatisticsBeforeGC(); | 432 ReportStatisticsBeforeGC(); |
433 #endif // DEBUG | 433 #endif // DEBUG |
434 | 434 |
435 if (new_space_->IsAtMaximumCapacity()) { | 435 if (new_space_->IsAtMaximumCapacity()) { |
436 maximum_size_scavenges_++; | 436 maximum_size_scavenges_++; |
437 } else { | 437 } else { |
438 maximum_size_scavenges_ = 0; | 438 maximum_size_scavenges_ = 0; |
439 } | 439 } |
440 CheckNewSpaceExpansionCriteria(); | 440 CheckNewSpaceExpansionCriteria(); |
441 UpdateNewSpaceAllocationCounter(); | 441 UpdateNewSpaceAllocationCounter(); |
442 store_buffer()->MoveEntriesToRememberedSet(); | 442 store_buffer()->MoveAllEntriesToRememberedSet(); |
443 } | 443 } |
444 | 444 |
445 | 445 |
446 intptr_t Heap::SizeOfObjects() { | 446 intptr_t Heap::SizeOfObjects() { |
447 intptr_t total = 0; | 447 intptr_t total = 0; |
448 AllSpaces spaces(this); | 448 AllSpaces spaces(this); |
449 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { | 449 for (Space* space = spaces.next(); space != NULL; space = spaces.next()) { |
450 total += space->SizeOfObjects(); | 450 total += space->SizeOfObjects(); |
451 } | 451 } |
452 return total; | 452 return total; |
(...skipping 5414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5867 }; | 5867 }; |
5868 | 5868 |
5869 | 5869 |
5870 void Heap::CheckHandleCount() { | 5870 void Heap::CheckHandleCount() { |
5871 CheckHandleCountVisitor v; | 5871 CheckHandleCountVisitor v; |
5872 isolate_->handle_scope_implementer()->Iterate(&v); | 5872 isolate_->handle_scope_implementer()->Iterate(&v); |
5873 } | 5873 } |
5874 | 5874 |
5875 void Heap::ClearRecordedSlot(HeapObject* object, Object** slot) { | 5875 void Heap::ClearRecordedSlot(HeapObject* object, Object** slot) { |
5876 if (!InNewSpace(object)) { | 5876 if (!InNewSpace(object)) { |
5877 store_buffer()->MoveEntriesToRememberedSet(); | |
5878 Address slot_addr = reinterpret_cast<Address>(slot); | 5877 Address slot_addr = reinterpret_cast<Address>(slot); |
5879 Page* page = Page::FromAddress(slot_addr); | 5878 Page* page = Page::FromAddress(slot_addr); |
5880 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); | 5879 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); |
| 5880 store_buffer()->MoveAllEntriesToRememberedSet(); |
5881 RememberedSet<OLD_TO_NEW>::Remove(page, slot_addr); | 5881 RememberedSet<OLD_TO_NEW>::Remove(page, slot_addr); |
5882 RememberedSet<OLD_TO_OLD>::Remove(page, slot_addr); | 5882 RememberedSet<OLD_TO_OLD>::Remove(page, slot_addr); |
5883 } | 5883 } |
5884 } | 5884 } |
5885 | 5885 |
5886 void Heap::ClearRecordedSlotRange(Address start, Address end) { | 5886 void Heap::ClearRecordedSlotRange(Address start, Address end) { |
5887 Page* page = Page::FromAddress(start); | 5887 Page* page = Page::FromAddress(start); |
5888 if (!page->InNewSpace()) { | 5888 if (!page->InNewSpace()) { |
5889 store_buffer()->MoveEntriesToRememberedSet(); | |
5890 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); | 5889 DCHECK_EQ(page->owner()->identity(), OLD_SPACE); |
| 5890 store_buffer()->MoveAllEntriesToRememberedSet(); |
5891 RememberedSet<OLD_TO_NEW>::RemoveRange(page, start, end, | 5891 RememberedSet<OLD_TO_NEW>::RemoveRange(page, start, end, |
5892 SlotSet::PREFREE_EMPTY_BUCKETS); | 5892 SlotSet::PREFREE_EMPTY_BUCKETS); |
5893 RememberedSet<OLD_TO_OLD>::RemoveRange(page, start, end, | 5893 RememberedSet<OLD_TO_OLD>::RemoveRange(page, start, end, |
5894 SlotSet::FREE_EMPTY_BUCKETS); | 5894 SlotSet::FREE_EMPTY_BUCKETS); |
5895 } | 5895 } |
5896 } | 5896 } |
5897 | 5897 |
5898 void Heap::RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, | 5898 void Heap::RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, |
5899 Object* value) { | 5899 Object* value) { |
5900 DCHECK(InNewSpace(value)); | 5900 DCHECK(InNewSpace(value)); |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6455 } | 6455 } |
6456 | 6456 |
6457 | 6457 |
6458 // static | 6458 // static |
6459 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6459 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6460 return StaticVisitorBase::GetVisitorId(map); | 6460 return StaticVisitorBase::GetVisitorId(map); |
6461 } | 6461 } |
6462 | 6462 |
6463 } // namespace internal | 6463 } // namespace internal |
6464 } // namespace v8 | 6464 } // namespace v8 |
OLD | NEW |