Merge: Link boost
authorJean Privat <jean@pryen.org>
Tue, 10 Feb 2015 03:32:23 +0000 (10:32 +0700)
committerJean Privat <jean@pryen.org>
Tue, 10 Feb 2015 03:32:23 +0000 (10:32 +0700)
Follow up of #1093

This time some vft optimizations with the option `--substitute-monomorph` that replaces monomorphic trampolines with direct call.
Late-binding is implemented with *trampolines*, that are small functions that just select and jump the to right implementations.
If, at link-time, is it known that the target will always by the same implementation then all calls to the trampoline are replaced by direct calls to this single implementation.

Note that using trampolines as indirection slows down the executable.
However, it is expected that the gain of monomorphic direct-calls overcompensates the additional indirections in polymorphic trampoline-calls.

This PR first implements trampoline then build the substitute thing on it.

For times (nitc/nitc/nitc)

* default: 0m7.216s
* --link-boost: 0m7.024s (-2,7%)

Not that impressive in fact :( but anyway this PR is still required for the next round of link-time optimizations

Pull-Request: #1155
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>


Trivial merge