[GR-65719] Delay methods to the application layer #11976
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows to delay any method to the application layer.
Currently, the only way to mark a method as delayed to the application layer is to use the programatical API in
AnalysisMethod.Any method delayed to the application layer must be compiled only in the application layer. A call to such method in a shared layer will be replaced by an indirect call. The compilation of those methods is then forced in the application layer and the corresponding symbol is declared as global.
A delayed method that is not referenced in any shared layer is treated as a normal method in the application layer and does not have to be compiled. If it is only referenced in the application layer, it might be inlined and not compiled at all.
This PR also introduces the
CompilationBehaviorwhich will contain all the states that a method can have regarding compilation in layered images. There are only three states at the moment, but it might be extended with other intermediate states in the future.