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)
commita537279a64901c4d87e15e2053a980694df24acc
tree74d5f5620262b4048eadc111e4ef263de5634c34
parent4c690dc0db245b7ccbfadd70cc68ef73e4b95fed
parentdae5938af3fd31a3b9b2b5a5248976cfeaaa532e
Merge: Link boost

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>