Three optimizations:
-
If it can be determined that there is no overridden method, the original dynamic method call
can be replaced with the static method call at compile time and can be executed without method lookup. (Completed)
-
If only one class implements an interface class, a virtual call with a single method lookup can
be generated using the implementation class as a static type.
-
If the target method is not overridden through the implementation class hierarchy, the compiler
can replace the interface call with a static method call.
These optimizations can enable inlining of virtual methods --- which can have significant performance improvements.
Three optimizations:
If it can be determined that there is no overridden method, the original dynamic method call(Completed)can be replaced with the static method call at compile time and can be executed without method lookup.
If only one class implements an interface class, a virtual call with a single method lookup can
be generated using the implementation class as a static type.
If the target method is not overridden through the implementation class hierarchy, the compiler
can replace the interface call with a static method call.
These optimizations can enable inlining of virtual methods --- which can have significant performance improvements.