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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "code-stubs.h" | 7 #include "code-stubs.h" |
8 #include "compilation-cache.h" | 8 #include "compilation-cache.h" |
9 #include "cpu-profiler.h" | 9 #include "cpu-profiler.h" |
10 #include "deoptimizer.h" | 10 #include "deoptimizer.h" |
(...skipping 3012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3023 | 3023 |
3024 return false; | 3024 return false; |
3025 } | 3025 } |
3026 | 3026 |
3027 | 3027 |
3028 void MarkCompactCollector::EvacuateNewSpace() { | 3028 void MarkCompactCollector::EvacuateNewSpace() { |
3029 // There are soft limits in the allocation code, designed trigger a mark | 3029 // There are soft limits in the allocation code, designed trigger a mark |
3030 // sweep collection by failing allocations. But since we are already in | 3030 // sweep collection by failing allocations. But since we are already in |
3031 // a mark-sweep allocation, there is no sense in trying to trigger one. | 3031 // a mark-sweep allocation, there is no sense in trying to trigger one. |
3032 AlwaysAllocateScope scope(isolate()); | 3032 AlwaysAllocateScope scope(isolate()); |
3033 heap()->CheckNewSpaceExpansionCriteria(); | |
3034 | 3033 |
3035 NewSpace* new_space = heap()->new_space(); | 3034 NewSpace* new_space = heap()->new_space(); |
3036 | 3035 |
3037 // Store allocation range before flipping semispaces. | 3036 // Store allocation range before flipping semispaces. |
3038 Address from_bottom = new_space->bottom(); | 3037 Address from_bottom = new_space->bottom(); |
3039 Address from_top = new_space->top(); | 3038 Address from_top = new_space->top(); |
3040 | 3039 |
3041 // Flip the semispaces. After flipping, to space is empty, from space has | 3040 // Flip the semispaces. After flipping, to space is empty, from space has |
3042 // live objects. | 3041 // live objects. |
3043 new_space->Flip(); | 3042 new_space->Flip(); |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4465 while (buffer != NULL) { | 4464 while (buffer != NULL) { |
4466 SlotsBuffer* next_buffer = buffer->next(); | 4465 SlotsBuffer* next_buffer = buffer->next(); |
4467 DeallocateBuffer(buffer); | 4466 DeallocateBuffer(buffer); |
4468 buffer = next_buffer; | 4467 buffer = next_buffer; |
4469 } | 4468 } |
4470 *buffer_address = NULL; | 4469 *buffer_address = NULL; |
4471 } | 4470 } |
4472 | 4471 |
4473 | 4472 |
4474 } } // namespace v8::internal | 4473 } } // namespace v8::internal |
OLD | NEW |