| 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 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 inline void MigrateObject(HeapObject* dst, HeapObject* src, int size, | 1628 inline void MigrateObject(HeapObject* dst, HeapObject* src, int size, |
| 1629 AllocationSpace dest) { | 1629 AllocationSpace dest) { |
| 1630 Address dst_addr = dst->address(); | 1630 Address dst_addr = dst->address(); |
| 1631 Address src_addr = src->address(); | 1631 Address src_addr = src->address(); |
| 1632 DCHECK(heap_->AllowedToBeMigrated(src, dest)); | 1632 DCHECK(heap_->AllowedToBeMigrated(src, dest)); |
| 1633 DCHECK(dest != LO_SPACE); | 1633 DCHECK(dest != LO_SPACE); |
| 1634 if (dest == OLD_SPACE) { | 1634 if (dest == OLD_SPACE) { |
| 1635 DCHECK_OBJECT_SIZE(size); | 1635 DCHECK_OBJECT_SIZE(size); |
| 1636 DCHECK(IsAligned(size, kPointerSize)); | 1636 DCHECK(IsAligned(size, kPointerSize)); |
| 1637 heap_->CopyBlock(dst_addr, src_addr, size); | 1637 heap_->CopyBlock(dst_addr, src_addr, size); |
| 1638 if ((mode == kProfiled) && FLAG_ignition && dst->IsBytecodeArray()) { | 1638 if ((mode == kProfiled) && dst->IsBytecodeArray()) { |
| 1639 PROFILE(heap_->isolate(), | 1639 PROFILE(heap_->isolate(), |
| 1640 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); | 1640 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); |
| 1641 } | 1641 } |
| 1642 RecordMigratedSlotVisitor visitor(heap_->mark_compact_collector()); | 1642 RecordMigratedSlotVisitor visitor(heap_->mark_compact_collector()); |
| 1643 dst->IterateBodyFast(dst->map()->instance_type(), size, &visitor); | 1643 dst->IterateBodyFast(dst->map()->instance_type(), size, &visitor); |
| 1644 } else if (dest == CODE_SPACE) { | 1644 } else if (dest == CODE_SPACE) { |
| 1645 DCHECK_CODEOBJECT_SIZE(size, heap_->code_space()); | 1645 DCHECK_CODEOBJECT_SIZE(size, heap_->code_space()); |
| 1646 if (mode == kProfiled) { | 1646 if (mode == kProfiled) { |
| 1647 PROFILE(heap_->isolate(), | 1647 PROFILE(heap_->isolate(), |
| 1648 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); | 1648 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); |
| (...skipping 2245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3894 // The target is always in old space, we don't have to record the slot in | 3894 // The target is always in old space, we don't have to record the slot in |
| 3895 // the old-to-new remembered set. | 3895 // the old-to-new remembered set. |
| 3896 DCHECK(!heap()->InNewSpace(target)); | 3896 DCHECK(!heap()->InNewSpace(target)); |
| 3897 RecordRelocSlot(host, &rinfo, target); | 3897 RecordRelocSlot(host, &rinfo, target); |
| 3898 } | 3898 } |
| 3899 } | 3899 } |
| 3900 } | 3900 } |
| 3901 | 3901 |
| 3902 } // namespace internal | 3902 } // namespace internal |
| 3903 } // namespace v8 | 3903 } // namespace v8 |
| OLD | NEW |