1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-10 18:11:04 +09:00
Satori/eng/native
Jakob Botsch Nielsen 073e35e7e3
Simplify "secret stub arg" handling between JIT and EE (#100823)
When a pinvoke/reverse pinvoke needs marshalling the VM creates an IL stub to
perform this marshalling. These IL stubs have a non-standard parameter called
the "secret stub parameter". The VM uses this parameter to map the IL stub back
to the user defined function that caused the IL stub to be required (multiple
user functions can share the same IL stubs, so the mapping cannot be done by
other means).

To facilitate the access of this value the JIT must make the parameter's value
available to the VM somehow. Previously this was done in two separate ways for
32-bit and 64-bit target:
- For 32-bit targets the parameter was marked as do-not-enregister and always
  spilled to the stack frame at a location that was known by the VM.
- For 64-bit targets the parameter was saved in the `InlinedCallFrame` as part
  of a VM helper call. We still marked it as do-not-enregister, probably because
  parameter homing did not handle it.

For 64-bit targets this introduces a bit of inefficiency: the secret stub
parameter is only needed for the IL stubs case, but `InlinedCallFrame` is used
for all inlined pinvokes. So we ended up with a larger frame than necessary and
with an additional store to the frame, even outside IL stubs.

This change removes that inefficiency by unifying how 32-bit and 64-bit targets
work:

- Switch all platforms to only allocate space in `InlinedCallFrame` for the
  secret stub parameter when necessary
- Move responsibility of storing the secret stub parameter out of
  `CORINFO_HELP_INIT_PINVOKE_FRAME` and to the JIT generated code
- Remove special casing of frame layout around the secret stub parameter and
  frame structures within the JIT
- Enable enregistration for the secret stub parameter

Fix #100662
2024-05-12 22:21:35 +02:00
..
ijw Revert "Windows executables: only load imported DLLs from System32 (#89311)" (#95540) 2023-12-04 10:50:12 -08:00
version Normalize RepoRoot path to improve logs readability (#80664) 2023-01-16 18:56:33 +01:00
build-commons.sh Bump minimum Apple OS versions (#101342) 2024-04-23 15:23:13 +02:00
configurecompiler.cmake Don't enable use-after-return checking on Apple's Clang (#101781) 2024-05-03 07:18:18 -07:00
configureoptimization.cmake Update Android NDK and set optimization flags (#68354) 2022-07-01 00:26:14 +02:00
configurepaths.cmake Surface native sourcelink on CoreCLR native PDBs for easier dump debugging (#66677) 2022-03-17 11:05:31 -07:00
configureplatform.cmake Backport assorted changes from runtimelab (#101655) 2024-04-30 06:26:56 -07:00
configuretools.cmake Fix ID regression in Alpine Linux builds (#86804) 2023-06-21 18:15:05 +02:00
createdump-entitlements.plist Entitle macOS executables while building (#92967) 2023-10-10 16:35:22 -07:00
entitlements.plist Entitle macOS executables while building (#92967) 2023-10-10 16:35:22 -07:00
functions.cmake Add build option to build Mac .dSYM debug symbol bundles (#100617) 2024-04-05 13:49:57 -07:00
gen-buildsys.cmd [wasm] Use source built emsdk packages for the runtime build (#100266) 2024-05-09 16:31:41 +02:00
gen-buildsys.sh Replace pushd/popd Calls With -S/-B CMake Flags in the Build System (#94353) 2023-11-29 10:46:09 -08:00
generateexportedsymbols.sh Replace AWK with Bash scripts (#46313) 2020-12-23 01:52:26 +01:00
generateversionscript.sh Replace AWK with Bash scripts (#46313) 2020-12-23 01:52:26 +01:00
genmoduleindex.cmd Implement native GetModuleIndex 2020-04-18 02:18:05 -07:00
genmoduleindex.sh Add introspection for readelf (#85298) 2023-04-26 12:07:58 -07:00
init-vs-env.cmd Try to disable VSIX update service and collect VS update logs (#91708) 2023-09-07 00:28:10 -07:00
naming.props Fix missing symbols for singlefilehost (#73269) 2022-08-03 12:42:03 -07:00
output-toolchain-info.cmake Fix libs.tests subset build on tizen arm64 (#63128) 2021-12-25 11:12:31 -08:00
sanitizer-ignorelist.txt Simplify "secret stub arg" handling between JIT and EE (#100823) 2024-05-12 22:21:35 +02:00
set-cmake-path.ps1 Reorganize CoreCLR native build to reduce CMake reconfigures when the build system is untouched (#49906) 2021-04-05 15:05:34 -07:00
tryrun.cmake Remove CoreCLR math.h CRT PAL Redefines (#98048) 2024-02-10 09:21:50 -08:00
tryrun_ios_tvos.cmake Remove CoreCLR math.h CRT PAL Redefines (#98048) 2024-02-10 09:21:50 -08:00