Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: src/heap/mark-compact.cc

Issue 2312153002: Merged: [heap] Properly propagate allocated space during new space evacuaton in MC (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 enum NewSpaceAllocationMode { 1775 enum NewSpaceAllocationMode {
1776 kNonstickyBailoutOldSpace, 1776 kNonstickyBailoutOldSpace,
1777 kStickyBailoutOldSpace, 1777 kStickyBailoutOldSpace,
1778 }; 1778 };
1779 1779
1780 inline AllocationSpace AllocateTargetObject(HeapObject* old_object, 1780 inline AllocationSpace AllocateTargetObject(HeapObject* old_object,
1781 HeapObject** target_object) { 1781 HeapObject** target_object) {
1782 const int size = old_object->Size(); 1782 const int size = old_object->Size();
1783 AllocationAlignment alignment = old_object->RequiredAlignment(); 1783 AllocationAlignment alignment = old_object->RequiredAlignment();
1784 AllocationResult allocation; 1784 AllocationResult allocation;
1785 AllocationSpace space_allocated_in = space_to_allocate_;
1785 if (space_to_allocate_ == NEW_SPACE) { 1786 if (space_to_allocate_ == NEW_SPACE) {
1786 if (size > kMaxLabObjectSize) { 1787 if (size > kMaxLabObjectSize) {
1787 allocation = 1788 allocation =
1788 AllocateInNewSpace(size, alignment, kNonstickyBailoutOldSpace); 1789 AllocateInNewSpace(size, alignment, kNonstickyBailoutOldSpace);
1789 } else { 1790 } else {
1790 allocation = AllocateInLab(size, alignment); 1791 allocation = AllocateInLab(size, alignment);
1791 } 1792 }
1792 } 1793 }
1793 if (allocation.IsRetry() || (space_to_allocate_ == OLD_SPACE)) { 1794 if (allocation.IsRetry() || (space_to_allocate_ == OLD_SPACE)) {
1794 allocation = AllocateInOldSpace(size, alignment); 1795 allocation = AllocateInOldSpace(size, alignment);
1796 space_allocated_in = OLD_SPACE;
1795 } 1797 }
1796 bool ok = allocation.To(target_object); 1798 bool ok = allocation.To(target_object);
1797 DCHECK(ok); 1799 DCHECK(ok);
1798 USE(ok); 1800 USE(ok);
1799 return space_to_allocate_; 1801 return space_allocated_in;
1800 } 1802 }
1801 1803
1802 inline bool NewLocalAllocationBuffer() { 1804 inline bool NewLocalAllocationBuffer() {
1803 AllocationResult result = 1805 AllocationResult result =
1804 AllocateInNewSpace(kLabSize, kWordAligned, kStickyBailoutOldSpace); 1806 AllocateInNewSpace(kLabSize, kWordAligned, kStickyBailoutOldSpace);
1805 LocalAllocationBuffer saved_old_buffer = buffer_; 1807 LocalAllocationBuffer saved_old_buffer = buffer_;
1806 buffer_ = LocalAllocationBuffer::FromResult(heap_, result, kLabSize); 1808 buffer_ = LocalAllocationBuffer::FromResult(heap_, result, kLabSize);
1807 if (buffer_.IsValid()) { 1809 if (buffer_.IsValid()) {
1808 buffer_.TryMerge(&saved_old_buffer); 1810 buffer_.TryMerge(&saved_old_buffer);
1809 return true; 1811 return true;
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
4063 MarkBit mark_bit = Marking::MarkBitFrom(host); 4065 MarkBit mark_bit = Marking::MarkBitFrom(host);
4064 if (Marking::IsBlack(mark_bit)) { 4066 if (Marking::IsBlack(mark_bit)) {
4065 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); 4067 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
4066 RecordRelocSlot(host, &rinfo, target); 4068 RecordRelocSlot(host, &rinfo, target);
4067 } 4069 }
4068 } 4070 }
4069 } 4071 }
4070 4072
4071 } // namespace internal 4073 } // namespace internal
4072 } // namespace v8 4074 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698