Changeset 233773 in webkit
- Timestamp:
- Jul 12, 2018, 11:27:26 AM (7 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/CMakeLists.txt
r233673 r233773 28 28 bmalloc/ObjectType.cpp 29 29 bmalloc/PerProcess.cpp 30 bmalloc/PerThread.cpp 30 31 bmalloc/Scavenger.cpp 31 32 bmalloc/VMHeap.cpp -
trunk/Source/bmalloc/ChangeLog
r233673 r233773 1 2019-07-12 Michael Saboff <msaboff@apple.com> 2 3 Disable IsoHeaps when Gigacage is off 4 https://bugs.webkit.org/show_bug.cgi?id=187160 5 6 Reviewed by Saam Barati. 7 8 Relanding change sets 233547 and 233550 with the added fix that Gigacage is also 9 enabled for DumpRenderTree. 10 11 Updated determineMallocFallbackState to base enabling of Iso Heaps on Gigacage 12 being enabled. We do this because if Gigacage is disabled, it may be due to lack 13 of address space. 14 15 To work around a compiler issue uncovered by the change above, I added explicit 16 instantiation of PerThread's static variables. Defined the same explicit 17 instantiated static variables with export scope in the new file PerThread.cpp 18 to eliminate separate variables allocations in each linked framework / library. 19 20 * CMakeLists.txt: 21 * bmalloc.xcodeproj/project.pbxproj: 22 * bmalloc/IsoTLS.cpp: 23 (bmalloc::IsoTLS::determineMallocFallbackState): 24 * bmalloc/PerThread.cpp: Added. 25 * bmalloc/PerThread.h: 26 * bmalloc/ProcessCheck.mm: 27 (bmalloc::gigacageEnabledForProcess): 28 1 29 2018-07-09 Commit Queue <commit-queue@webkit.org> 2 30 -
trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
r233673 r233773 132 132 4426E2811C838EE0008EB042 /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 4426E27F1C838EE0008EB042 /* Logging.h */; settings = {ATTRIBUTES = (Private, ); }; }; 133 133 4426E2831C839547008EB042 /* BSoftLinking.h in Headers */ = {isa = PBXBuildFile; fileRef = 4426E2821C839547008EB042 /* BSoftLinking.h */; }; 134 6543DDB420EEAEF3003B23D8 /* PerThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6543DDB320EEAEF3003B23D8 /* PerThread.cpp */; }; 134 135 6599C5CC1EC3F15900A2F7BB /* AvailableMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6599C5CA1EC3F15900A2F7BB /* AvailableMemory.cpp */; }; 135 136 6599C5CD1EC3F15900A2F7BB /* AvailableMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 6599C5CB1EC3F15900A2F7BB /* AvailableMemory.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 293 294 4426E27F1C838EE0008EB042 /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = bmalloc/Logging.h; sourceTree = "<group>"; }; 294 295 4426E2821C839547008EB042 /* BSoftLinking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BSoftLinking.h; path = bmalloc/darwin/BSoftLinking.h; sourceTree = "<group>"; }; 296 6543DDB320EEAEF3003B23D8 /* PerThread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = PerThread.cpp; path = bmalloc/PerThread.cpp; sourceTree = "<group>"; }; 295 297 6599C5CA1EC3F15900A2F7BB /* AvailableMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AvailableMemory.cpp; path = bmalloc/AvailableMemory.cpp; sourceTree = "<group>"; }; 296 298 6599C5CB1EC3F15900A2F7BB /* AvailableMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AvailableMemory.h; path = bmalloc/AvailableMemory.h; sourceTree = "<group>"; }; … … 537 539 14446A0717A61FA400F9EA1D /* PerProcess.h */, 538 540 144469FD17A61F1F00F9EA1D /* PerThread.h */, 541 6543DDB320EEAEF3003B23D8 /* PerThread.cpp */, 539 542 145F6878179E3A4400D65598 /* Range.h */, 540 543 148EFAE61D6B953B008E721E /* ScopeExit.h */, … … 785 788 14F271C718EA3990008C152F /* Heap.cpp in Sources */, 786 789 0FD557331F7EDB7B00B1F0A3 /* HeapKind.cpp in Sources */, 790 6543DDB420EEAEF3003B23D8 /* PerThread.cpp in Sources */, 787 791 0F7EB83B1F9541B000F1ABCB /* IsoHeapImpl.cpp in Sources */, 788 792 0F5549EF1FB54704007FF75A /* IsoPage.cpp in Sources */, -
trunk/Source/bmalloc/bmalloc/IsoTLS.cpp
r233673 r233773 28 28 #include "DebugHeap.h" 29 29 #include "Environment.h" 30 #include "Gigacage.h" 30 31 #include "IsoTLSEntryInlines.h" 31 32 #include "IsoTLSInlines.h" … … 202 203 if (s_mallocFallbackState != MallocFallbackState::Undecided) 203 204 return; 204 205 206 #if GIGACAGE_ENABLED 207 if (!Gigacage::shouldBeEnabled()) { 208 s_mallocFallbackState = MallocFallbackState::FallBackToMalloc; 209 return; 210 } 205 211 const char* env = getenv("bmalloc_IsoHeap"); 206 212 if (env && (!strcasecmp(env, "false") || !strcasecmp(env, "no") || !strcmp(env, "0"))) … … 208 214 else 209 215 s_mallocFallbackState = MallocFallbackState::DoNotFallBack; 216 #else 217 s_mallocFallbackState = MallocFallbackState::FallBackToMalloc; 218 #endif 210 219 }); 211 220 } -
trunk/Source/bmalloc/bmalloc/PerThread.h
r233673 r233773 1 1 /* 2 * Copyright (C) 2014-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2014-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 109 109 }; 110 110 111 template<typename T> bool PerThreadStorage<T>::s_didInitialize; 112 template<typename T> pthread_key_t PerThreadStorage<T>::s_key; 113 template<typename T> std::once_flag PerThreadStorage<T>::s_onceFlag; 111 class Cache; 112 class Heap; 113 114 template<> bool PerThreadStorage<PerHeapKind<Cache>>::s_didInitialize; 115 template<> pthread_key_t PerThreadStorage<PerHeapKind<Cache>>::s_key; 116 template<> std::once_flag PerThreadStorage<PerHeapKind<Cache>>::s_onceFlag; 117 118 template<> bool PerThreadStorage<PerHeapKind<Heap>>::s_didInitialize; 119 template<> pthread_key_t PerThreadStorage<PerHeapKind<Heap>>::s_key; 120 template<> std::once_flag PerThreadStorage<PerHeapKind<Heap>>::s_onceFlag; 114 121 115 122 #endif -
trunk/Source/bmalloc/bmalloc/ProcessCheck.mm
r233216 r233773 47 47 NSString *processName = [[NSProcessInfo processInfo] processName]; 48 48 bool isOptInBinary = [processName isEqualToString:@"jsc"] 49 || [processName isEqualToString:@"DumpRenderTree"] 49 50 || [processName isEqualToString:@"wasm"] 50 51 || [processName hasPrefix:@"test"];
Note:
See TracChangeset
for help on using the changeset viewer.