At 15:51 -0500 1/15/04, Melvin Smith wrote:IMCC could analyze a module, decide if the optimization makes sense, and place commonly used values (constants or variables) in a pre-packaged register frame. (or more than 1) This is done at compile / load time of course. If it were all constants, compile time works, but for PMCs and Strings it would have to be built at loadtime.
Upon invoking a busy routine, it _might_ be more efficient (since we already save register frames anyway) to initialize the upper frame (top 16 registers) with a pre-built register set.
It might also be more useful to have it more granular than 16, maybe in 4s or 8s. By doing life analysis and some weighting, IMCC might be able to turn multiple symbol lookups into 1.
Comments & questions welcome.
Why am I thinking of the "register" keyword in C?
I have no idea and I can't see the relationship. :)
With Parrot's architecture, we have overhead of storing and retrieving globals, lexicals and package variables by _name_. This was a design choice, but it has ramifications.
C has none of this overhead since it does virtuall all of its symbol resolution at compile time or load time (except in the case of dlopen and company).
My email was concerned with storing/retrieving multiple variables with a single lookup, not with hinting to the compiler.
-Melvin