[webkit-changes] [WebKit/WebKit] 3823da: [JSC] Fix Windows x64 calling convention

Yusuke Suzuki noreply at github.com
Tue Mar 28 02:19:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3823da2aaaea23aa24cf344e09f7f4f89118ebc5
      https://github.com/WebKit/WebKit/commit/3823da2aaaea23aa24cf344e09f7f4f89118ebc5
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-03-28 (Tue, 28 Mar 2023)

  Changed paths:
    M Source/JavaScriptCore/CMakeLists.txt
    M Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
    M Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h
    M Source/JavaScriptCore/bytecode/RepatchInlines.h
    M Source/JavaScriptCore/dfg/DFGJITCompiler.h
    M Source/JavaScriptCore/dfg/DFGOperations.h
    M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
    M Source/JavaScriptCore/jit/CCallHelpers.h
    M Source/JavaScriptCore/jit/JIT.h
    M Source/JavaScriptCore/jit/JITOpcodes.cpp
    M Source/JavaScriptCore/jit/JITOperations.cpp
    M Source/JavaScriptCore/jit/JITOperations.h
    M Source/JavaScriptCore/jit/SlowPathCall.cpp
    M Source/JavaScriptCore/jit/ThunkGenerators.cpp
    M Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
    M Source/JavaScriptCore/llint/LLIntSlowPaths.h
    M Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
    M Source/JavaScriptCore/offlineasm/cloop.rb
    M Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
    M Source/JavaScriptCore/runtime/CommonSlowPaths.h
    M Source/JavaScriptCore/runtime/MatchResult.h
    M Source/JavaScriptCore/runtime/SlowPathFunction.h
    R Source/JavaScriptCore/runtime/SlowPathReturnType.h
    A Source/JavaScriptCore/runtime/UGPRPair.h
    M Source/JavaScriptCore/wasm/WasmSlowPaths.cpp
    M Source/JavaScriptCore/wasm/WasmSlowPaths.h
    M Source/JavaScriptCore/yarr/YarrJIT.h

  Log Message:
  -----------
  [JSC] Fix Windows x64 calling convention
https://bugs.webkit.org/show_bug.cgi?id=254573
rdar://107303745

Reviewed by Ross Kirsling.

This patch fixes many bugs in CCallHelpers for Windows x64 to make calling convention code work with paired results.

1. Remove SlowPathReturnType and consistently use UGPRPair instead for all code.
2. Fix many issues in Windows CCallHelpers related to placement of arguments on the stack.
3. Clean up MacroAssemblerX86_64::callWithUGPRPair (Windows only) code. It is handling many calling convention things but
   it should be done in CCallHelpers instead.

* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj:
* Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::callWithUGPRPair):
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType): Deleted.
* Source/JavaScriptCore/bytecode/RepatchInlines.h:
(JSC::handleHostCall):
(JSC::linkFor):
(JSC::virtualForWithFunction):
* Source/JavaScriptCore/dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::appendCallWithUGPRPair):
* Source/JavaScriptCore/dfg/DFGOperations.h:
(JSC::DFG::makeUGPRPair): Deleted.
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::appendCallWithUGPRPair):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):
* Source/JavaScriptCore/jit/CCallHelpers.h:
(JSC::CCallHelpers::marshallArgumentRegister):
(JSC::CCallHelpers::setupArgumentsImpl):
* Source/JavaScriptCore/jit/JIT.h:
* Source/JavaScriptCore/jit/JITOpcodes.cpp:
(JSC::JIT::op_enter_handlerGenerator):
* Source/JavaScriptCore/jit/JITOperations.cpp:
(JSC::JSC_DEFINE_JIT_OPERATION):
* Source/JavaScriptCore/jit/JITOperations.h:
* Source/JavaScriptCore/jit/SlowPathCall.cpp:
(JSC::JITSlowPathCall::generateThunk):
* Source/JavaScriptCore/jit/ThunkGenerators.cpp:
(JSC::remoteFunctionCallGenerator):
* Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:
(JSC::LLInt::llint_trace_operand):
(JSC::LLInt::llint_trace_value):
(JSC::LLInt::entryOSR):
(JSC::LLInt::llint_link_call):
(JSC::LLInt::llint_virtual_call):
(JSC::LLInt::handleHostCall):
(JSC::LLInt::setUpCall):
(JSC::LLInt::varargsSetup):
(JSC::LLInt::commonCallDirectEval):
(JSC::LLInt::dispatchToNextInstructionDuringExit):
(JSC::LLInt::llint_slow_path_checkpoint_osr_exit_from_inlined_call):
(JSC::LLInt::llint_slow_path_checkpoint_osr_exit):
(JSC::LLInt::llint_throw_stack_overflow_error):
(JSC::LLInt::llint_stack_check_at_vm_entry):
(JSC::LLInt::llint_check_vm_entry_permission):
* Source/JavaScriptCore/llint/LLIntSlowPaths.h:
* Source/JavaScriptCore/llint/LowLevelInterpreter.cpp:
(JSC::LLInt::decodeResult):
* Source/JavaScriptCore/offlineasm/cloop.rb:
* Source/JavaScriptCore/runtime/CommonSlowPaths.cpp:
(JSC::iteratorOpenTryFastImpl):
(JSC::iteratorNextTryFastImpl):
* Source/JavaScriptCore/runtime/CommonSlowPaths.h:
* Source/JavaScriptCore/runtime/MatchResult.h:
(JSC::MatchResult::MatchResult):
* Source/JavaScriptCore/runtime/SlowPathFunction.h:
* Source/JavaScriptCore/runtime/SlowPathReturnType.h:
(JSC::makeUGPRPair):
(JSC::encodeResult):
(JSC::decodeResult):
* Source/JavaScriptCore/runtime/UGPRPair.h: Copied from Source/JavaScriptCore/runtime/SlowPathReturnType.h.
(JSC::makeUGPRPair):
(JSC::encodeResult):
(JSC::decodeResult):
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::doWasmCall):
(JSC::LLInt::doWasmCallIndirect):
(JSC::LLInt::doWasmCallRef):
(JSC::LLInt::slow_path_wasm_throw_exception):
(JSC::LLInt::slow_path_wasm_popcount):
(JSC::LLInt::slow_path_wasm_popcountll):
* Source/JavaScriptCore/wasm/WasmSlowPaths.h:
* Source/JavaScriptCore/yarr/YarrJIT.h:

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




More information about the webkit-changes mailing list