| 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 *size_in_bytes += filler_size; | 491 *size_in_bytes += filler_size; |
| 492 return heap()->PrecedeWithFiller(HeapObject::FromAddress(current_top), | 492 return heap()->PrecedeWithFiller(HeapObject::FromAddress(current_top), |
| 493 filler_size); | 493 filler_size); |
| 494 } | 494 } |
| 495 | 495 |
| 496 return HeapObject::FromAddress(current_top); | 496 return HeapObject::FromAddress(current_top); |
| 497 } | 497 } |
| 498 | 498 |
| 499 | 499 |
| 500 // Raw allocation. | 500 // Raw allocation. |
| 501 AllocationResult PagedSpace::AllocateRawUnaligned(int size_in_bytes) { | 501 AllocationResult PagedSpace::AllocateRawUnaligned( |
| 502 int size_in_bytes, UpdateSkipList update_skip_list) { |
| 502 HeapObject* object = AllocateLinearly(size_in_bytes); | 503 HeapObject* object = AllocateLinearly(size_in_bytes); |
| 503 | 504 |
| 504 if (object == NULL) { | 505 if (object == NULL) { |
| 505 object = free_list_.Allocate(size_in_bytes); | 506 object = free_list_.Allocate(size_in_bytes); |
| 506 if (object == NULL) { | 507 if (object == NULL) { |
| 507 object = SlowAllocateRaw(size_in_bytes); | 508 object = SlowAllocateRaw(size_in_bytes); |
| 508 } | 509 } |
| 509 } | 510 } |
| 510 | 511 |
| 511 if (object != NULL) { | 512 if (object != NULL) { |
| 512 if (identity() == CODE_SPACE) { | 513 if (update_skip_list == UPDATE_SKIP_LIST && identity() == CODE_SPACE) { |
| 513 SkipList::Update(object->address(), size_in_bytes); | 514 SkipList::Update(object->address(), size_in_bytes); |
| 514 } | 515 } |
| 515 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), size_in_bytes); | 516 MSAN_ALLOCATED_UNINITIALIZED_MEMORY(object->address(), size_in_bytes); |
| 516 return object; | 517 return object; |
| 517 } | 518 } |
| 518 | 519 |
| 519 return AllocationResult::Retry(identity()); | 520 return AllocationResult::Retry(identity()); |
| 520 } | 521 } |
| 521 | 522 |
| 522 | 523 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 other->allocation_info_.Reset(nullptr, nullptr); | 690 other->allocation_info_.Reset(nullptr, nullptr); |
| 690 return true; | 691 return true; |
| 691 } | 692 } |
| 692 return false; | 693 return false; |
| 693 } | 694 } |
| 694 | 695 |
| 695 } // namespace internal | 696 } // namespace internal |
| 696 } // namespace v8 | 697 } // namespace v8 |
| 697 | 698 |
| 698 #endif // V8_HEAP_SPACES_INL_H_ | 699 #endif // V8_HEAP_SPACES_INL_H_ |
| OLD | NEW |