⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 276516 in webkit


Ignore:
Timestamp:
Apr 23, 2021, 2:01:01 PM (5 years ago)
Author:
Fujii Hironori
Message:

[JSC][Win] callOperationNoExceptionCheck() also needs to support operations that return SlowPathReturnType
https://bugs.webkit.org/show_bug.cgi?id=224964

Reviewed by Yusuke Suzuki.

r229989 (Bug 183655) added the x64 Windows support only for
callOperation(), but for callOperationNoExceptionCheck().
callOperationNoExceptionCheck() also needs the x64 Windows
support.

This change is a preparation for Bug 224920 that is going to use
callOperationNoExceptionCheck instead of callOperation.

  • jit/JIT.h:

(callOperation): Rewrote by using 'if constexpr' instead of SFINAE.
(callOperationNoExceptionCheck): Added a new implementation for
x64 Windows based on callOperation.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r276496 r276516  
     12021-04-23  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [JSC][Win] callOperationNoExceptionCheck() also needs to support operations that return SlowPathReturnType
     4        https://bugs.webkit.org/show_bug.cgi?id=224964
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        r229989 (Bug 183655) added the x64 Windows support only for
     9        callOperation(), but for callOperationNoExceptionCheck().
     10        callOperationNoExceptionCheck() also needs the x64 Windows
     11        support.
     12
     13        This change is a preparation for Bug 224920 that is going to use
     14        callOperationNoExceptionCheck instead of callOperation.
     15
     16        * jit/JIT.h:
     17        (callOperation): Rewrote by using 'if constexpr' instead of SFINAE.
     18        (callOperationNoExceptionCheck): Added a new implementation for
     19        x64 Windows based on callOperation.
     20
    1212021-04-23  Commit Queue  <commit-queue@webkit.org>
    222
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r276496 r276516  
    825825
    826826#if OS(WINDOWS) && CPU(X86_64)
    827         template<typename OperationType, typename... Args>
    828         std::enable_if_t<std::is_same<typename FunctionTraits<OperationType>::ResultType, SlowPathReturnType>::value, MacroAssembler::Call>
    829         callOperation(OperationType operation, Args... args)
    830         {
    831             setupArguments<OperationType>(args...);
    832             return appendCallWithExceptionCheckAndSlowPathReturnType(operation);
    833         }
    834 
    835827        template<typename Type>
    836828        struct is64BitType {
     
    844836
    845837        template<typename OperationType, typename... Args>
    846         std::enable_if_t<!std::is_same<typename FunctionTraits<OperationType>::ResultType, SlowPathReturnType>::value, MacroAssembler::Call>
    847         callOperation(OperationType operation, Args... args)
    848         {
    849             static_assert(is64BitType<typename FunctionTraits<OperationType>::ResultType>::value, "Win64 cannot use standard call when return type is larger than 64 bits.");
     838        MacroAssembler::Call callOperation(OperationType operation, Args... args)
     839        {
    850840            setupArguments<OperationType>(args...);
    851             return appendCallWithExceptionCheck(operation);
     841            // x64 Windows cannot use standard call when the return type is larger than 64 bits.
     842            if constexpr (is64BitType<typename FunctionTraits<OperationType>::ResultType>::value)
     843                return appendCallWithExceptionCheck(operation);
     844            return appendCallWithExceptionCheckAndSlowPathReturnType(operation);
    852845        }
    853846#else // OS(WINDOWS) && CPU(X86_64)
     
    877870        }
    878871
     872#if OS(WINDOWS) && CPU(X86_64)
     873        template<typename OperationType, typename... Args>
     874        MacroAssembler::Call callOperationNoExceptionCheck(OperationType operation, Args... args)
     875        {
     876            setupArguments<OperationType>(args...);
     877            updateTopCallFrame();
     878            // x64 Windows cannot use standard call when the return type is larger than 64 bits.
     879            if constexpr (is64BitType<typename FunctionTraits<OperationType>::ResultType>::value)
     880                return appendCall(operation);
     881            return appendCallWithSlowPathReturnType(operation);
     882        }
     883#else // OS(WINDOWS) && CPU(X86_64)
    879884        template<typename OperationType, typename... Args>
    880885        MacroAssembler::Call callOperationNoExceptionCheck(OperationType operation, Args... args)
     
    884889            return appendCall(operation);
    885890        }
     891#endif // OS(WINDOWS) && CPU(X86_64)
    886892
    887893        template<typename OperationType, typename... Args>
Note: See TracChangeset for help on using the changeset viewer.