| 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 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1564                                    HashMap* local_pretenuring_feedback) | 1564                                    HashMap* local_pretenuring_feedback) | 
| 1565       : EvacuateVisitorBase(heap, compaction_spaces, evacuation_slots_buffer, | 1565       : EvacuateVisitorBase(heap, compaction_spaces, evacuation_slots_buffer, | 
| 1566                             local_store_buffer), | 1566                             local_store_buffer), | 
| 1567         buffer_(LocalAllocationBuffer::InvalidBuffer()), | 1567         buffer_(LocalAllocationBuffer::InvalidBuffer()), | 
| 1568         space_to_allocate_(NEW_SPACE), | 1568         space_to_allocate_(NEW_SPACE), | 
| 1569         promoted_size_(0), | 1569         promoted_size_(0), | 
| 1570         semispace_copied_size_(0), | 1570         semispace_copied_size_(0), | 
| 1571         local_pretenuring_feedback_(local_pretenuring_feedback) {} | 1571         local_pretenuring_feedback_(local_pretenuring_feedback) {} | 
| 1572 | 1572 | 
| 1573   bool Visit(HeapObject* object) override { | 1573   bool Visit(HeapObject* object) override { | 
| 1574     heap_->UpdateAllocationSite(object, local_pretenuring_feedback_); | 1574     heap_->UpdateAllocationSite<Heap::kCached>(object, | 
|  | 1575                                                local_pretenuring_feedback_); | 
| 1575     int size = object->Size(); | 1576     int size = object->Size(); | 
| 1576     HeapObject* target_object = nullptr; | 1577     HeapObject* target_object = nullptr; | 
| 1577     if (heap_->ShouldBePromoted(object->address(), size) && | 1578     if (heap_->ShouldBePromoted(object->address(), size) && | 
| 1578         TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object, | 1579         TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object, | 
| 1579                           &target_object)) { | 1580                           &target_object)) { | 
| 1580       // If we end up needing more special cases, we should factor this out. | 1581       // If we end up needing more special cases, we should factor this out. | 
| 1581       if (V8_UNLIKELY(target_object->IsJSArrayBuffer())) { | 1582       if (V8_UNLIKELY(target_object->IsJSArrayBuffer())) { | 
| 1582         heap_->array_buffer_tracker()->Promote( | 1583         heap_->array_buffer_tracker()->Promote( | 
| 1583             JSArrayBuffer::cast(target_object)); | 1584             JSArrayBuffer::cast(target_object)); | 
| 1584       } | 1585       } | 
| (...skipping 2478 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4063     MarkBit mark_bit = Marking::MarkBitFrom(host); | 4064     MarkBit mark_bit = Marking::MarkBitFrom(host); | 
| 4064     if (Marking::IsBlack(mark_bit)) { | 4065     if (Marking::IsBlack(mark_bit)) { | 
| 4065       RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 4066       RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); | 
| 4066       RecordRelocSlot(&rinfo, target); | 4067       RecordRelocSlot(&rinfo, target); | 
| 4067     } | 4068     } | 
| 4068   } | 4069   } | 
| 4069 } | 4070 } | 
| 4070 | 4071 | 
| 4071 }  // namespace internal | 4072 }  // namespace internal | 
| 4072 }  // namespace v8 | 4073 }  // namespace v8 | 
| OLD | NEW | 
|---|