Changeset 251008 in webkit
- Timestamp:
- Oct 11, 2019 7:30:20 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r251003 r251008 1 2019-10-11 Jonathan Bedard <jbedard@apple.com> 2 3 Unreviewed, rolling out r250945. 4 5 Broke 18 Debug API tests 6 7 Reverted changeset: 8 9 "Add support for CompactPointerTuple<..., OptionSet<...>>" 10 https://bugs.webkit.org/show_bug.cgi?id=201316 11 https://trac.webkit.org/changeset/250945 12 1 13 2019-10-11 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 14 -
trunk/Source/WTF/wtf/CompactPointerTuple.h
r250945 r251008 1 1 /* 2 2 * Copyright (C) 2018 Yusuke Suzuki <utatane.tea@gmail.com>. 3 * Copyright (C) 2019 Apple Inc. All rights reserved.4 3 * 5 4 * Redistribution and use in source and binary forms, with or without … … 28 27 29 28 #include <type_traits> 30 #include <wtf/OptionSet.h>31 29 #include <wtf/StdLibExtras.h> 32 30 33 31 namespace WTF { 34 35 template <typename T>36 struct IsOptionSet : public std::integral_constant<bool, WTF::IsTemplate<std::decay_t<T>, OptionSet>::value> { };37 38 template<typename T> struct ByteValueTypeAdapter {39 static constexpr uint8_t toByte(T value) { return value; }40 static constexpr T fromByte(uint8_t value) { return static_cast<T>(value); }41 };42 43 template<typename U> struct ByteValueTypeAdapter<OptionSet<U>> {44 static constexpr uint8_t toByte(OptionSet<U> value) { return value.toRaw(); }45 static constexpr OptionSet<U> fromByte(uint8_t value) { return OptionSet<U>::fromRaw(value); }46 };47 32 48 33 // The goal of this class is folding a pointer and 1 byte value into 8 bytes in both 32bit and 64bit architectures. … … 50 35 // In 64bit, we use the upper 5 bits and lower 3 bits (zero due to alignment) since these bits are safe to use even 51 36 // with 5-level page tables where the effective pointer width is 57bits. 52 template<typename PointerType, typename Type , typename Adapter = ByteValueTypeAdapter<Type>>37 template<typename PointerType, typename Type> 53 38 class CompactPointerTuple final { 54 39 WTF_MAKE_FAST_ALLOCATED; … … 56 41 static_assert(sizeof(Type) == 1, ""); 57 42 static_assert(std::is_pointer<PointerType>::value, ""); 58 static_assert(std::is_integral<Type>::value || std::is_enum<Type>::value || IsOptionSet<Type>::value, "");43 static_assert(std::is_integral<Type>::value || std::is_enum<Type>::value, ""); 59 44 60 45 CompactPointerTuple() = default; … … 78 63 79 64 CompactPointerTuple(PointerType pointer, Type type) 80 : m_data { bitwise_cast<uint64_t>(pointer) | encodeType(Adapter::toByte(type)) }65 : m_data(bitwise_cast<uint64_t>(pointer) | encodeType(static_cast<uint8_t>(type))) 81 66 { 82 67 ASSERT((bitwise_cast<uint64_t>(pointer) & 0b111) == 0x0); … … 91 76 } 92 77 93 Type type() const { return Adapter::fromByte(decodeType(m_data)); }78 Type type() const { return static_cast<Type>(decodeType(m_data)); } 94 79 void setType(Type type) 95 80 { … … 114 99 private: 115 100 PointerType m_pointer { nullptr }; 116 Type m_type { };101 Type m_type { 0 }; 117 102 #endif 118 103 }; -
trunk/Source/WebCore/ChangeLog
r251007 r251008 1 2019-10-11 Jonathan Bedard <jbedard@apple.com> 2 3 Unreviewed, rolling out r250945. 4 5 Broke 18 Debug API tests 6 7 Reverted changeset: 8 9 "Add support for CompactPointerTuple<..., OptionSet<...>>" 10 https://bugs.webkit.org/show_bug.cgi?id=201316 11 https://trac.webkit.org/changeset/250945 12 1 13 2019-10-11 Bjorn Melinder <bjornm@spotify.com> 2 14 -
trunk/Source/WebCore/dom/Node.h
r250945 r251008 37 37 #include <wtf/ListHashSet.h> 38 38 #include <wtf/MainThread.h> 39 #include <wtf/OptionSet.h>40 39 #include <wtf/URLHash.h> 41 40 … … 617 616 }; 618 617 619 bool hasStyleFlag(ElementStyleFlag state) const { return m_rendererWithStyleFlags.type() .contains(state); }620 void setStyleFlag(ElementStyleFlag state) { m_rendererWithStyleFlags.setType(m_rendererWithStyleFlags.type() | stat e); }621 void clearStyleFlags() { m_rendererWithStyleFlags.setType( { }); }618 bool hasStyleFlag(ElementStyleFlag state) const { return m_rendererWithStyleFlags.type() & static_cast<uint8_t>(state); } 619 void setStyleFlag(ElementStyleFlag state) { m_rendererWithStyleFlags.setType(m_rendererWithStyleFlags.type() | static_cast<uint8_t>(state)); } 620 void clearStyleFlags() { m_rendererWithStyleFlags.setType(0); } 622 621 623 622 virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const { } … … 677 676 Node* m_previous { nullptr }; 678 677 Node* m_next { nullptr }; 679 CompactPointerTuple<RenderObject*, OptionSet<ElementStyleFlag>> m_rendererWithStyleFlags;678 CompactPointerTuple<RenderObject*, uint8_t> m_rendererWithStyleFlags; 680 679 std::unique_ptr<NodeRareData, NodeRareDataDeleter> m_rareData; 681 680 }; -
trunk/Tools/ChangeLog
r251001 r251008 1 2019-10-11 Jonathan Bedard <jbedard@apple.com> 2 3 Unreviewed, rolling out r250945. 4 5 Broke 18 Debug API tests 6 7 Reverted changeset: 8 9 "Add support for CompactPointerTuple<..., OptionSet<...>>" 10 https://bugs.webkit.org/show_bug.cgi?id=201316 11 https://trac.webkit.org/changeset/250945 12 1 13 2019-10-10 Fujii Hironori <Hironori.Fujii@sony.com> 2 14 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r250975 r251008 928 928 CE6E81A420A933D500E2C80F /* set-timeout-function.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CE6E81A320A933B800E2C80F /* set-timeout-function.html */; }; 929 929 CE78705F2107AB980053AC67 /* MoveOnlyLifecycleLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE78705D2107AB8C0053AC67 /* MoveOnlyLifecycleLogger.cpp */; }; 930 CE9B07F2231889E300A09BC7 /* CompactPointerTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE9B07F1231889E300A09BC7 /* CompactPointerTuple.cpp */; };931 930 CEA6CF2819CCF69D0064F5A7 /* open-and-close-window.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */; }; 932 931 CEA7F57D2089624B0078EF6E /* DidResignInputElementStrongPasswordAppearance.mm in Sources */ = {isa = PBXBuildFile; fileRef = CEA7F57B20895F5B0078EF6E /* DidResignInputElementStrongPasswordAppearance.mm */; }; … … 2405 2404 CE78705C2107AB8C0053AC67 /* MoveOnlyLifecycleLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveOnlyLifecycleLogger.h; sourceTree = "<group>"; }; 2406 2405 CE78705D2107AB8C0053AC67 /* MoveOnlyLifecycleLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MoveOnlyLifecycleLogger.cpp; sourceTree = "<group>"; }; 2407 CE9B07F1231889E300A09BC7 /* CompactPointerTuple.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CompactPointerTuple.cpp; sourceTree = "<group>"; };2408 2406 CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OpenAndCloseWindow.mm; sourceTree = "<group>"; }; 2409 2407 CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "open-and-close-window.html"; sourceTree = "<group>"; }; … … 3623 3621 E40019301ACE9B5C001B0A2A /* BloomFilter.cpp */, 3624 3622 A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */, 3625 CE9B07F1231889E300A09BC7 /* CompactPointerTuple.cpp */,3626 3623 0F30CB5B1FCE1792004B5323 /* ConcurrentPtrHashSet.cpp */, 3627 3624 0FEAE3671B7D19CB00CE17F2 /* Condition.cpp */, … … 4315 4312 7C83DE9C1D0A590C00FEBCF3 /* BloomFilter.cpp in Sources */, 4316 4313 7C83DEA01D0A590C00FEBCF3 /* CheckedArithmeticOperations.cpp in Sources */, 4317 CE9B07F2231889E300A09BC7 /* CompactPointerTuple.cpp in Sources */,4318 4314 0F30CB5C1FCE1796004B5323 /* ConcurrentPtrHashSet.cpp in Sources */, 4319 4315 7C83DEC31D0A590C00FEBCF3 /* Condition.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.