Changeset 233547 in webkit
- Timestamp:
- Jul 5, 2018 4:12:04 PM (6 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/CMakeLists.txt
r230308 r233547 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
r233501 r233547 1 2018-07-05 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 Updated determineMallocFallbackState to base enabling of Iso Heaps on Gigacage 9 being enabled. We do this because if Gigacage is disabled, it may be due to lack 10 of address space. 11 12 To work around a compiler issue uncovered by the change above, I added explicit 13 instantiation of PerThread's static variables. Defined the same explicit 14 instantiated static variables with export scope in the new file PerThread.cpp 15 to eliminate separate variables allocations in each linked framework / library. 16 17 * CMakeLists.txt: 18 * bmalloc.xcodeproj/project.pbxproj: 19 * bmalloc/IsoTLS.cpp: 20 (bmalloc::IsoTLS::determineMallocFallbackState): 21 * bmalloc/PerThread.cpp: Added. 22 * bmalloc/PerThread.h: 23 1 24 2018-07-04 Tim Horton <timothy_horton@apple.com> 2 25 -
trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
r232262 r233547 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
r233358 r233547 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
r229504 r233547 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
Note: See TracChangeset
for help on using the changeset viewer.