Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/coreclr/build-runtime.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ if "%__TargetOS%"=="android" (
if "%__TargetOS%"=="browser" (
set __CrossTarget=1
)
if "%__TargetOS%"=="wasi" (
set __CrossTarget=1
)

if %__CrossTarget% EQU 0 (
call "%__RepoRootDir%\eng\native\version\copy_version_files.cmd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,22 @@ public void CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode, Logger log
}
}

// For managed methods on Wasm, add an interpreter-to-R2R thunk so the
// interpreter can call into this R2R-compiled function.
// For managed methods on Wasm, add both interpreter transition thunks for this
// method's signature. The interpreter-to-R2R thunk lets the interpreter call into
// this R2R function. The R2R-to-interpreter thunk is keyed by signature, not method:
// a method of the same shape that runs interpreted must be enterable from R2R (via a
// function pointer, delegate, virtual slot, or the interpreter's own
// GetMultiCallableAddrOfCode path), and its thunk is not otherwise rooted unless an
// R2R call site happens to share the signature.
if (_compilation.NodeFactory.Target.IsWasm && !MethodBeingCompiled.IsUnmanagedCallersOnly)
{
WasmSignature wasmSig = WasmLowering.GetSignature(MethodBeingCompiled);
AddAdditionalDependency(
_compilation.NodeFactory.WasmInterpreterToR2RThunk(wasmSig),
"Interpreter-to-R2R thunk for compiled method");
AddAdditionalDependency(
_compilation.NodeFactory.WasmR2RToInterpreterThunk(wasmSig),
"R2R-to-interpreter thunk for compiled method signature");
}

var compilationResult = CompileMethodInternal(methodCodeNodeNeedingCode, methodIL);
Expand Down
Loading
Loading