Changeset 251008 in webkit


Ignore:
Timestamp:
Oct 11, 2019 7:30:20 AM (5 years ago)
Author:
Jonathan Bedard
Message:

Unreviewed, rolling out r250945.

Broke 18 Debug API tests

Reverted changeset:

"Add support for CompactPointerTuple<..., OptionSet<...>>"
https://bugs.webkit.org/show_bug.cgi?id=201316
https://trac.webkit.org/changeset/250945

Location:
trunk
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r251003 r251008  
     12019-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
    1132019-10-11  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    214
  • trunk/Source/WTF/wtf/CompactPointerTuple.h

    r250945 r251008  
    11/*
    22 * Copyright (C) 2018 Yusuke Suzuki <utatane.tea@gmail.com>.
    3  * Copyright (C) 2019 Apple Inc. All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
     
    2827
    2928#include <type_traits>
    30 #include <wtf/OptionSet.h>
    3129#include <wtf/StdLibExtras.h>
    3230
    3331namespace 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 };
    4732
    4833// The goal of this class is folding a pointer and 1 byte value into 8 bytes in both 32bit and 64bit architectures.
     
    5035// In 64bit, we use the upper 5 bits and lower 3 bits (zero due to alignment) since these bits are safe to use even
    5136// with 5-level page tables where the effective pointer width is 57bits.
    52 template<typename PointerType, typename Type, typename Adapter = ByteValueTypeAdapter<Type>>
     37template<typename PointerType, typename Type>
    5338class CompactPointerTuple final {
    5439    WTF_MAKE_FAST_ALLOCATED;
     
    5641    static_assert(sizeof(Type) == 1, "");
    5742    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, "");
    5944
    6045    CompactPointerTuple() = default;
     
    7863
    7964    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)))
    8166    {
    8267        ASSERT((bitwise_cast<uint64_t>(pointer) & 0b111) == 0x0);
     
    9176    }
    9277
    93     Type type() const { return Adapter::fromByte(decodeType(m_data)); }
     78    Type type() const { return static_cast<Type>(decodeType(m_data)); }
    9479    void setType(Type type)
    9580    {
     
    11499private:
    115100    PointerType m_pointer { nullptr };
    116     Type m_type { };
     101    Type m_type { 0 };
    117102#endif
    118103};
  • trunk/Source/WebCore/ChangeLog

    r251007 r251008  
     12019-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
    1132019-10-11  Bjorn Melinder  <bjornm@spotify.com>
    214
  • trunk/Source/WebCore/dom/Node.h

    r250945 r251008  
    3737#include <wtf/ListHashSet.h>
    3838#include <wtf/MainThread.h>
    39 #include <wtf/OptionSet.h>
    4039#include <wtf/URLHash.h>
    4140
     
    617616    };
    618617
    619     bool hasStyleFlag(ElementStyleFlag state) const { return m_rendererWithStyleFlags.type().contains(state); }
    620     void setStyleFlag(ElementStyleFlag state) { m_rendererWithStyleFlags.setType(m_rendererWithStyleFlags.type() | state); }
    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); }
    622621
    623622    virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const { }
     
    677676    Node* m_previous { nullptr };
    678677    Node* m_next { nullptr };
    679     CompactPointerTuple<RenderObject*, OptionSet<ElementStyleFlag>> m_rendererWithStyleFlags;
     678    CompactPointerTuple<RenderObject*, uint8_t> m_rendererWithStyleFlags;
    680679    std::unique_ptr<NodeRareData, NodeRareDataDeleter> m_rareData;
    681680};
  • trunk/Tools/ChangeLog

    r251001 r251008  
     12019-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
    1132019-10-10  Fujii Hironori  <Hironori.Fujii@sony.com>
    214
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r250975 r251008  
    928928                CE6E81A420A933D500E2C80F /* set-timeout-function.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CE6E81A320A933B800E2C80F /* set-timeout-function.html */; };
    929929                CE78705F2107AB980053AC67 /* MoveOnlyLifecycleLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE78705D2107AB8C0053AC67 /* MoveOnlyLifecycleLogger.cpp */; };
    930                 CE9B07F2231889E300A09BC7 /* CompactPointerTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE9B07F1231889E300A09BC7 /* CompactPointerTuple.cpp */; };
    931930                CEA6CF2819CCF69D0064F5A7 /* open-and-close-window.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */; };
    932931                CEA7F57D2089624B0078EF6E /* DidResignInputElementStrongPasswordAppearance.mm in Sources */ = {isa = PBXBuildFile; fileRef = CEA7F57B20895F5B0078EF6E /* DidResignInputElementStrongPasswordAppearance.mm */; };
     
    24052404                CE78705C2107AB8C0053AC67 /* MoveOnlyLifecycleLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveOnlyLifecycleLogger.h; sourceTree = "<group>"; };
    24062405                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>"; };
    24082406                CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = OpenAndCloseWindow.mm; sourceTree = "<group>"; };
    24092407                CEA6CF2719CCF69D0064F5A7 /* open-and-close-window.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "open-and-close-window.html"; sourceTree = "<group>"; };
     
    36233621                                E40019301ACE9B5C001B0A2A /* BloomFilter.cpp */,
    36243622                                A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */,
    3625                                 CE9B07F1231889E300A09BC7 /* CompactPointerTuple.cpp */,
    36263623                                0F30CB5B1FCE1792004B5323 /* ConcurrentPtrHashSet.cpp */,
    36273624                                0FEAE3671B7D19CB00CE17F2 /* Condition.cpp */,
     
    43154312                                7C83DE9C1D0A590C00FEBCF3 /* BloomFilter.cpp in Sources */,
    43164313                                7C83DEA01D0A590C00FEBCF3 /* CheckedArithmeticOperations.cpp in Sources */,
    4317                                 CE9B07F2231889E300A09BC7 /* CompactPointerTuple.cpp in Sources */,
    43184314                                0F30CB5C1FCE1796004B5323 /* ConcurrentPtrHashSet.cpp in Sources */,
    43194315                                7C83DEC31D0A590C00FEBCF3 /* Condition.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.