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 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1623 inline void MigrateObject(HeapObject* dst, HeapObject* src, int size, | 1623 inline void MigrateObject(HeapObject* dst, HeapObject* src, int size, |
1624 AllocationSpace dest) { | 1624 AllocationSpace dest) { |
1625 Address dst_addr = dst->address(); | 1625 Address dst_addr = dst->address(); |
1626 Address src_addr = src->address(); | 1626 Address src_addr = src->address(); |
1627 DCHECK(heap_->AllowedToBeMigrated(src, dest)); | 1627 DCHECK(heap_->AllowedToBeMigrated(src, dest)); |
1628 DCHECK(dest != LO_SPACE); | 1628 DCHECK(dest != LO_SPACE); |
1629 if (dest == OLD_SPACE) { | 1629 if (dest == OLD_SPACE) { |
1630 DCHECK_OBJECT_SIZE(size); | 1630 DCHECK_OBJECT_SIZE(size); |
1631 DCHECK(IsAligned(size, kPointerSize)); | 1631 DCHECK(IsAligned(size, kPointerSize)); |
1632 heap_->CopyBlock(dst_addr, src_addr, size); | 1632 heap_->CopyBlock(dst_addr, src_addr, size); |
1633 if ((mode == kProfiled) && dst->IsBytecodeArray()) { | 1633 if ((mode == kProfiled) && FLAG_ignition && dst->IsBytecodeArray()) { |
1634 PROFILE(heap_->isolate(), | 1634 PROFILE(heap_->isolate(), |
1635 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); | 1635 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); |
1636 } | 1636 } |
1637 RecordMigratedSlotVisitor visitor(heap_->mark_compact_collector()); | 1637 RecordMigratedSlotVisitor visitor(heap_->mark_compact_collector()); |
1638 dst->IterateBodyFast(dst->map()->instance_type(), size, &visitor); | 1638 dst->IterateBodyFast(dst->map()->instance_type(), size, &visitor); |
1639 } else if (dest == CODE_SPACE) { | 1639 } else if (dest == CODE_SPACE) { |
1640 DCHECK_CODEOBJECT_SIZE(size, heap_->code_space()); | 1640 DCHECK_CODEOBJECT_SIZE(size, heap_->code_space()); |
1641 if (mode == kProfiled) { | 1641 if (mode == kProfiled) { |
1642 PROFILE(heap_->isolate(), | 1642 PROFILE(heap_->isolate(), |
1643 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); | 1643 CodeMoveEvent(AbstractCode::cast(src), dst_addr)); |
(...skipping 2375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4019 // The target is always in old space, we don't have to record the slot in | 4019 // The target is always in old space, we don't have to record the slot in |
4020 // the old-to-new remembered set. | 4020 // the old-to-new remembered set. |
4021 DCHECK(!heap()->InNewSpace(target)); | 4021 DCHECK(!heap()->InNewSpace(target)); |
4022 RecordRelocSlot(host, &rinfo, target); | 4022 RecordRelocSlot(host, &rinfo, target); |
4023 } | 4023 } |
4024 } | 4024 } |
4025 } | 4025 } |
4026 | 4026 |
4027 } // namespace internal | 4027 } // namespace internal |
4028 } // namespace v8 | 4028 } // namespace v8 |
OLD | NEW |