Changeset 256088 in webkit
- Timestamp:
- Feb 8, 2020 2:35:40 AM (4 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/CMakeLists.txt
r255829 r256088 32 32 bmalloc/PerProcess.cpp 33 33 bmalloc/Scavenger.cpp 34 bmalloc/VMHeap.cpp35 34 bmalloc/bmalloc.cpp 36 35 ) … … 128 127 bmalloc/Syscall.h 129 128 bmalloc/VMAllocate.h 130 bmalloc/VMHeap.h131 129 bmalloc/Vector.h 132 130 bmalloc/Zone.h -
trunk/Source/bmalloc/ChangeLog
r255829 r256088 1 2020-02-08 Basuke Suzuki <basuke.suzuki@sony.com> 2 3 [bmalloc] VMHeap can be merge into Heap 4 https://bugs.webkit.org/show_bug.cgi?id=207410 5 6 Reviewed by Yusuke Suzuki. 7 8 VMHeap has only one member function in it and Heap is the only client of that. 9 No member variable is defined. It does nothing special with its context as a class. 10 It is safe to merge the function into Heap. 11 12 * CMakeLists.txt: 13 * bmalloc.xcodeproj/project.pbxproj: 14 * bmalloc/Heap.cpp: 15 (bmalloc::Heap::allocateLarge): 16 (bmalloc::Heap::tryAllocateLargeChunk): Moved from VMHeap. 17 * bmalloc/Heap.h: 18 * bmalloc/VMHeap.cpp: Removed. 19 * bmalloc/VMHeap.h: Removed. 20 1 21 2020-02-05 Don Olmstead <don.olmstead@sony.com> 2 22 -
trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
r254708 r256088 79 79 0FD557331F7EDB7B00B1F0A3 /* HeapKind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FD557321F7EDB7B00B1F0A3 /* HeapKind.cpp */; }; 80 80 1400274918F89C1300115C97 /* Heap.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DA320C18875B09007269E0 /* Heap.h */; settings = {ATTRIBUTES = (Private, ); }; }; 81 1400274A18F89C2300115C97 /* VMHeap.h in Headers */ = {isa = PBXBuildFile; fileRef = 144F7BFC18BFC517003537F3 /* VMHeap.h */; settings = {ATTRIBUTES = (Private, ); }; };82 81 140FA00319CE429C00FFD3C8 /* BumpRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 140FA00219CE429C00FFD3C8 /* BumpRange.h */; settings = {ATTRIBUTES = (Private, ); }; }; 83 82 140FA00519CE4B6800FFD3C8 /* LineMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 140FA00419CE4B6800FFD3C8 /* LineMetadata.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 126 125 14F271C718EA3990008C152F /* Heap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA320E18875D9F007269E0 /* Heap.cpp */; }; 127 126 14F271C818EA3990008C152F /* ObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14105E8318E14374003A106E /* ObjectType.cpp */; }; 128 14F271C918EA3990008C152F /* VMHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 144F7BFB18BFC517003537F3 /* VMHeap.cpp */; };129 127 4426E2801C838EE0008EB042 /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4426E27E1C838EE0008EB042 /* Logging.cpp */; }; 130 128 4426E2811C838EE0008EB042 /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 4426E27F1C838EE0008EB042 /* Logging.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 254 252 144C07F21C7B70260051BB6A /* LargeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LargeMap.cpp; path = bmalloc/LargeMap.cpp; sourceTree = "<group>"; }; 255 253 144C07F31C7B70260051BB6A /* LargeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LargeMap.h; path = bmalloc/LargeMap.h; sourceTree = "<group>"; }; 256 144F7BFB18BFC517003537F3 /* VMHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VMHeap.cpp; path = bmalloc/VMHeap.cpp; sourceTree = "<group>"; };257 144F7BFC18BFC517003537F3 /* VMHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VMHeap.h; path = bmalloc/VMHeap.h; sourceTree = "<group>"; };258 254 1452478618BC757C00F80098 /* SmallLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmallLine.h; path = bmalloc/SmallLine.h; sourceTree = "<group>"; }; 259 255 145F6855179DC8CA00D65598 /* Allocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = Allocator.cpp; path = bmalloc/Allocator.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; … … 501 497 0F5BF1511F22E1570029D91D /* Scavenger.h */, 502 498 145F6874179DF84100D65598 /* Sizes.h */, 503 144F7BFB18BFC517003537F3 /* VMHeap.cpp */,504 144F7BFC18BFC517003537F3 /* VMHeap.h */,505 499 1440AFCC1A9527AF00837FAA /* Zone.cpp */, 506 500 1440AFCA1A95261100837FAA /* Zone.h */, … … 669 663 14DD78CF18F48D7500950702 /* Vector.h in Headers */, 670 664 14DD78D018F48D7500950702 /* VMAllocate.h in Headers */, 671 1400274A18F89C2300115C97 /* VMHeap.h in Headers */,672 665 1440AFCB1A95261100837FAA /* Zone.h in Headers */, 673 666 ); … … 787 780 AD14AD2A202529C700890E3B /* ProcessCheck.mm in Sources */, 788 781 0F5BF1521F22E1570029D91D /* Scavenger.cpp in Sources */, 789 14F271C918EA3990008C152F /* VMHeap.cpp in Sources */,790 782 1440AFCD1A9527AF00837FAA /* Zone.cpp in Sources */, 791 783 ); -
trunk/Source/bmalloc/bmalloc/Heap.cpp
r254781 r256088 39 39 #include "SmallLine.h" 40 40 #include "SmallPage.h" 41 #include "VMHeap.h"42 41 #include "bmalloc.h" 43 42 #include <thread> 44 43 #include <vector> 44 45 #if BOS(DARWIN) 46 #include "Zone.h" 47 #endif 45 48 46 49 namespace bmalloc { … … 575 578 ASSERT_OR_RETURN_ON_FAILURE(!usingGigacage()); 576 579 577 range = VMHeap::get()->tryAllocateLargeChunk(alignment, size);580 range = tryAllocateLargeChunk(alignment, size); 578 581 ASSERT_OR_RETURN_ON_FAILURE(range); 579 582 … … 594 597 } 595 598 599 LargeRange Heap::tryAllocateLargeChunk(size_t alignment, size_t size) 600 { 601 // We allocate VM in aligned multiples to increase the chances that 602 // the OS will provide contiguous ranges that we can merge. 603 size_t roundedAlignment = roundUpToMultipleOf<chunkSize>(alignment); 604 if (roundedAlignment < alignment) // Check for overflow 605 return LargeRange(); 606 alignment = roundedAlignment; 607 608 size_t roundedSize = roundUpToMultipleOf<chunkSize>(size); 609 if (roundedSize < size) // Check for overflow 610 return LargeRange(); 611 size = roundedSize; 612 613 void* memory = tryVMAllocate(alignment, size); 614 if (!memory) 615 return LargeRange(); 616 617 #if BOS(DARWIN) 618 PerProcess<Zone>::get()->addRange(Range(memory, size)); 619 #endif 620 621 return LargeRange(memory, size, 0, 0); 622 } 623 596 624 bool Heap::isLarge(UniqueLockHolder&, void* object) 597 625 { -
trunk/Source/bmalloc/bmalloc/Heap.h
r254781 r256088 48 48 namespace bmalloc { 49 49 50 class BeginTag;51 50 class BulkDecommit; 52 51 class BumpAllocator; 53 52 class DebugHeap; 54 class EndTag;55 53 class HeapConstants; 56 54 class Scavenger; … … 122 120 void deallocateSmallChunk(Chunk*, size_t pageClass); 123 121 124 void mergeLarge(BeginTag*&, EndTag*&, Range&); 125 void mergeLargeLeft(EndTag*&, BeginTag*&, Range&, bool& inVMHeap); 126 void mergeLargeRight(EndTag*&, BeginTag*&, Range&, bool& inVMHeap); 127 122 LargeRange tryAllocateLargeChunk(size_t alignment, size_t); 128 123 LargeRange splitAndAllocate(UniqueLockHolder&, LargeRange&, size_t alignment, size_t); 129 124
Note: See TracChangeset
for help on using the changeset viewer.