摘要 |
Early Java Virtual Machine implementations executed Java programs very slowly since the Java byte codes were interpreted. Later, Java compilers were introduced to improve performance. To further improve performance, the present invention introduces a method of dynamically optimizing computer code. The method of the present invention first compiles Java byte code into an object code. While compiling, the method introduces instrumentation code into the object code that performs path profiling. Specifically, the path profiling instrumentation code determines which execution paths are executed most often by counting the number of times each possible execution path is executed. When a particular execution path exceeds a threshold value, then that execution path is deemed a "hot" execution path. The hot execution path is then dynamically optimized. The optimized hot path is then executed instead of the original compiled object code for improved performance.
|