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/mark-compact.h" | 5 #include "src/heap/mark-compact.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/base/sys-info.h" | 9 #include "src/base/sys-info.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 space_to_allocate_(NEW_SPACE), | 1713 space_to_allocate_(NEW_SPACE), |
1714 promoted_size_(0), | 1714 promoted_size_(0), |
1715 semispace_copied_size_(0), | 1715 semispace_copied_size_(0), |
1716 local_pretenuring_feedback_(local_pretenuring_feedback) {} | 1716 local_pretenuring_feedback_(local_pretenuring_feedback) {} |
1717 | 1717 |
1718 inline bool Visit(HeapObject* object) override { | 1718 inline bool Visit(HeapObject* object) override { |
1719 heap_->UpdateAllocationSite<Heap::kCached>(object, | 1719 heap_->UpdateAllocationSite<Heap::kCached>(object, |
1720 local_pretenuring_feedback_); | 1720 local_pretenuring_feedback_); |
1721 int size = object->Size(); | 1721 int size = object->Size(); |
1722 HeapObject* target_object = nullptr; | 1722 HeapObject* target_object = nullptr; |
1723 if (heap_->ShouldBePromoted<DEFAULT_PROMOTION>(object->address(), size) && | 1723 if (heap_->ShouldBePromoted(object->address(), size) && |
1724 TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object, | 1724 TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object, |
1725 &target_object)) { | 1725 &target_object)) { |
1726 promoted_size_ += size; | 1726 promoted_size_ += size; |
1727 return true; | 1727 return true; |
1728 } | 1728 } |
1729 HeapObject* target = nullptr; | 1729 HeapObject* target = nullptr; |
1730 AllocationSpace space = AllocateTargetObject(object, &target); | 1730 AllocationSpace space = AllocateTargetObject(object, &target); |
1731 MigrateObject(HeapObject::cast(target), object, size, space); | 1731 MigrateObject(HeapObject::cast(target), object, size, space); |
1732 semispace_copied_size_ += size; | 1732 semispace_copied_size_ += size; |
1733 return true; | 1733 return true; |
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4007 // The target is always in old space, we don't have to record the slot in | 4007 // The target is always in old space, we don't have to record the slot in |
4008 // the old-to-new remembered set. | 4008 // the old-to-new remembered set. |
4009 DCHECK(!heap()->InNewSpace(target)); | 4009 DCHECK(!heap()->InNewSpace(target)); |
4010 RecordRelocSlot(host, &rinfo, target); | 4010 RecordRelocSlot(host, &rinfo, target); |
4011 } | 4011 } |
4012 } | 4012 } |
4013 } | 4013 } |
4014 | 4014 |
4015 } // namespace internal | 4015 } // namespace internal |
4016 } // namespace v8 | 4016 } // namespace v8 |
OLD | NEW |