Skip to content
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e93e57d
Revert wasm method stub method in crossgen to allow invoking the actu…
adamperlin Dec 9, 2025
4b991da
WIP add args as locals to the beginning of method epilog in Wasm codegen
adamperlin Dec 10, 2025
5933e67
Multiple fixes for emitting local declarations for incoming args
adamperlin Dec 11, 2025
7b8e339
jit-format
adamperlin Dec 11, 2025
78b7c70
Merge branch 'main' of github.com:dotnet/runtime into adamperlin/wasm…
adamperlin Dec 11, 2025
9fbfb86
Generate locals only for non-args
adamperlin Dec 11, 2025
7d12af0
Update src/coreclr/jit/emit.h
adamperlin Dec 11, 2025
4b91b3a
Update src/coreclr/jit/emitfmtswasm.h
adamperlin Dec 11, 2025
183851f
Update src/coreclr/jit/codegencommon.cpp
adamperlin Dec 11, 2025
c9d3046
Update src/coreclr/jit/emitwasm.cpp
adamperlin Dec 11, 2025
0482ee3
Remove incorrect noway_asserts
adamperlin Dec 11, 2025
dfb0627
Remove empty ifdef block
adamperlin Dec 11, 2025
b237c17
Apply some copilot review suggestions
adamperlin Dec 11, 2025
19c9eaf
Address some review feedback
adamperlin Dec 12, 2025
76a15f2
Finish addressing review feedback
adamperlin Dec 12, 2025
d32f695
Fix instGen placement
adamperlin Dec 12, 2025
f3e2f82
Add block->IsLast() guard for emitting end instruction in Wasm genFnE…
adamperlin Dec 13, 2025
0820a24
Emit correct local count for current state of Wasm codegen
adamperlin Dec 13, 2025
78945a3
Address some more review feedback
adamperlin Dec 16, 2025
9a3c21a
Merge branch 'main' of github.com:dotnet/runtime into wasm-arg-initia…
adamperlin Dec 16, 2025
ddb4801
Address additional review feedback
adamperlin Dec 17, 2025
704a4a7
Merge branch 'main' of github.com:dotnet/runtime into wasm-arg-initia…
adamperlin Dec 17, 2025
7bb7cfc
Apply suggestion from @SingleAccretion
adamperlin Dec 17, 2025
06207d5
Address additional review feedback; properly guard access to wasm-spe…
adamperlin Dec 17, 2025
c52da98
Address additional review feedback
adamperlin Dec 17, 2025
9373181
Fix condition for `end` generation in src/coreclr/jit/codegenwasm.cpp
adamperlin Dec 17, 2025
29a82df
Update src/coreclr/jit/codegenwasm.cpp
adamperlin Dec 17, 2025
afc4638
Update src/coreclr/jit/emit.h
adamperlin Dec 17, 2025
5a32a13
Address additional review feedback
adamperlin Dec 17, 2025
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
Next Next commit
Revert wasm method stub method in crossgen to allow invoking the actu…
…al JIT, since the RyuJIT backend is now emitting Wasm
  • Loading branch information
adamperlin committed Dec 9, 2025
commit e93e57de65650c5a7c1b0cf39d7a7ff9358932b7
42 changes: 2 additions & 40 deletions src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,36 +317,6 @@ IntPtr LocalObjectToHandle(object input)
return null;
}

private CorJitResult CompileWasmStub(out IntPtr exception, ref CORINFO_METHOD_INFO methodInfo, out uint codeSize)
{
byte[] stub =
[
0x00, // local variable count
0x41, // i32.const
0x0, // uleb128 0
0x0F, // return
0x0B, // end
];
AllocMemArgs args = new AllocMemArgs
{
hotCodeSize = (uint)stub.Length,
coldCodeSize = (uint)0,
roDataSize = (uint)0,
xcptnsCount = _ehClauses != null ? (uint)_ehClauses.Length : 0,
flag = CorJitAllocMemFlag.CORJIT_ALLOCMEM_DEFAULT_CODE_ALIGN,
};
allocMem(ref args);

_code = stub;

codeSize = (uint)stub.Length;
exception = IntPtr.Zero;

_codeRelocs = new();

return CorJitResult.CORJIT_OK;
}

private CompilationResult CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL)
{
// methodIL must not be null
Expand All @@ -369,17 +339,9 @@ private CompilationResult CompileMethodInternal(IMethodNode methodCodeNodeNeedin
IntPtr exception;
IntPtr nativeEntry;
uint codeSize;

TargetArchitecture architecture = _compilation.TypeSystemContext.Target.Architecture;
var result = architecture switch
{
// We currently do not have WASM codegen support, but for testing, we will return a stub
TargetArchitecture.Wasm32 => CompileWasmStub(out exception, ref methodInfo, out codeSize),
_ => JitCompileMethod(out exception,
var result = JitCompileMethod(out exception,
_jit, (IntPtr)(&_this), _unmanagedCallbacks,
ref methodInfo, (uint)CorJitFlag.CORJIT_FLAG_CALL_GETJITFLAGS, out nativeEntry, out codeSize)
};

ref methodInfo, (uint)CorJitFlag.CORJIT_FLAG_CALL_GETJITFLAGS, out nativeEntry, out codeSize);
if (exception != IntPtr.Zero)
{
if (_lastException != null)
Expand Down
Loading