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] Emit only virtual methods of instances when a class insta… #80267

Closed
wants to merge 1 commit into from

Conversation

vargaz
Copy link
Contributor

@vargaz vargaz commented Jan 5, 2023

…nce is added.

@vargaz
Copy link
Contributor Author

vargaz commented Jan 5, 2023

This saves a lot of space, but it might cause regressions since less method instances are emitted.

@lewing
Copy link
Member

lewing commented Jan 6, 2023

runtime (Build Linux x64 Release AllSubsets_Mono_LLVMFullAot_RuntimeTests llvmfullaot) failed with

Ran out of trampolines of type 3 in '/datadisks/disk1/work/B6DC09BF/p/System.Private.CoreLib.dll' (limit 4400)

which I don't think is unique to this?

@lambdageek
Copy link
Member

Won't this leave out a ton of methods? Why do we only want virtual ones?

For example anything that uses typeof(GenericParam) will be left out:

class GenericContainer<T> {
  public int SomeMethod() {
    if (typeof(T) == typeof(string))
      return 1;
    return 2;
   }
}

@vargaz
Copy link
Contributor Author

vargaz commented Jan 18, 2023

This is just an experiment. Right now, if we encounter a generic instance, we will add all of its methods which leads to a ton of code generated which will never be called.

@vargaz
Copy link
Contributor Author

vargaz commented Jan 25, 2023

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vargaz
Copy link
Contributor Author

vargaz commented Jan 26, 2023

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vargaz
Copy link
Contributor Author

vargaz commented Jan 26, 2023

/azp run runtime-extra-platforms-other

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@vargaz
Copy link
Contributor Author

vargaz commented Jan 26, 2023

/azp run runtime-llvm

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@vargaz
Copy link
Contributor Author

vargaz commented Jan 26, 2023

/azp run list

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@vargaz
Copy link
Contributor Author

vargaz commented Jan 26, 2023

/azp list

@azure-pipelines
Copy link

CI/CD Pipelines for this repository:

@vargaz
Copy link
Contributor Author

vargaz commented Jan 26, 2023

/azp run runtime-llvm

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@vargaz
Copy link
Contributor Author

vargaz commented Jan 27, 2023

/azp run runtime-llvm

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@vargaz
Copy link
Contributor Author

vargaz commented Jan 27, 2023

This saves about 100k (2%) on a wasm hello world.

@vargaz
Copy link
Contributor Author

vargaz commented Apr 24, 2023

/azp run runtime-wasm

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ghost ghost locked as resolved and limited conversation to collaborators May 24, 2023
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.

4 participants