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

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

Issue 1395493008: Revert of Oilpan: always shrink tail-allocated backing storage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 Address allocateObject(size_t allocationSize, size_t gcInfoIndex); 774 Address allocateObject(size_t allocationSize, size_t gcInfoIndex);
775 775
776 void freePage(NormalPage*); 776 void freePage(NormalPage*);
777 777
778 bool coalesce(); 778 bool coalesce();
779 void promptlyFreeObject(HeapObjectHeader*); 779 void promptlyFreeObject(HeapObjectHeader*);
780 bool expandObject(HeapObjectHeader*, size_t); 780 bool expandObject(HeapObjectHeader*, size_t);
781 bool shrinkObject(HeapObjectHeader*, size_t); 781 bool shrinkObject(HeapObjectHeader*, size_t);
782 void decreasePromptlyFreedSize(size_t size) { m_promptlyFreedSize -= size; } 782 void decreasePromptlyFreedSize(size_t size) { m_promptlyFreedSize -= size; }
783 783
784 bool isObjectAllocatedAtAllocationPoint(HeapObjectHeader* header)
785 {
786 return header->payloadEnd() == m_currentAllocationPoint;
787 }
788
789 private: 784 private:
790 void allocatePage(); 785 void allocatePage();
791 Address lazySweepPages(size_t, size_t gcInfoIndex) override; 786 Address lazySweepPages(size_t, size_t gcInfoIndex) override;
792 Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex); 787 Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex);
793 Address currentAllocationPoint() const { return m_currentAllocationPoint; } 788 Address currentAllocationPoint() const { return m_currentAllocationPoint; }
794 size_t remainingAllocationSize() const { return m_remainingAllocationSize; } 789 size_t remainingAllocationSize() const { return m_remainingAllocationSize; }
795 bool hasCurrentAllocationArea() const { return currentAllocationPoint() && r emainingAllocationSize(); } 790 bool hasCurrentAllocationArea() const { return currentAllocationPoint() && r emainingAllocationSize(); }
796 void setAllocationPoint(Address, size_t); 791 void setAllocationPoint(Address, size_t);
797 void updateRemainingAllocationSize(); 792 void updateRemainingAllocationSize();
798 Address allocateFromFreeList(size_t, size_t gcInfoIndex); 793 Address allocateFromFreeList(size_t, size_t gcInfoIndex);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader)) ; 942 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader)) ;
948 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); 943 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1));
949 return result; 944 return result;
950 } 945 }
951 return outOfLineAllocate(allocationSize, gcInfoIndex); 946 return outOfLineAllocate(allocationSize, gcInfoIndex);
952 } 947 }
953 948
954 } // namespace blink 949 } // namespace blink
955 950
956 #endif // HeapPage_h 951 #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