Ignore:
Timestamp:
May 30, 2021, 9:11:40 AM (4 years ago)
Author:
Darin Adler
Message:

Remove WTF::Optional synonym for std::optional, using that class template directly instead
https://bugs.webkit.org/show_bug.cgi?id=226433

Reviewed by Chris Dumez.

Source/JavaScriptCore:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
  • inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:

(ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead
of Optional<>. Also use * instead of value() and nest the definition of the local inside an if
statement in the case where it's an optional.

  • inspector/scripts/tests/expected/*: Regenerated these results.

Source/WebCore:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebCore/PAL:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebDriver:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebKit:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
  • Scripts/webkit/tests: Regenerated expected results, by running the command "python

Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?)

Source/WebKitLegacy/ios:

  • WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename

Optional<> to std::optional<>.

Source/WebKitLegacy/mac:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WebKitLegacy/win:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.

Source/WTF:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
  • wtf/Optional.h: Remove WTF::Optional.

Tools:

  • <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGJITCode.cpp

    r278185 r278253  
    7272}
    7373
    74 void JITCode::reconstruct(CallFrame* callFrame, CodeBlock* codeBlock, CodeOrigin codeOrigin, unsigned streamIndex, Operands<Optional<JSValue>>& result)
     74void JITCode::reconstruct(CallFrame* callFrame, CodeBlock* codeBlock, CodeOrigin codeOrigin, unsigned streamIndex, Operands<std::optional<JSValue>>& result)
    7575{
    7676    Operands<ValueRecovery> recoveries;
    7777    reconstruct(codeBlock, codeOrigin, streamIndex, recoveries);
    7878   
    79     result = Operands<Optional<JSValue>>(OperandsLike, recoveries);
     79    result = Operands<std::optional<JSValue>>(OperandsLike, recoveries);
    8080    for (size_t i = result.size(); i--;)
    8181        result[i] = recoveries[i].recover(callFrame);
     
    225225}
    226226
    227 Optional<CodeOrigin> JITCode::findPC(CodeBlock*, void* pc)
     227std::optional<CodeOrigin> JITCode::findPC(CodeBlock*, void* pc)
    228228{
    229229    for (OSRExit& exit : m_osrExit) {
    230230        if (ExecutableMemoryHandle* handle = exit.m_code.executableMemory()) {
    231231            if (handle->start().untaggedPtr() <= pc && pc < handle->end().untaggedPtr())
    232                 return Optional<CodeOrigin>(exit.m_codeOriginForExitProfile);
     232                return std::optional<CodeOrigin>(exit.m_codeOriginForExitProfile);
    233233        }
    234234    }
Note: See TracChangeset for help on using the changeset viewer.