[webkit-changes] [WebKit/WebKit] 21e76d: Clean up enable_ifs using `if constexpr`

Ross Kirsling noreply at github.com
Thu Dec 1 23:02:43 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 21e76d2cd34577a4d7d71b1c0f96ec8eab21686e
      https://github.com/WebKit/WebKit/commit/21e76d2cd34577a4d7d71b1c0f96ec8eab21686e
  Author: Ross Kirsling <rkirsling at gmail.com>
  Date:   2022-12-01 (Thu, 01 Dec 2022)

  Changed paths:
    M Source/JavaScriptCore/assembler/Printer.h
    M Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
    M Source/JavaScriptCore/jit/JIT.h
    M Source/JavaScriptCore/jsc.cpp
    M Source/JavaScriptCore/parser/Parser.cpp
    M Source/JavaScriptCore/runtime/CachedTypes.cpp
    M Source/JavaScriptCore/runtime/CodeCache.h
    M Source/WTF/wtf/CrossThreadTask.h
    M Source/WTF/wtf/FileSystem.cpp
    M Source/WTF/wtf/HashTraits.h
    M Source/WTF/wtf/OptionSet.h
    M Source/WebCore/bindings/js/JSDOMWrapperCache.h
    M Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp

  Log Message:
  -----------
  Clean up enable_ifs using `if constexpr`
https://bugs.webkit.org/show_bug.cgi?id=248586

Reviewed by Yusuke Suzuki.

In JSC and elsewhere, there are quite a bunch of cases where enable_if is used for a given condition and its opposite;
these are great opportunities to make use of `if constexpr` instead.

* Source/JavaScriptCore/assembler/Printer.h:
(JSC::Printer::setPrinter):
* Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitBinaryOp):
* Source/JavaScriptCore/jit/JIT.h:
* Source/JavaScriptCore/jsc.cpp:
(addOption):
* Source/JavaScriptCore/parser/Parser.cpp:
(JSC::recordCallOrApplyDepth):
* Source/JavaScriptCore/runtime/CachedTypes.cpp:
(JSC::encode):
(JSC::decode):
* Source/JavaScriptCore/runtime/CodeCache.h:
(JSC::CodeCacheMap::fetchFromDisk):
(): Deleted.
* Source/WTF/wtf/CrossThreadTask.h:
(WTF::createCrossThreadTask):
* Source/WTF/wtf/FileSystem.cpp:
(WTF::FileSystemImpl::toTimeT):
(): Deleted.
* Source/WTF/wtf/HashTraits.h:
(WTF::hashTraitsDeleteBucket):
* Source/WTF/wtf/OptionSet.h:
(WTF::isValidOptionSetEnum):
(WTF::maskRawValue):
* Source/WebCore/bindings/js/JSDOMWrapperCache.h:
(WebCore::createWrapper):
* Source/WebCore/platform/graphics/displaylists/DisplayListItemBuffer.cpp:
(WebCore::DisplayList::isValid):

Canonical link: https://commits.webkit.org/257273@main




More information about the webkit-changes mailing list