Bug 1890513: Directly invoke variadic native functions. r=jandem
commit1928539e57f55ed755d681630a399f4773fbd2e2
authorAndré Bargull <andre.bargull@gmail.com>
Mon, 15 Apr 2024 14:39:04 +0000 (15 14:39 +0000)
committerAndré Bargull <andre.bargull@gmail.com>
Mon, 15 Apr 2024 14:39:04 +0000 (15 14:39 +0000)
tree4e0d8bc89810199288dc3a2ccbddf5a528da4506
parentb50231ef5cb31733cd59eff8b29c039db032393d
Bug 1890513: Directly invoke variadic native functions. r=jandem

CodeGenerator.cpp:
Split `emitCallNative` into two methods, so we can reuse it for `emitApplyNative`.
Also add some comments how `NativeExitFrameLayout` is constructed on the stack and
add an assertion that the native C++ function returned an object when constructing.
`emitCallNative` uses `setupAlignedABICall`, so we now need to align the Value
arguments, this happens through the new `emitAlignStackForApplyNative` method.

LIR-shared.h, Lowering.cpp:
The callee doesn't need to be stored which frees up one register, so we can
allocate an additional temp-register. This matches the approach taken for
`LCallNative`. The additional temp register is needed, because `emitCallNative`
requires four registers.

VMFunctions:
- Remove no longer used `InvokeNativeFunction`.

Differential Revision: https://phabricator.services.mozilla.com/D207005
js/src/jit/CodeGenerator.cpp
js/src/jit/CodeGenerator.h
js/src/jit/Lowering.cpp
js/src/jit/VMFunctionList-inl.h
js/src/jit/VMFunctions.cpp
js/src/jit/VMFunctions.h
js/src/jit/shared/LIR-shared.h