dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.4k stars 196 forks source link

[Async-2] Fix resumption stub target in the presence of backpatching #2428

Closed jakobbotsch closed 9 months ago

jakobbotsch commented 9 months ago

The slot the tier 0 method gets is backpatched to point to the tier 1 method, so allocate a new slot for the target address to ensure that resumption stubs always resume in the right native code version.

Also fix the size used when storing the state field; we were storing 8 bytes, but the field is only 4 bytes (this wouldn't cause any ill effects as the flags field comes right after).

@VSadov This fixes the #2425 failure.