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/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 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 TryPromoteObject(object, size)) { |
1866 continue; | 1866 continue; |
1867 } | 1867 } |
1868 heap()->set_promotion_failure(true); | |
1869 | 1868 |
1870 AllocationResult allocation = new_space->AllocateRaw(size); | 1869 AllocationResult allocation = new_space->AllocateRaw(size); |
1871 if (allocation.IsRetry()) { | 1870 if (allocation.IsRetry()) { |
1872 if (!new_space->AddFreshPage()) { | 1871 if (!new_space->AddFreshPage()) { |
1873 // Shouldn't happen. We are sweeping linearly, and to-space | 1872 // Shouldn't happen. We are sweeping linearly, and to-space |
1874 // has the same number of pages as from-space, so there is | 1873 // has the same number of pages as from-space, so there is |
1875 // always room. | 1874 // always room. |
1876 UNREACHABLE(); | 1875 UNREACHABLE(); |
1877 } | 1876 } |
1878 allocation = new_space->AllocateRaw(size); | 1877 allocation = new_space->AllocateRaw(size); |
(...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4328 SlotsBuffer* buffer = *buffer_address; | 4327 SlotsBuffer* buffer = *buffer_address; |
4329 while (buffer != NULL) { | 4328 while (buffer != NULL) { |
4330 SlotsBuffer* next_buffer = buffer->next(); | 4329 SlotsBuffer* next_buffer = buffer->next(); |
4331 DeallocateBuffer(buffer); | 4330 DeallocateBuffer(buffer); |
4332 buffer = next_buffer; | 4331 buffer = next_buffer; |
4333 } | 4332 } |
4334 *buffer_address = NULL; | 4333 *buffer_address = NULL; |
4335 } | 4334 } |
4336 } | 4335 } |
4337 } // namespace v8::internal | 4336 } // namespace v8::internal |
OLD | NEW |