Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[RuntimeAsync] ilasm/ildasm support for the MethodImpl.Async #115332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hez2010
Copy link
Contributor

@hez2010 hez2010 commented May 6, 2025

Implementing ilasm and ildasm support for RuntimeAsync following the spec.

Closes #115093

@Copilot Copilot AI review requested due to automatic review settings May 6, 2025 12:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for the "async" method implementation attribute to both ilasm and ildasm, in accordance with the RuntimeAsync specification. The changes include:

  • In il_kywd.h, a new keyword "async" is declared.
  • In dasm.cpp, the disassembler now checks for the async attribute and prints " async" in the output.

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.

File Description
src/coreclr/inc/il_kywd.h Added the "async" keyword definition to support async methods.
src/coreclr/ildasm/dasm.cpp Updated method dump logic to include "async" when the attribute is active.
Files not reviewed (2)
  • src/coreclr/ilasm/asmparse.y: Language not supported
  • src/coreclr/ilasm/prebuilt/asmparse.grammar: Language not supported

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 6, 2025
@huoyaoyuan
Copy link
Member

Combining MethodImplOptions.Async with MethodImplOptions.Synchronized is invalid.
Applying MethodImplOptions.Async to methods with a byref or ref-like return value is invalid.
Applying MethodImplOptions.Async to vararg methods is invalid.

Does ilasm do this sort of check?

@hez2010
Copy link
Contributor Author

hez2010 commented May 6, 2025

Does ilasm do this sort of check?

I don't think so. We don't have any of such check in ilasm, and it just emits whatever you write.
For example, today ilasm will happily take a byreflike type for a generic parameter that doesn't accept byreflike types. Such checks are done at the runtime.

@jkotas
Copy link
Member

jkotas commented May 6, 2025

I don't think so. We don't have any of such check in ilasm, and it just emits whatever you write.

Right, it is a by-design feature that ilasm can produce invalid IL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ILTools-coreclr community-contribution Indicates that the PR has been added by a community member runtime-async
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RuntimeAsync] Implement ilasm/ildasm support for the MethodImpl.Async
4 participants