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 #ifndef V8_HEAP_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
7 | 7 |
8 #include "src/heap/incremental-marking.h" | 8 #include "src/heap/incremental-marking.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 return object; | 455 return object; |
456 } | 456 } |
457 | 457 |
458 return AllocationResult::Retry(identity()); | 458 return AllocationResult::Retry(identity()); |
459 } | 459 } |
460 | 460 |
461 | 461 |
462 AllocationResult PagedSpace::AllocateRaw(int size_in_bytes, | 462 AllocationResult PagedSpace::AllocateRaw(int size_in_bytes, |
463 AllocationAlignment alignment) { | 463 AllocationAlignment alignment) { |
464 #ifdef V8_HOST_ARCH_32_BIT | 464 #ifdef V8_HOST_ARCH_32_BIT |
465 return alignment == kDoubleAligned | 465 AllocationResult result = |
466 ? AllocateRawAligned(size_in_bytes, kDoubleAligned) | 466 alignment == kDoubleAligned |
467 : AllocateRawUnaligned(size_in_bytes); | 467 ? AllocateRawAligned(size_in_bytes, kDoubleAligned) |
| 468 : AllocateRawUnaligned(size_in_bytes); |
468 #else | 469 #else |
469 return AllocateRawUnaligned(size_in_bytes); | 470 AllocationResult result = AllocateRawUnaligned(size_in_bytes); |
470 #endif | 471 #endif |
| 472 HeapObject* heap_obj = nullptr; |
| 473 if (!result.IsRetry() && result.To(&heap_obj)) { |
| 474 AllocationStep(heap_obj->address(), size_in_bytes); |
| 475 } |
| 476 return result; |
471 } | 477 } |
472 | 478 |
473 | 479 |
474 // ----------------------------------------------------------------------------- | 480 // ----------------------------------------------------------------------------- |
475 // NewSpace | 481 // NewSpace |
476 | 482 |
477 | 483 |
478 AllocationResult NewSpace::AllocateRawAligned(int size_in_bytes, | 484 AllocationResult NewSpace::AllocateRawAligned(int size_in_bytes, |
479 AllocationAlignment alignment) { | 485 AllocationAlignment alignment) { |
480 Address top = allocation_info_.top(); | 486 Address top = allocation_info_.top(); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 other->allocation_info_.Reset(nullptr, nullptr); | 587 other->allocation_info_.Reset(nullptr, nullptr); |
582 return true; | 588 return true; |
583 } | 589 } |
584 return false; | 590 return false; |
585 } | 591 } |
586 | 592 |
587 } // namespace internal | 593 } // namespace internal |
588 } // namespace v8 | 594 } // namespace v8 |
589 | 595 |
590 #endif // V8_HEAP_SPACES_INL_H_ | 596 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |