On Thu, Apr 7, 2011 at 1:17 PM, Paul Gilmartin <[email protected]> wrote: > On Apr 7, 2011, at 14:02, Alex Kodat wrote: >> >> A programmer, on the other hand, even with only a glimmer of knowledge of >> what the program is doing can usually guess which if block is most likely to >> be executed so optimize the code for that if block, for example by holding >> registers and pointers needed for that if block over the whole loop while >> requiring saving and reestablishment of context for the unlikely if blocks. >> Programmers make decisions like this all the time without giving it much >> thought at all, the cumulative effect being that a compiler can huff and puff >> all it wants, it's at an unfair disadvantage and doesn't stand a chance. >> While some C compilers have a register directive that gives a hint to >> the compiler to try to keep a value in a register, this is a pretty blunt >> instrument and only buys one so much. >> > OTOH, I am led to believe that some Java VMs do dynamic recompilation, > monitoring the execution profile and adjusting the sequence of instructions > executed accordingly. This is real time information scarcely available > to the assembler programmer.
They do and it is amazing. > > -- gil >
