| 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 Address allocateObject(size_t allocationSize, size_t gcInfoIndex); | 775 Address allocateObject(size_t allocationSize, size_t gcInfoIndex); |
| 776 | 776 |
| 777 void freePage(NormalPage*); | 777 void freePage(NormalPage*); |
| 778 | 778 |
| 779 bool coalesce(); | 779 bool coalesce(); |
| 780 void promptlyFreeObject(HeapObjectHeader*); | 780 void promptlyFreeObject(HeapObjectHeader*); |
| 781 bool expandObject(HeapObjectHeader*, size_t); | 781 bool expandObject(HeapObjectHeader*, size_t); |
| 782 bool shrinkObject(HeapObjectHeader*, size_t); | 782 bool shrinkObject(HeapObjectHeader*, size_t); |
| 783 void decreasePromptlyFreedSize(size_t size) { m_promptlyFreedSize -= size; } | 783 void decreasePromptlyFreedSize(size_t size) { m_promptlyFreedSize -= size; } |
| 784 | 784 |
| 785 bool isObjectAllocatedAtAllocationPoint(HeapObjectHeader* header) |
| 786 { |
| 787 return header->payloadEnd() == m_currentAllocationPoint; |
| 788 } |
| 789 |
| 785 private: | 790 private: |
| 786 void allocatePage(); | 791 void allocatePage(); |
| 787 Address lazySweepPages(size_t, size_t gcInfoIndex) override; | 792 Address lazySweepPages(size_t, size_t gcInfoIndex) override; |
| 788 Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex); | 793 Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex); |
| 789 Address currentAllocationPoint() const { return m_currentAllocationPoint; } | 794 Address currentAllocationPoint() const { return m_currentAllocationPoint; } |
| 790 size_t remainingAllocationSize() const { return m_remainingAllocationSize; } | 795 size_t remainingAllocationSize() const { return m_remainingAllocationSize; } |
| 791 bool hasCurrentAllocationArea() const { return currentAllocationPoint() && r
emainingAllocationSize(); } | 796 bool hasCurrentAllocationArea() const { return currentAllocationPoint() && r
emainingAllocationSize(); } |
| 792 void setAllocationPoint(Address, size_t); | 797 void setAllocationPoint(Address, size_t); |
| 793 void updateRemainingAllocationSize(); | 798 void updateRemainingAllocationSize(); |
| 794 Address allocateFromFreeList(size_t, size_t gcInfoIndex); | 799 Address allocateFromFreeList(size_t, size_t gcInfoIndex); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader))
; | 948 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader))
; |
| 944 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); | 949 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); |
| 945 return result; | 950 return result; |
| 946 } | 951 } |
| 947 return outOfLineAllocate(allocationSize, gcInfoIndex); | 952 return outOfLineAllocate(allocationSize, gcInfoIndex); |
| 948 } | 953 } |
| 949 | 954 |
| 950 } // namespace blink | 955 } // namespace blink |
| 951 | 956 |
| 952 #endif // HeapPage_h | 957 #endif // HeapPage_h |
| OLD | NEW |