OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 bool shrinkObject(HeapObjectHeader*, size_t); | 713 bool shrinkObject(HeapObjectHeader*, size_t); |
714 void decreasePromptlyFreedSize(size_t size) { m_promptlyFreedSize -= size; } | 714 void decreasePromptlyFreedSize(size_t size) { m_promptlyFreedSize -= size; } |
715 | 715 |
716 bool isObjectAllocatedAtAllocationPoint(HeapObjectHeader* header) | 716 bool isObjectAllocatedAtAllocationPoint(HeapObjectHeader* header) |
717 { | 717 { |
718 return header->payloadEnd() == m_currentAllocationPoint; | 718 return header->payloadEnd() == m_currentAllocationPoint; |
719 } | 719 } |
720 | 720 |
721 private: | 721 private: |
722 void allocatePage(); | 722 void allocatePage(); |
| 723 Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex); |
| 724 Address allocateFromFreeList(size_t, size_t gcInfoIndex); |
| 725 |
723 Address lazySweepPages(size_t, size_t gcInfoIndex) override; | 726 Address lazySweepPages(size_t, size_t gcInfoIndex) override; |
724 Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex); | 727 |
725 Address currentAllocationPoint() const { return m_currentAllocationPoint; } | 728 Address currentAllocationPoint() const { return m_currentAllocationPoint; } |
726 size_t remainingAllocationSize() const { return m_remainingAllocationSize; } | |
727 bool hasCurrentAllocationArea() const { return currentAllocationPoint() && r
emainingAllocationSize(); } | 729 bool hasCurrentAllocationArea() const { return currentAllocationPoint() && r
emainingAllocationSize(); } |
728 void setAllocationPoint(Address, size_t); | 730 void setAllocationPoint(Address, size_t); |
| 731 |
| 732 size_t remainingAllocationSize() const { return m_remainingAllocationSize; } |
| 733 void setRemainingAllocationSize(size_t); |
729 void updateRemainingAllocationSize(); | 734 void updateRemainingAllocationSize(); |
730 Address allocateFromFreeList(size_t, size_t gcInfoIndex); | |
731 | 735 |
732 FreeList m_freeList; | 736 FreeList m_freeList; |
733 Address m_currentAllocationPoint; | 737 Address m_currentAllocationPoint; |
734 size_t m_remainingAllocationSize; | 738 size_t m_remainingAllocationSize; |
735 size_t m_lastRemainingAllocationSize; | 739 size_t m_lastRemainingAllocationSize; |
736 | 740 |
737 // The size of promptly freed objects in the heap. | 741 // The size of promptly freed objects in the heap. |
738 size_t m_promptlyFreedSize; | 742 size_t m_promptlyFreedSize; |
739 }; | 743 }; |
740 | 744 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader))
; | 869 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader))
; |
866 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); | 870 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); |
867 return result; | 871 return result; |
868 } | 872 } |
869 return outOfLineAllocate(allocationSize, gcInfoIndex); | 873 return outOfLineAllocate(allocationSize, gcInfoIndex); |
870 } | 874 } |
871 | 875 |
872 } // namespace blink | 876 } // namespace blink |
873 | 877 |
874 #endif // HeapPage_h | 878 #endif // HeapPage_h |
OLD | NEW |