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 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 default: | 624 default: |
625 UNREACHABLE(); | 625 UNREACHABLE(); |
626 } | 626 } |
627 UNREACHABLE(); | 627 UNREACHABLE(); |
628 return nullptr; | 628 return nullptr; |
629 } | 629 } |
630 | 630 |
631 template <Heap::UpdateAllocationSiteMode mode> | 631 template <Heap::UpdateAllocationSiteMode mode> |
632 void Heap::UpdateAllocationSite(HeapObject* object, | 632 void Heap::UpdateAllocationSite(HeapObject* object, |
633 base::HashMap* pretenuring_feedback) { | 633 base::HashMap* pretenuring_feedback) { |
634 DCHECK(InFromSpace(object)); | 634 DCHECK(InFromSpace(object) || |
| 635 (InToSpace(object) && |
| 636 Page::FromAddress(object->address()) |
| 637 ->IsFlagSet(Page::PAGE_NEW_NEW_PROMOTION)) || |
| 638 (!InNewSpace(object) && |
| 639 Page::FromAddress(object->address()) |
| 640 ->IsFlagSet(Page::PAGE_NEW_OLD_PROMOTION))); |
635 if (!FLAG_allocation_site_pretenuring || | 641 if (!FLAG_allocation_site_pretenuring || |
636 !AllocationSite::CanTrack(object->map()->instance_type())) | 642 !AllocationSite::CanTrack(object->map()->instance_type())) |
637 return; | 643 return; |
638 AllocationMemento* memento_candidate = FindAllocationMemento<kForGC>(object); | 644 AllocationMemento* memento_candidate = FindAllocationMemento<kForGC>(object); |
639 if (memento_candidate == nullptr) return; | 645 if (memento_candidate == nullptr) return; |
640 | 646 |
641 if (mode == kGlobal) { | 647 if (mode == kGlobal) { |
642 DCHECK_EQ(pretenuring_feedback, global_pretenuring_feedback_); | 648 DCHECK_EQ(pretenuring_feedback, global_pretenuring_feedback_); |
643 // Entering global pretenuring feedback is only used in the scavenger, where | 649 // Entering global pretenuring feedback is only used in the scavenger, where |
644 // we are allowed to actually touch the allocation site. | 650 // we are allowed to actually touch the allocation site. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 | 850 |
845 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 851 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
846 for (Object** current = start; current < end; current++) { | 852 for (Object** current = start; current < end; current++) { |
847 CHECK((*current)->IsSmi()); | 853 CHECK((*current)->IsSmi()); |
848 } | 854 } |
849 } | 855 } |
850 } // namespace internal | 856 } // namespace internal |
851 } // namespace v8 | 857 } // namespace v8 |
852 | 858 |
853 #endif // V8_HEAP_HEAP_INL_H_ | 859 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |