Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a525a0af18c910ecd718a764f33e47d121b1d06e
      
https://github.com/WebKit/WebKit/commit/a525a0af18c910ecd718a764f33e47d121b1d06e
  Author: Mark Lam <[email protected]>
  Date:   2025-08-13 (Wed, 13 Aug 2025)

  Changed paths:
    M Source/JavaScriptCore/llint/InPlaceInterpreter.asm
    M Source/JavaScriptCore/llint/WebAssembly.asm

  Log Message:
  -----------
  Consolidate Wasm arguments iterator offlineasm macros.
https://bugs.webkit.org/show_bug.cgi?id=297311
rdar://158192047

Reviewed by Daniel Liu.

There are currently many variations of macros whose purpose is to iterate the 
Wasm argument
registers.  These iterators were also trying to compute offsets in memory where 
the registers
will be stored.  This complicates the macros uncecessarily.

We can simplify these into only 2 macros: forEachWasmArgumentGPR and 
forEachWasmArgumentFPR,
by reducing their role to simply iterating the registers.  We'll let their 
client fully
define how they place the registers in memory instead.

Additional changes:
1. Also added some convenience functions 
preserve/restoreWasmArgumentRegisters() and
   preserve/restoreWasmArgumentRegistersWithSIMD().  The SIMD version is not 
currently usedi
   but will be needed in an upcming patch.

2. Renamed NumberOfWasmArgumentJSRs to NumberOfWasmArgumentGPRs.  These are 
only used for
   managing register spill/fills, and it's much easier to think of spill/fills 
in terms of
   GPRs than JS "Register"s.

3. Made forEachWasmArgumentGPR() and forEachWasmArgumentFPR() always pass a 
pair of registers
   instead of having a variant that only passes 1 register per iteration.  This 
allows us to
   invoke with these with just 1 callback macro and specialize for ports inside 
that macro.
   IMHO, it makes the code slightly easier to read and to understand its intent.

4. The following macros are now obsoleted and/or replaced:

       forEachArgumentJSR() - replaced by forEachWasmArgumentGPR()
       forEachArgumentFPR() - replaced by forEachWasmArgumentFPR()
       forEachVectorArgument() - use forEachWasmArgumentFPR() instead
       forEachReturnWasmJSR() - use forEachWasmArgumentGPR() instead
       forEachReturnJSJSR() - unused

This patch is effectively just a refactoring patch.  While it restructures the 
code to
improve readability and reuseability, it should produce exactly the same output.

* Source/JavaScriptCore/llint/InPlaceInterpreter.asm:
* Source/JavaScriptCore/llint/WebAssembly.asm:

Canonical link: https://commits.webkit.org/298634@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