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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 | 386 |
387 bool Heap::InOldSpaceSlow(Address address) { | 387 bool Heap::InOldSpaceSlow(Address address) { |
388 return old_space_->ContainsSlow(address); | 388 return old_space_->ContainsSlow(address); |
389 } | 389 } |
390 | 390 |
391 bool Heap::OldGenerationAllocationLimitReached() { | 391 bool Heap::OldGenerationAllocationLimitReached() { |
392 if (!incremental_marking()->IsStopped()) return false; | 392 if (!incremental_marking()->IsStopped()) return false; |
393 return OldGenerationSpaceAvailable() < 0; | 393 return OldGenerationSpaceAvailable() < 0; |
394 } | 394 } |
395 | 395 |
396 | 396 template <MarksHandling marks_handling> |
397 bool Heap::ShouldBePromoted(Address old_address, int object_size) { | 397 bool Heap::ShouldBePromoted(Address old_address, int object_size) { |
398 Page* page = Page::FromAddress(old_address); | 398 Page* page = Page::FromAddress(old_address); |
399 Address age_mark = new_space_.age_mark(); | 399 Address age_mark = new_space_.age_mark(); |
400 | |
401 if (marks_handling == TRANSFER_MARKS) { | |
Michael Lippautz
2016/05/24 11:54:51
TRANSFER_MARKS is a confusing name for this one as
| |
402 MarkBit mark_bit = Marking::MarkBitFrom(old_address); | |
403 if (!Marking::IsWhite(mark_bit)) { | |
404 return true; | |
405 } | |
406 } | |
407 | |
400 return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) && | 408 return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) && |
401 (!page->ContainsLimit(age_mark) || old_address < age_mark); | 409 (!page->ContainsLimit(age_mark) || old_address < age_mark); |
402 } | 410 } |
403 | 411 |
404 void Heap::RecordWrite(Object* object, int offset, Object* o) { | 412 void Heap::RecordWrite(Object* object, int offset, Object* o) { |
405 if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) { | 413 if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) { |
406 return; | 414 return; |
407 } | 415 } |
408 RememberedSet<OLD_TO_NEW>::Insert( | 416 RememberedSet<OLD_TO_NEW>::Insert( |
409 Page::FromAddress(reinterpret_cast<Address>(object)), | 417 Page::FromAddress(reinterpret_cast<Address>(object)), |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
734 | 742 |
735 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 743 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
736 for (Object** current = start; current < end; current++) { | 744 for (Object** current = start; current < end; current++) { |
737 CHECK((*current)->IsSmi()); | 745 CHECK((*current)->IsSmi()); |
738 } | 746 } |
739 } | 747 } |
740 } // namespace internal | 748 } // namespace internal |
741 } // namespace v8 | 749 } // namespace v8 |
742 | 750 |
743 #endif // V8_HEAP_HEAP_INL_H_ | 751 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |