-
Notifications
You must be signed in to change notification settings - Fork 334
Closed
Labels
Description
During compilation, in MethodDefinitions IR pass, we create static method variants for instance methods.
What would it take to register only static methods in each type? What's an invocation of (x:Integer).to_text anyway? It should be convertible to Integer.to_text x - e.g. an instance invocation just resolves the right method based on the type of the instances, but then it invokes the static Function.
Benefit:
- reduce the amount of
Functioninstances in the system by half - reduce size of IR caches by 30%
Prior art:
- Graal compiler sees all JVM methods as static (instances methods of a class being static and having
thisas first argument) - the compiler only has special
InvokeNodethat deals with finding the right method to invoke when virtual dispatch is necessary
Originally posted by @JaroslavTulach in #11501 (comment)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
🟢 Accepted