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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 // object of at least word size (the header map word) following it, so | 445 // object of at least word size (the header map word) following it, so |
446 // suffices to compare ptr and top here. Note that technically we do not have | 446 // suffices to compare ptr and top here. Note that technically we do not have |
447 // to compare with the current top pointer of the from space page during GC, | 447 // to compare with the current top pointer of the from space page during GC, |
448 // since we always install filler objects above the top pointer of a from | 448 // since we always install filler objects above the top pointer of a from |
449 // space page when performing a garbage collection. However, always performing | 449 // space page when performing a garbage collection. However, always performing |
450 // the test makes it possible to have a single, unified version of | 450 // the test makes it possible to have a single, unified version of |
451 // FindAllocationMemento that is used both by the GC and the mutator. | 451 // FindAllocationMemento that is used both by the GC and the mutator. |
452 Address top = NewSpaceTop(); | 452 Address top = NewSpaceTop(); |
453 DCHECK(memento_address == top || | 453 DCHECK(memento_address == top || |
454 memento_address + HeapObject::kHeaderSize <= top || | 454 memento_address + HeapObject::kHeaderSize <= top || |
455 !NewSpacePage::OnSamePage(memento_address, top)); | 455 !NewSpacePage::OnSamePage(memento_address, top - 1)); |
456 if (memento_address == top) return NULL; | 456 if (memento_address == top) return NULL; |
457 | 457 |
458 AllocationMemento* memento = AllocationMemento::cast(candidate); | 458 AllocationMemento* memento = AllocationMemento::cast(candidate); |
459 if (!memento->IsValid()) return NULL; | 459 if (!memento->IsValid()) return NULL; |
460 return memento; | 460 return memento; |
461 } | 461 } |
462 | 462 |
463 | 463 |
464 void Heap::UpdateAllocationSiteFeedback(HeapObject* object, | 464 void Heap::UpdateAllocationSiteFeedback(HeapObject* object, |
465 ScratchpadSlotMode mode) { | 465 ScratchpadSlotMode mode) { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 | 682 |
683 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 683 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
684 for (Object** current = start; current < end; current++) { | 684 for (Object** current = start; current < end; current++) { |
685 CHECK((*current)->IsSmi()); | 685 CHECK((*current)->IsSmi()); |
686 } | 686 } |
687 } | 687 } |
688 } | 688 } |
689 } // namespace v8::internal | 689 } // namespace v8::internal |
690 | 690 |
691 #endif // V8_HEAP_HEAP_INL_H_ | 691 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |