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

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

Issue 1409023004: [heap] Report proper OOM failure if semi-space copy fails. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | src/heap/scavenger.cc » ('j') | 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 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 TryPromoteObject(object, size)) { 1712 TryPromoteObject(object, size)) {
1713 continue; 1713 continue;
1714 } 1714 }
1715 1715
1716 AllocationAlignment alignment = object->RequiredAlignment(); 1716 AllocationAlignment alignment = object->RequiredAlignment();
1717 AllocationResult allocation = new_space->AllocateRaw(size, alignment); 1717 AllocationResult allocation = new_space->AllocateRaw(size, alignment);
1718 if (allocation.IsRetry()) { 1718 if (allocation.IsRetry()) {
1719 if (!new_space->AddFreshPage()) { 1719 if (!new_space->AddFreshPage()) {
1720 // Shouldn't happen. We are sweeping linearly, and to-space 1720 // Shouldn't happen. We are sweeping linearly, and to-space
1721 // has the same number of pages as from-space, so there is 1721 // has the same number of pages as from-space, so there is
1722 // always room. 1722 // always room unless we are in an OOM situation.
1723 UNREACHABLE(); 1723 FatalProcessOutOfMemory("MarkCompactCollector: semi-space copy\n");
1724 } 1724 }
1725 allocation = new_space->AllocateRaw(size, alignment); 1725 allocation = new_space->AllocateRaw(size, alignment);
1726 DCHECK(!allocation.IsRetry()); 1726 DCHECK(!allocation.IsRetry());
1727 } 1727 }
1728 Object* target = allocation.ToObjectChecked(); 1728 Object* target = allocation.ToObjectChecked();
1729 1729
1730 MigrateObject(HeapObject::cast(target), object, size, NEW_SPACE, nullptr); 1730 MigrateObject(HeapObject::cast(target), object, size, NEW_SPACE, nullptr);
1731 if (V8_UNLIKELY(target->IsJSArrayBuffer())) { 1731 if (V8_UNLIKELY(target->IsJSArrayBuffer())) {
1732 heap()->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(target)); 1732 heap()->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(target));
1733 } 1733 }
(...skipping 2905 matching lines...) Expand 10 before | Expand all | Expand 10 after
4639 MarkBit mark_bit = Marking::MarkBitFrom(host); 4639 MarkBit mark_bit = Marking::MarkBitFrom(host);
4640 if (Marking::IsBlack(mark_bit)) { 4640 if (Marking::IsBlack(mark_bit)) {
4641 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); 4641 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
4642 RecordRelocSlot(&rinfo, target); 4642 RecordRelocSlot(&rinfo, target);
4643 } 4643 }
4644 } 4644 }
4645 } 4645 }
4646 4646
4647 } // namespace internal 4647 } // namespace internal
4648 } // namespace v8 4648 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698