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

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

Issue 977013003: Remove promotion backup case and report OOM instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « src/heap/heap.cc ('k') | 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/v8.h" 5 #include "src/v8.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/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 1854
1855 int size = object->Size(); 1855 int size = object->Size();
1856 survivors_size += size; 1856 survivors_size += size;
1857 1857
1858 Heap::UpdateAllocationSiteFeedback(object, Heap::RECORD_SCRATCHPAD_SLOT); 1858 Heap::UpdateAllocationSiteFeedback(object, Heap::RECORD_SCRATCHPAD_SLOT);
1859 1859
1860 offset++; 1860 offset++;
1861 current_cell >>= 1; 1861 current_cell >>= 1;
1862 1862
1863 // TODO(hpayer): Refactor EvacuateObject and call this function instead. 1863 // TODO(hpayer): Refactor EvacuateObject and call this function instead.
1864 if (heap()->ShouldBePromoted(object->address(), size) && 1864 if (heap()->ShouldBePromoted(object->address(), size)) {
1865 TryPromoteObject(object, size)) { 1865 if (!TryPromoteObject(object, size)) {
1866 continue; 1866 V8::FatalProcessOutOfMemory("Full GC promotion failed");
1867 }
1868 } else {
1869 AllocationResult allocation = new_space->AllocateRaw(size);
1870 if (allocation.IsRetry()) {
1871 if (!new_space->AddFreshPage()) {
1872 // Shouldn't happen. We are sweeping linearly, and to-space
1873 // has the same number of pages as from-space, so there is
1874 // always room.
1875 UNREACHABLE();
1876 }
1877 allocation = new_space->AllocateRaw(size);
1878 DCHECK(!allocation.IsRetry());
1879 }
1880 Object* target = allocation.ToObjectChecked();
1881
1882 MigrateObject(HeapObject::cast(target), object, size, NEW_SPACE);
1883 heap()->IncrementSemiSpaceCopiedObjectSize(size);
1867 } 1884 }
1868
1869 AllocationResult allocation = new_space->AllocateRaw(size);
1870 if (allocation.IsRetry()) {
1871 if (!new_space->AddFreshPage()) {
1872 // Shouldn't happen. We are sweeping linearly, and to-space
1873 // has the same number of pages as from-space, so there is
1874 // always room.
1875 UNREACHABLE();
1876 }
1877 allocation = new_space->AllocateRaw(size);
1878 DCHECK(!allocation.IsRetry());
1879 }
1880 Object* target = allocation.ToObjectChecked();
1881
1882 MigrateObject(HeapObject::cast(target), object, size, NEW_SPACE);
1883 heap()->IncrementSemiSpaceCopiedObjectSize(size);
1884 } 1885 }
1885 *cells = 0; 1886 *cells = 0;
1886 } 1887 }
1887 return survivors_size; 1888 return survivors_size;
1888 } 1889 }
1889 1890
1890 1891
1891 static void DiscoverGreyObjectsInSpace(Heap* heap, MarkingDeque* marking_deque, 1892 static void DiscoverGreyObjectsInSpace(Heap* heap, MarkingDeque* marking_deque,
1892 PagedSpace* space) { 1893 PagedSpace* space) {
1893 PageIterator it(space); 1894 PageIterator it(space);
(...skipping 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after
4415 SlotsBuffer* buffer = *buffer_address; 4416 SlotsBuffer* buffer = *buffer_address;
4416 while (buffer != NULL) { 4417 while (buffer != NULL) {
4417 SlotsBuffer* next_buffer = buffer->next(); 4418 SlotsBuffer* next_buffer = buffer->next();
4418 DeallocateBuffer(buffer); 4419 DeallocateBuffer(buffer);
4419 buffer = next_buffer; 4420 buffer = next_buffer;
4420 } 4421 }
4421 *buffer_address = NULL; 4422 *buffer_address = NULL;
4422 } 4423 }
4423 } 4424 }
4424 } // namespace v8::internal 4425 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698