Skip to content

Optimization: Devirtualize Virtual Dispatch Method Calls to Static Calls #402

Description

@tgiphil

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions