| 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 453 } |
| 454 UNREACHABLE(); | 454 UNREACHABLE(); |
| 455 return false; | 455 return false; |
| 456 } | 456 } |
| 457 | 457 |
| 458 void Heap::CopyBlock(Address dst, Address src, int byte_size) { | 458 void Heap::CopyBlock(Address dst, Address src, int byte_size) { |
| 459 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src), | 459 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src), |
| 460 static_cast<size_t>(byte_size / kPointerSize)); | 460 static_cast<size_t>(byte_size / kPointerSize)); |
| 461 } | 461 } |
| 462 | 462 |
| 463 void Heap::UpdateNewSpaceAllocationCounter() { | |
| 464 new_space_allocation_counter_ = NewSpaceAllocationCounter(); | |
| 465 } | |
| 466 | |
| 467 size_t Heap::NewSpaceAllocationCounter() { | |
| 468 return new_space_allocation_counter_ + new_space()->AllocatedSinceLastGC(); | |
| 469 } | |
| 470 | |
| 471 template <Heap::FindMementoMode mode> | 463 template <Heap::FindMementoMode mode> |
| 472 AllocationMemento* Heap::FindAllocationMemento(HeapObject* object) { | 464 AllocationMemento* Heap::FindAllocationMemento(HeapObject* object) { |
| 473 // Check if there is potentially a memento behind the object. If | 465 // Check if there is potentially a memento behind the object. If |
| 474 // the last word of the memento is on another page we return | 466 // the last word of the memento is on another page we return |
| 475 // immediately. | 467 // immediately. |
| 476 Address object_address = object->address(); | 468 Address object_address = object->address(); |
| 477 Address memento_address = object_address + object->Size(); | 469 Address memento_address = object_address + object->Size(); |
| 478 Address last_memento_word_address = memento_address + kPointerSize; | 470 Address last_memento_word_address = memento_address + kPointerSize; |
| 479 if (!Page::OnSamePage(object_address, last_memento_word_address)) { | 471 if (!Page::OnSamePage(object_address, last_memento_word_address)) { |
| 480 return nullptr; | 472 return nullptr; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 | 734 |
| 743 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 735 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 744 for (Object** current = start; current < end; current++) { | 736 for (Object** current = start; current < end; current++) { |
| 745 CHECK((*current)->IsSmi()); | 737 CHECK((*current)->IsSmi()); |
| 746 } | 738 } |
| 747 } | 739 } |
| 748 } // namespace internal | 740 } // namespace internal |
| 749 } // namespace v8 | 741 } // namespace v8 |
| 750 | 742 |
| 751 #endif // V8_HEAP_HEAP_INL_H_ | 743 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |