I've been wondering about the cost of adding gc points to every backwards branch in LLVM (as would need to be done to make it multithreaded). A paper here http://research.sun.com/techrep/1998/abstract-70.html suggests the cost is around 5% of total running time (compared to code patching). What I was wondering was, does anyone know of any code metrics for large collections of Java bytecode? Eg what is the average number of bytecodes in a method, what is the average ratio of backward branches per bytecode and so on.
Is code patching a technique that has been widely employed in JIT compilers? (I liked the idea of using an access to a write-protected page to reduce the cost of polling!) Cheers, Dave
