compiler: fast path is the hot path in once and literal strings
authorJean Privat <jean@pryen.org>
Mon, 2 Mar 2015 06:42:55 +0000 (13:42 +0700)
committerJean Privat <jean@pryen.org>
Mon, 2 Mar 2015 06:42:55 +0000 (13:42 +0700)
commit047d4cd9b74fe5506936af2ac4c05db35aac34e4
tree1ebb0aa46455ba6498ca86f1a53f957ccdf7196f
parentf1d9e76e62b1c001a7a10decd5815a7e0d5882a7
compiler: fast path is the hot path in once and literal strings

`once` structure and literal strings are implemented with a guard so that
onced-expression and literal strings are evaluated/created once then
stored in a static variable.

This patch just informs GCC that the fast path (get the saved value)
it the frequent path. It's up to GCC to do something useful with this
information.

It seems it does since number for nitc/nitc/nitc are

before: 0m7.324s
after: 0m7.156s (-2.3%)

Signed-off-by: Jean Privat <jean@pryen.org>
src/compiler/abstract_compiler.nit