Devirtualization is the process of converting virtual method calls on instances that might be
a JSO, a string or and array (like "obj.doFoo();") to static calls (like
"SomeClass.doFoo__devirtual$(obj)).
This transformation is done on arrays, strings and JSOs virtual method calls; as this objects
do not have the virtual methods in their prototypes. The static version is a trampoline that
decides how to dispatch the method.
See https://code.google.com/p/google-web-toolkit/wiki/OverlayTypes for why this is done for JSOs.
To complete the transformation:
-
1. methods that need to be devirtualized must be turned into static functions.
-
2. all method calls to the original functions must be rerouted either to the new static
version or to a static dispatcher trampoline function that is created by this pass.
These trampolines are created whether a call to the function exists for separate compiled
modules to work. In a globally optimized build unused ones are pruned away.
This transform may NOT be run multiple times; it will create ever-expanding replacement
expressions.