| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/spaces.h" | 5 #include "src/heap/spaces.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2930 MarkCompactCollector* collector = heap()->mark_compact_collector(); | 2930 MarkCompactCollector* collector = heap()->mark_compact_collector(); |
| 2931 if (collector->sweeping_in_progress()) { | 2931 if (collector->sweeping_in_progress()) { |
| 2932 collector->SweepAndRefill(this); | 2932 collector->SweepAndRefill(this); |
| 2933 return free_list_.Allocate(size_in_bytes); | 2933 return free_list_.Allocate(size_in_bytes); |
| 2934 } | 2934 } |
| 2935 return nullptr; | 2935 return nullptr; |
| 2936 } | 2936 } |
| 2937 | 2937 |
| 2938 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { | 2938 HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { |
| 2939 VMState<GC> state(heap()->isolate()); | 2939 VMState<GC> state(heap()->isolate()); |
| 2940 RuntimeCallTimerScope(heap()->isolate(), | 2940 RuntimeCallTimerScope runtime_timer(heap()->isolate(), |
| 2941 &RuntimeCallStats::GC_SlowAllocateRaw); | 2941 &RuntimeCallStats::GC_SlowAllocateRaw); |
| 2942 return RawSlowAllocateRaw(size_in_bytes); | 2942 return RawSlowAllocateRaw(size_in_bytes); |
| 2943 } | 2943 } |
| 2944 | 2944 |
| 2945 HeapObject* CompactionSpace::SlowAllocateRaw(int size_in_bytes) { | 2945 HeapObject* CompactionSpace::SlowAllocateRaw(int size_in_bytes) { |
| 2946 return RawSlowAllocateRaw(size_in_bytes); | 2946 return RawSlowAllocateRaw(size_in_bytes); |
| 2947 } | 2947 } |
| 2948 | 2948 |
| 2949 HeapObject* PagedSpace::RawSlowAllocateRaw(int size_in_bytes) { | 2949 HeapObject* PagedSpace::RawSlowAllocateRaw(int size_in_bytes) { |
| 2950 // Allocation in this space has failed. | 2950 // Allocation in this space has failed. |
| 2951 DCHECK_GE(size_in_bytes, 0); | 2951 DCHECK_GE(size_in_bytes, 0); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3383 PrintF("\n"); | 3383 PrintF("\n"); |
| 3384 } | 3384 } |
| 3385 printf(" --------------------------------------\n"); | 3385 printf(" --------------------------------------\n"); |
| 3386 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, | 3386 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, |
| 3387 MarkingState::Internal(this).live_bytes()); | 3387 MarkingState::Internal(this).live_bytes()); |
| 3388 } | 3388 } |
| 3389 | 3389 |
| 3390 #endif // DEBUG | 3390 #endif // DEBUG |
| 3391 } // namespace internal | 3391 } // namespace internal |
| 3392 } // namespace v8 | 3392 } // namespace v8 |
| OLD | NEW |