Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapPage.h

Issue 1393863004: Oilpan: always shrink tail-allocated backing storage (reland.) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle no-op shrink attempts Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapAllocator.cpp ('k') | third_party/WebKit/Source/platform/heap/HeapPage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698