Skip to content
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

[mono][aot] Prefer specific instances instead of gshared for methods … #76033

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

vargaz
Copy link
Contributor

@vargaz vargaz commented Sep 22, 2022

…containing static virtual calls.

These calls cannot be resolved at compile time in gshared methods, so they cannot be inlined etc. They are used in perf sensitive BCL code like SpanHelpers. To fix this, modify the AOT compiler so in addition to the gshared versions, it emits specific instances of these methods if possible. This only affects a small subset of gshared methods so it doesn't lead to a noticable code size increase.

Fixes #75801.

@vargaz
Copy link
Contributor Author

vargaz commented Sep 22, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vargaz vargaz force-pushed the aot-static-virtual branch 2 times, most recently from a610b06 to 2fa2524 Compare September 22, 2022 23:22
@vargaz
Copy link
Contributor Author

vargaz commented Sep 23, 2022

Test failures are unrelated:
#76041

@vargaz
Copy link
Contributor Author

vargaz commented Sep 23, 2022

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lewing
Copy link
Member

lewing commented Sep 24, 2022

category=OuterLoop -notrait category=failing
[23:03:23] info: Application arguments: --run WasmTestRunner.dll System.Runtime.Tests.dll -notrait category=AdditionalTimezoneChecks -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing
[23:03:23] info: browser: [main] Console websocket connected.
[23:03:58] info: Initializing.....
[23:03:58] info: Discovering: System.Runtime.Tests.dll (method display = ClassAndMethod, method display options = None)
[23:04:02] info: Discovered:  System.Runtime.Tests.dll (found 8917 of 9067 test cases)
[23:04:02] info: Using random seed for test cases: 251347065
[23:04:02] info: Using random seed for collections: 251347065
[23:04:02] info: Starting:    System.Runtime.Tests.dll
[23:04:14] fail: 122030640
[23:04:14] fail: 122030640
[23:04:14] fail: 122030640
[23:04:14] fail: 122030640
[23:04:14] info: WASM EXIT 1
[23:04:14] info: Waiting to flush log messages with a timeout of 120 secs ..
[23:04:14] fail: [out of order message from the browser]: http://127.0.0.1:49207/test-main.js 342:0 Uncaught (in promise)
[23:04:14] fail: [out of order message from the browser]: http://127.0.0.1:49207/dotnet.js 1882:6 Uncaught
[23:04:14] fail: Application has finished with exit code TESTS_FAILED but 0 was expected
XHarness exit code: 71 (GENERAL_FAILURE)

C:\helix\work\workitem\e\wasm_build\AppBundle>set EXIT_CODE=71 

looks like #74302

…containing static virtual calls.

These calls cannot be resolved at compile time in gshared methods, so they cannot be inlined etc.
They are used in perf sensitive BCL code like SpanHelpers. To fix this, modify the AOT compiler
so in addition to the gshared versions, it emits specific instances of these methods if possible.
This only affects a small subset of gshared methods so it doesn't lead to a noticable code size increase.

Fixes dotnet#75801.
@vargaz vargaz merged commit c7c6aa0 into dotnet:main Sep 27, 2022
@vargaz vargaz deleted the aot-static-virtual branch September 27, 2022 15:44
@ghost ghost locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mono AOT compiler cannot resolve and inline static virtual calls in gshared methods
3 participants