Changeset 279028 in webkit
- Timestamp:
- Jun 17, 2021, 6:44:42 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/assembler/MacroAssemblerARM64E.h (modified) (4 diffs)
-
Source/JavaScriptCore/bytecode/CodeOrigin.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/JSString.h (modified) (1 diff)
-
Source/JavaScriptCore/runtime/OptionsList.h (modified) (1 diff)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/CagedPtr.h (modified) (3 diffs)
-
Source/WTF/wtf/CompactPointerTuple.h (modified) (1 diff)
-
Source/WTF/wtf/Packed.h (modified) (1 diff)
-
Source/WTF/wtf/PlatformOS.h (modified) (3 diffs)
-
Source/WTF/wtf/WTFAssertions.cpp (modified) (2 diffs)
-
Source/WTF/wtf/threads/Signals.cpp (modified) (1 diff)
-
Source/bmalloc/ChangeLog (modified) (1 diff)
-
Source/bmalloc/bmalloc/Algorithm.h (modified) (3 diffs)
-
Source/bmalloc/bmalloc/BPlatform.h (modified) (2 diffs)
-
Source/bmalloc/bmalloc/Gigacage.h (modified) (4 diffs)
-
Source/bmalloc/bmalloc/ObjectTypeTable.h (modified) (2 diffs)
-
Source/bmalloc/bmalloc/Packed.h (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WTF/Packed.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r279008 r279028 1 2021-06-17 Mark Lam <mark.lam@apple.com> 2 3 Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH). 4 https://bugs.webkit.org/show_bug.cgi?id=227147 5 rdar://78785309 6 7 Reviewed by Saam Barati. 8 9 * assembler/MacroAssemblerARM64E.h: 10 * bytecode/CodeOrigin.h: 11 * runtime/JSString.h: 12 * runtime/OptionsList.h: 13 1 14 2021-06-17 Fujii Hironori <Hironori.Fujii@sony.com> 2 15 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64E.h
r278656 r279028 1 1 /* 2 * Copyright (C) 2018-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2018-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 30 30 #include "DisallowMacroScratchRegisterUsage.h" 31 #include <wtf/MathExtras.h> 31 32 32 33 // We need to include this before MacroAssemblerARM64.h because MacroAssemblerARM64 … … 39 40 #endif 40 41 42 #if OS(DARWIN) 43 #include <mach/vm_param.h> 44 #endif 45 41 46 namespace JSC { 42 47 … … 45 50 class MacroAssemblerARM64E : public MacroAssemblerARM64 { 46 51 public: 47 static constexpr unsigned numberOfPACBits = 25; 48 static constexpr uintptr_t nonPACBitsMask = (1ull << (64 - numberOfPACBits)) - 1; 52 static constexpr unsigned numberOfPointerBits = sizeof(void*) * CHAR_BIT; 53 static constexpr unsigned numberOfPACBits = numberOfPointerBits - OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH); 54 static constexpr uintptr_t nonPACBitsMask = (1ull << (numberOfPointerBits - numberOfPACBits)) - 1; 49 55 50 56 ALWAYS_INLINE void tagReturnAddress() -
trunk/Source/JavaScriptCore/bytecode/CodeOrigin.h
r264488 r279028 30 30 #include <limits.h> 31 31 #include <wtf/HashMap.h> 32 #include <wtf/MathExtras.h> 32 33 #include <wtf/PrintStream.h> 33 34 #include <wtf/StdLibExtras.h> 34 35 #include <wtf/Vector.h> 36 37 #if OS(DARWIN) 38 #include <mach/vm_param.h> 39 #endif 35 40 36 41 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/JSString.h
r278338 r279028 35 35 #include <wtf/CheckedArithmetic.h> 36 36 #include <wtf/ForbidHeapAllocation.h> 37 #include <wtf/MathExtras.h> 37 38 #include <wtf/text/StringView.h> 39 40 #if OS(DARWIN) 41 #include <mach/vm_param.h> 42 #endif 38 43 39 44 namespace JSC { -
trunk/Source/JavaScriptCore/runtime/OptionsList.h
r278699 r279028 27 27 28 28 #include "GCLogging.h" 29 #include <wtf/MathExtras.h> 30 31 #if OS(DARWIN) 32 #include <mach/vm_param.h> 33 #endif 29 34 30 35 using WTF::PrintStream; -
trunk/Source/WTF/ChangeLog
r279027 r279028 1 2021-06-17 Mark Lam <mark.lam@apple.com> 2 3 Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH). 4 https://bugs.webkit.org/show_bug.cgi?id=227147 5 rdar://78785309 6 7 Reviewed by Saam Barati. 8 9 For OS(DARWIN), define OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) in terms of 10 MACH_VM_MAX_ADDRESS, which is provided by the SDK. This ensures that it is 11 correct for each target OS(DARWIN) platform. 12 13 Also update an assertion in WTFAssertions.cpp to verify that address bits are 14 less than 48. The purpose of this assertion is to ensure that our 64-bit NaN 15 boxing encoding for JSValues will work. Hence, we should use the encoding limit 16 for pointers of 48 bits. It no longer makes sense to assert based on 17 OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH), because OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) 18 is defined in terms of MACH_VM_MAX_ADDRESS. 19 20 * wtf/CagedPtr.h: 21 * wtf/CompactPointerTuple.h: 22 * wtf/PlatformOS.h: 23 * wtf/WTFAssertions.cpp: 24 * wtf/threads/Signals.cpp: 25 1 26 2021-06-17 Fujii Hironori <Hironori.Fujii@sony.com> 2 27 -
trunk/Source/WTF/wtf/CagedPtr.h
r275597 r279028 1 1 /* 2 * Copyright (C) 2017 Apple Inc. All rights reserved.2 * Copyright (C) 2017-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 28 28 #include <wtf/Gigacage.h> 29 #include <wtf/MathExtras.h> 29 30 #include <wtf/PtrTag.h> 30 31 #include <wtf/RawPtrTraits.h> 31 32 32 33 #include <climits> 34 35 #if OS(DARWIN) 36 #include <mach/vm_param.h> 37 #endif 33 38 34 39 namespace WTF { … … 40 45 public: 41 46 static constexpr Gigacage::Kind kind = passedKind; 42 static constexpr unsigned numberOfPACBits = 25; 43 static constexpr uintptr_t nonPACBitsMask = (1ull << ((sizeof(T*) * CHAR_BIT) - numberOfPACBits)) - 1; 47 static constexpr unsigned numberOfPointerBits = sizeof(T*) * CHAR_BIT; 48 static constexpr unsigned numberOfPACBits = numberOfPointerBits - OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH); 49 static constexpr uintptr_t nonPACBitsMask = (1ull << (numberOfPointerBits - numberOfPACBits)) - 1; 44 50 45 51 CagedPtr() : CagedPtr(nullptr) { } -
trunk/Source/WTF/wtf/CompactPointerTuple.h
r266713 r279028 29 29 #include <type_traits> 30 30 #include <wtf/FastMalloc.h> 31 #include <wtf/MathExtras.h> 31 32 #include <wtf/StdLibExtras.h> 33 34 #if OS(DARWIN) 35 #include <mach/vm_param.h> 36 #endif 32 37 33 38 namespace WTF { -
trunk/Source/WTF/wtf/Packed.h
r278878 r279028 34 34 #include <wtf/UnalignedAccess.h> 35 35 36 #if OS(DARWIN) 37 #include <mach/vm_param.h> 38 #endif 39 36 40 namespace WTF { 37 41 -
trunk/Source/WTF/wtf/PlatformOS.h
r262223 r279028 1 1 /* 2 * Copyright (C) 2006-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2006-2021 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. 4 4 * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. … … 38 38 #include <TargetConditionals.h> 39 39 #endif 40 41 40 42 41 /* OS() - underlying operating system; only to be used for mandated low-level services like … … 138 137 139 138 #if CPU(ADDRESS64) 140 #if (OS(IOS) || OS(TVOS) || OS(WATCHOS)) && CPU(ARM64)141 #define WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH 36139 #if OS(DARWIN) 140 #define WTF_OS_CONSTANT_EFFECTIVE_ADDRESS_WIDTH (WTF::getMSBSetConstexpr(MACH_VM_MAX_ADDRESS) + 1) 142 141 #else 143 142 /* We strongly assume that effective address width is <= 48 in 64bit architectures (e.g. NaN boxing). */ -
trunk/Source/WTF/wtf/WTFAssertions.cpp
r254843 r279028 1 1 /* 2 * Copyright (C) 2017-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2017-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 51 51 52 52 #if OS(DARWIN) && CPU(ADDRESS64) 53 static_assert(MACH_VM_MAX_ADDRESS <= ((1ULL << OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH)) - 1)); 53 // NaN boxing encoding relies on this. 54 static_assert(MACH_VM_MAX_ADDRESS <= (1ull << 48)); 54 55 #endif 55 56 -
trunk/Source/WTF/wtf/threads/Signals.cpp
r277900 r279028 45 45 #endif 46 46 47 #if OS(DARWIN) 48 #include <mach/vm_param.h> 49 #endif 50 47 51 #include <wtf/Atomics.h> 48 52 #include <wtf/DataLog.h> 53 #include <wtf/MathExtras.h> 49 54 #include <wtf/NeverDestroyed.h> 50 55 #include <wtf/PlatformRegisters.h> -
trunk/Source/bmalloc/ChangeLog
r278447 r279028 1 2021-06-17 Mark Lam <mark.lam@apple.com> 2 3 Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH). 4 https://bugs.webkit.org/show_bug.cgi?id=227147 5 rdar://78785309 6 7 Reviewed by Saam Barati. 8 9 For OS(DARWIN), define BOS_EFFECTIVE_ADDRESS_WIDTH in terms of MACH_VM_MAX_ADDRESS, 10 which is provided by the SDK. This ensures that it is correct for each target 11 OS(DARWIN) platform. 12 13 * bmalloc/Algorithm.h: 14 (bmalloc::clzConstexpr): 15 (bmalloc::getMSBSetConstexpr): 16 * bmalloc/BPlatform.h: 17 * bmalloc/Gigacage.h: 18 * bmalloc/ObjectTypeTable.h: 19 * bmalloc/Packed.h: 20 1 21 2021-06-03 Michael Saboff <msaboff@apple.com> 2 22 -
trunk/Source/bmalloc/bmalloc/Algorithm.h
r261827 r279028 1 1 /* 2 * Copyright (C) 2014-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2014-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 170 170 #endif 171 171 172 template <typename T> 173 constexpr unsigned clzConstexpr(T value) 174 { 175 constexpr unsigned bitSize = sizeof(T) * CHAR_BIT; 176 177 using UT = typename std::make_unsigned<T>::type; 178 UT uValue = value; 179 180 unsigned zeroCount = 0; 181 for (int i = bitSize - 1; i >= 0; i--) { 182 if (uValue >> i) 183 break; 184 zeroCount++; 185 } 186 return zeroCount; 187 } 188 172 189 constexpr unsigned long log2(unsigned long value) 173 190 { … … 263 280 } 264 281 282 template<typename T> 283 constexpr unsigned getMSBSetConstexpr(T t) 284 { 285 constexpr unsigned bitSize = sizeof(T) * CHAR_BIT; 286 return bitSize - 1 - clzConstexpr(t); 287 } 288 265 289 // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 266 290 constexpr uint32_t roundUpToPowerOfTwo(uint32_t v) -
trunk/Source/bmalloc/bmalloc/BPlatform.h
r278447 r279028 1 1 /* 2 * Copyright (C) 2014-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2014-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 275 275 276 276 #if BCPU(ADDRESS64) 277 #if (BOS(IOS) || BOS(TVOS) || BOS(WATCHOS)) && BCPU(ARM64)278 #define BOS_EFFECTIVE_ADDRESS_WIDTH 36277 #if BOS(DARWIN) 278 #define BOS_EFFECTIVE_ADDRESS_WIDTH (bmalloc::getMSBSetConstexpr(MACH_VM_MAX_ADDRESS) + 1) 279 279 #else 280 280 /* We strongly assume that effective address width is <= 48 in 64bit architectures (e.g. NaN boxing). */ -
trunk/Source/bmalloc/bmalloc/Gigacage.h
r263316 r279028 1 1 /* 2 * Copyright (C) 2017-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2017-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "Algorithm.h" 28 29 #include "BAssert.h" 29 30 #include "BExport.h" … … 35 36 #include <cstddef> 36 37 #include <inttypes.h> 38 39 #if BOS(DARWIN) 40 #include <mach/vm_param.h> 41 #endif 37 42 38 43 #if ((BOS(DARWIN) || BOS(LINUX)) && \ … … 62 67 #if GIGACAGE_ENABLED 63 68 64 #if BOS_EFFECTIVE_ADDRESS_WIDTH < 48 65 constexpr size_t primitiveGigacageSize = 2 * bmalloc::Sizes::GB; 66 constexpr size_t jsValueGigacageSize = 2 * bmalloc::Sizes::GB; 67 constexpr size_t maximumCageSizeReductionForSlide = bmalloc::Sizes::GB / 4; 68 #else 69 constexpr size_t primitiveGigacageSize = 32 * bmalloc::Sizes::GB; 70 constexpr size_t jsValueGigacageSize = 16 * bmalloc::Sizes::GB; 71 constexpr size_t maximumCageSizeReductionForSlide = 4 * bmalloc::Sizes::GB; 72 #endif 69 constexpr bool useLargeGigacage = BOS_EFFECTIVE_ADDRESS_WIDTH > 36; 70 constexpr size_t primitiveGigacageSize = (useLargeGigacage ? 32 : 2) * bmalloc::Sizes::GB; 71 constexpr size_t jsValueGigacageSize = (useLargeGigacage ? 16 : 2) * bmalloc::Sizes::GB; 72 constexpr size_t maximumCageSizeReductionForSlide = useLargeGigacage ? 4 * bmalloc::Sizes::GB : bmalloc::Sizes::GB / 4; 73 73 74 74 75 // In Linux, if `vm.overcommit_memory = 2` is specified, mmap with large size can fail if it exceeds the size of RAM. -
trunk/Source/bmalloc/bmalloc/ObjectTypeTable.h
r261667 r279028 1 1 /* 2 * Copyright (C) 2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "Algorithm.h" 28 29 #include "Mutex.h" 29 30 #include "ObjectType.h" 30 31 #include "Sizes.h" 32 33 #if BOS(DARWIN) 34 #include <mach/vm_param.h> 35 #endif 31 36 32 37 namespace bmalloc { -
trunk/Source/bmalloc/bmalloc/Packed.h
r257301 r279028 1 1 /* 2 * Copyright (C) 2019-202 0Apple Inc. All rights reserved.2 * Copyright (C) 2019-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 #include <array> 31 31 32 #if BOS(DARWIN) 33 #include <mach/vm_param.h> 34 #endif 35 32 36 namespace bmalloc { 33 37 -
trunk/Tools/ChangeLog
r279027 r279028 1 2021-06-17 Mark Lam <mark.lam@apple.com> 2 3 Define MacroAssemblerARM64E::numberOfPACBits based on OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH). 4 https://bugs.webkit.org/show_bug.cgi?id=227147 5 rdar://78785309 6 7 Reviewed by Saam Barati. 8 9 * TestWebKitAPI/Tests/WTF/Packed.cpp: 10 1 11 2021-06-17 Fujii Hironori <Hironori.Fujii@sony.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WTF/Packed.cpp
r264718 r279028 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2021 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #include <wtf/Packed.h> 29 29 #include <wtf/HashMap.h> 30 #include <wtf/MathExtras.h> 30 31 #include <wtf/Vector.h> 32 33 #if OS(DARWIN) 34 #include <mach/vm_param.h> 35 #endif 31 36 32 37 namespace TestWebKitAPI {
Note:
See TracChangeset
for help on using the changeset viewer.