Changeset 261050 in webkit
- Timestamp:
- May 2, 2020, 10:03:42 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r261041 r261050 1 2020-05-01 Mark Lam <mark.lam@apple.com> 2 3 Allow Bitmap to use up to a UCPURegister word size for internal bit storage. 4 https://bugs.webkit.org/show_bug.cgi?id=211328 5 <rdar://problem/62755865> 6 7 Reviewed by Yusuke Suzuki. 8 9 * assembler/CPU.h: 10 1 11 2020-05-01 Saam Barati <sbarati@apple.com> 2 12 -
trunk/Source/JavaScriptCore/assembler/CPU.h
r259320 r261050 1 1 /* 2 * Copyright (C) 2008-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2008-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #include "Options.h" 29 29 #include <wtf/NumberOfCores.h> 30 #include <wtf/StdIntExtras.h> 30 31 31 32 namespace JSC { 32 33 #if USE(JSVALUE64)34 using CPURegister = int64_t;35 using UCPURegister = uint64_t;36 #else37 using CPURegister = int32_t;38 using UCPURegister = uint32_t;39 #endif40 33 41 34 using UCPUStrictInt32 = UCPURegister; -
trunk/Source/WTF/ChangeLog
r261041 r261050 1 2020-05-01 Mark Lam <mark.lam@apple.com> 2 3 Allow Bitmap to use up to a UCPURegister word size for internal bit storage. 4 https://bugs.webkit.org/show_bug.cgi?id=211328 5 <rdar://problem/62755865> 6 7 Reviewed by Yusuke Suzuki. 8 9 1. Moved the definition of CPURegister and UCPURegister down into WTF. 10 2. Updated Bitmap so that it will automatically choose the minimal required 11 word size for the number of bits it needs to store. This means the Bitmap 12 can automatically choose a WordType from uint8_t up to UCPURegister. 13 Previously, the WordType is always uint32_t by default. 14 15 This should improve perf with use of Bitmap on 64-bit platforms. The size 16 optimization is necessary to prevent bloat on 64-bit platforms which would have 17 resulted if we simply set the default to always be UCPURegister. 18 19 * WTF.xcodeproj/project.pbxproj: 20 * wtf/Bitmap.h: 21 * wtf/CMakeLists.txt: 22 * wtf/StdIntExtras.h: Added. 23 1 24 2020-05-01 Saam Barati <sbarati@apple.com> 2 25 -
trunk/Source/WTF/WTF.xcodeproj/project.pbxproj
r260882 r261050 752 752 FE86A8741E59440200111BBF /* ForbidHeapAllocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForbidHeapAllocation.h; sourceTree = "<group>"; }; 753 753 FE8925AF1D00DAEC0046907E /* Indenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Indenter.h; sourceTree = "<group>"; }; 754 FE97F6A8245CE5DD00C63FC6 /* StdIntExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StdIntExtras.h; sourceTree = "<group>"; }; 754 755 FEB6B035201BE0B600B958C1 /* PointerPreparations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PointerPreparations.h; sourceTree = "<group>"; }; 755 756 FEDACD3B1630F83F00C69634 /* StackStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackStats.cpp; sourceTree = "<group>"; }; … … 1235 1236 313EDEC9778E49C9BEA91CFC /* StackTrace.cpp */, 1236 1237 EF7D6CD59D8642A8A0DA86AD /* StackTrace.h */, 1238 FE97F6A8245CE5DD00C63FC6 /* StdIntExtras.h */, 1237 1239 A8A47311151A825B004123FF /* StdLibExtras.h */, 1238 1240 FF0A436588954F3CB07DBECA /* StdList.h */, -
trunk/Source/WTF/wtf/Bitmap.h
r254735 r261050 1 1 /* 2 * Copyright (C) 2010-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 23 23 #include <wtf/Atomics.h> 24 24 #include <wtf/HashFunctions.h> 25 #include <wtf/StdIntExtras.h> 25 26 #include <wtf/StdLibExtras.h> 26 #include <stdint.h>27 27 #include <string.h> 28 #include <type_traits> 28 29 29 30 namespace WTF { 30 31 31 template<size_t bitmapSize, typename WordType = uint32_t> 32 template<size_t size> 33 using BitmapWordType = std::conditional_t<(size <= 32 && sizeof(UCPURegister) > sizeof(uint32_t)), uint32_t, UCPURegister>; 34 35 template<size_t bitmapSize, typename WordType = BitmapWordType<bitmapSize>> 32 36 class Bitmap final { 33 37 WTF_MAKE_FAST_ALLOCATED; 34 38 35 static_assert(sizeof(WordType) <= sizeof( unsigned), "WordType must not be bigger than unsigned");39 static_assert(sizeof(WordType) <= sizeof(UCPURegister), "WordType must not be bigger than the CPU atomic word size"); 36 40 public: 37 41 constexpr Bitmap(); -
trunk/Source/WTF/wtf/CMakeLists.txt
r260882 r261050 239 239 StackStats.h 240 240 StackTrace.h 241 StdIntExtras.h 241 242 StdLibExtras.h 242 243 StdList.h
Note:
See TracChangeset
for help on using the changeset viewer.