| 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 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
| 6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 DCHECK(gc_state_ == NOT_IN_GC); | 319 DCHECK(gc_state_ == NOT_IN_GC); |
| 320 #ifdef DEBUG | 320 #ifdef DEBUG |
| 321 if (FLAG_gc_interval >= 0 && !always_allocate() && | 321 if (FLAG_gc_interval >= 0 && !always_allocate() && |
| 322 Heap::allocation_timeout_-- <= 0) { | 322 Heap::allocation_timeout_-- <= 0) { |
| 323 return AllocationResult::Retry(space); | 323 return AllocationResult::Retry(space); |
| 324 } | 324 } |
| 325 isolate_->counters()->objs_since_last_full()->Increment(); | 325 isolate_->counters()->objs_since_last_full()->Increment(); |
| 326 isolate_->counters()->objs_since_last_young()->Increment(); | 326 isolate_->counters()->objs_since_last_young()->Increment(); |
| 327 #endif | 327 #endif |
| 328 | 328 |
| 329 bool large_object = size_in_bytes > Page::kMaxRegularHeapObjectSize; | 329 bool large_object = size_in_bytes > kMaxRegularHeapObjectSize; |
| 330 HeapObject* object = nullptr; | 330 HeapObject* object = nullptr; |
| 331 AllocationResult allocation; | 331 AllocationResult allocation; |
| 332 if (NEW_SPACE == space) { | 332 if (NEW_SPACE == space) { |
| 333 if (large_object) { | 333 if (large_object) { |
| 334 space = LO_SPACE; | 334 space = LO_SPACE; |
| 335 } else { | 335 } else { |
| 336 allocation = new_space_.AllocateRaw(size_in_bytes, alignment); | 336 allocation = new_space_.AllocateRaw(size_in_bytes, alignment); |
| 337 if (allocation.To(&object)) { | 337 if (allocation.To(&object)) { |
| 338 OnAllocationEvent(object, size_in_bytes); | 338 OnAllocationEvent(object, size_in_bytes); |
| 339 } | 339 } |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 | 876 |
| 877 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 877 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 878 for (Object** current = start; current < end; current++) { | 878 for (Object** current = start; current < end; current++) { |
| 879 CHECK((*current)->IsSmi()); | 879 CHECK((*current)->IsSmi()); |
| 880 } | 880 } |
| 881 } | 881 } |
| 882 } // namespace internal | 882 } // namespace internal |
| 883 } // namespace v8 | 883 } // namespace v8 |
| 884 | 884 |
| 885 #endif // V8_HEAP_HEAP_INL_H_ | 885 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |