Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 73f0c9d430cbc013ee54681b495425edd921da0c
      
https://github.com/WebKit/WebKit/commit/73f0c9d430cbc013ee54681b495425edd921da0c
  Author: Dan Hecht <[email protected]>
  Date:   2025-09-29 (Mon, 29 Sep 2025)

  Changed paths:
    A JSTests/wasm/stress/simd-instructions-calls.js
    M Source/JavaScriptCore/llint/InPlaceInterpreter.h
    M Source/JavaScriptCore/llint/InPlaceInterpreter32_64.asm
    M Source/JavaScriptCore/llint/InPlaceInterpreter64.asm
    M Source/JavaScriptCore/wasm/WasmCallee.cpp
    M Source/JavaScriptCore/wasm/WasmCallee.h
    M Source/JavaScriptCore/wasm/WasmCallingConvention.h
    M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h
    M Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp
    M Source/JavaScriptCore/wasm/WasmIPIntGenerator.h

  Log Message:
  -----------
  [JSC] WASM IPInt SIMD: add support for v128 arguments and results in IPInt 
call and tail-call instructions
https://bugs.webkit.org/show_bug.cgi?id=299606
rdar://161412501

Reviewed by Yusuke Suzuki.

Supporting v128 call/tail-call argument and results requires removing
the various assumptions that IPInt makes that callframe arguments are
fixed sizes, as follows:

* CallInformation abstraction changes:

- CallInformation was exposing the number of argument/result stack
values in the callframe. WasmIPIntGenerator was using this information
and assuming fixed size arguments/results. This breaks the abstraction
since native callframes have variable sized elements. Instead, expose
the byte sizes of the header region and total size (already exposed).
These are redundant with the argument and result location lists but
are a useful summary for the clients.

* Bytecode generation updates:

- Update the bytecode generators to not assume uniform argument/result
sizes. Add various asserts that verifies that the bytecode metadata
and interpreters are in agreement and will tell us what "small"
bytecode needs to be updated if/when we change the wasm calling
convention. We could make the bytecode more generic but I didn't do
that in this change to minimize risk.

- m_highestReturnStackOffset was storing address of the top return
value. Now, m_topOfReturnStackFPOffset stores the address of the first
byte above the top return
value.

- The trailing metadata for mINT tail call now stores the size of the
argument space rather than the number of arguments, and the
corresponding loop in ipint_perform_tail_call that copies this region
is updated.

* Bytecode interpreter updates:

- All the "small" interpreter bytecodes that operate on FP registers
now operate on the full 128-bits rather than 64-bits.

- Introduce argumINT, uINT, and mINT bytecodes to handle vectors.
Also rename existing ones for clarity and consistency. Also make
bytecode enum values and handlers similarly named for clarity.

- Fix a hardcoded uintDispatch bounds check.

* Stack management fixes:

- The uINT destination stack (for copying results into the caller's
callframe when returning) was an empty descending stack, meaning each
bytecode allocated the space for the next result, assuming each result
is 8-bytes. But since callframe results aren't fixed size, change this
to a full descending stack so that each bytecode allocates its own
stack space since each bytecode knows the size of its result.

* Misc cleanup:

- Don't skip the WASM stack size asserts when useWasmIPIntSIMD is enabled.

- Factor redundant mINT argument bytecode generators into a single generator.

* Testing:

- Add a table driven test to make it easier to verify call and
tail-call frame construction cases. Each test case specifies the
signature of the callee and how callee results should be constructed
based on the arguments, and then the test harness generates the WAT
for the test case. I plan to extend this later to add more dimensions
to the test matrix, for example, to explicitly cover calling between
tiers and the indirect/ref call types.

Test: JSTests/wasm/stress/simd-instructions-calls.js
* JSTests/wasm/stress/simd-instructions-calls.js: Added.
(logV):
(i.i.2.0.i.10.5.5):
(resultMapping.new.Array.fill.map):
(generateSignature):
* Source/JavaScriptCore/llint/InPlaceInterpreter.h:
* Source/JavaScriptCore/llint/InPlaceInterpreter32_64.asm:
* Source/JavaScriptCore/llint/InPlaceInterpreter64.asm:
* Source/JavaScriptCore/wasm/WasmCallee.cpp:
(JSC::Wasm::IPIntCallee::IPIntCallee):
* Source/JavaScriptCore/wasm/WasmCallee.h:
* Source/JavaScriptCore/wasm/WasmCallingConvention.h:
(JSC::Wasm::CallInformation::CallInformation):
(JSC::Wasm::WasmCallingConvention::callInformationFor const):
(JSC::Wasm::JSCallingConvention::callInformationFor const):
(JSC::Wasm::WasmCallingConvention::numberOfStackArguments const): Deleted.
(JSC::Wasm::WasmCallingConvention::numberOfStackValues const): Deleted.
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp:
(JSC::Wasm::FunctionIPIntMetadataGenerator::addReturnData):
* Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h:
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp:
(JSC::Wasm::IPIntGenerator::assertAboutStackSize):
(JSC::Wasm::IPIntGenerator::addArguments):
(JSC::Wasm::addCallArgumentBytecode):
(JSC::Wasm::addCallResultBytecode):
(JSC::Wasm::IPIntGenerator::addCallCommonData):
(JSC::Wasm::IPIntGenerator::addTailCallCommonData):
(JSC::Wasm::IPIntGenerator::addCall):
(JSC::Wasm::IPIntGenerator::addCallIndirect):
(JSC::Wasm::IPIntGenerator::addCallRef):
* Source/JavaScriptCore/wasm/WasmIPIntGenerator.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to