20 Table I. Overheads and optimizations for Step 1.
+Fixed arg passing
Sun 1.5.0 server
Account() in the beginning of every method. We can however, at the expense of a comprehensive class hierarchy analysis process, completely duplicate most JDK methods, so that there always is one version with the original signature, and a second one with the additional Thread- CPUAccount argument. This approach works well, but is quite complex, and unfortunately results in an appreciable speedup only with certain JVMs. Further details on this are to be found in .
Looking at Table I, we can see that considerable progress has been made, starting from our reference, at the first line, i.e., the overhead when rewriting both SPEC JVM98 and JDK in Simple mode. The optimizations designed for Step 1 are particularly beneficial on the Sun JVM in interpreted mode, which does not have the ability to dynami- cally inline the ubiquitous invocation to jdkGetCurrentAccount(), nor the invocations that the inlined body of getCurrentAccount() itself contains. As expected, Wrapper mode rewriting brings the best speedup to applications that have the highest ratios of method invocations, like ‘mtrt’ and ‘compress’ . In fact, rewriting the application layer (here: SPEC JVM98) in Wrapper mode is always a benefit, but rewriting also the JDK in Wrapper mode is only interesting on half of the platforms (Sun JVM in interpreted mode and IBM). The last line of the table, entitled +Fixed arg passing, will be described in the next section.
5.2. Fixed Argument Passing
In this section we further improve the way the ThreadCPUAccount reference is passed as an extra argument upon method invocation. Our hypothesis is that if this extra argument is passed always at the same, fixed position in the argument list, the JIT (if any) may skip some machine instructions that would be required to shift this argument from one position to another between two invocations.
To achieve this effect, the bytecode transformation tool will some- times have to insert dummy arguments at the lower positions, when