Java Reference
In-Depth Information
while (! curDate . after ( endDate )) {
StockPrice sp = em . find ( StockPrice . class , new
new StockPricePK ( s , curDate ));
iif ( sp != null
null ) {
iif ( firstDate == null
null ) {
firstDate = ( Date ) curDate . clone ();
prices . put (( Date ) curDate . clone (), sp );
lastDate = ( Date ) curDate . clone ();
curDate . setTime ( curDate . getTime () + msPerDay );
The loop is executed more often than the constructor itself, so the loop is subject to OSR
compilation. Note that it took a while for that method to be compiled; its compilation ID is
25, but it doesn't appear until other methods in the 900 range are being compiled. (It's easy
to read OSR lines like this example as 25% and wonder about the other 75%, but remember
that the number is the compilation ID, and the % just signifies OSR compilation.) That is
typical of OSR compilation; the stack replacement is harder to set up, but other compilation
can continue in the meantime.
1. The best way to gain visibility into how code is being compiled is by enabling
PrintCompilation .
2. Output from enabling PrintCompilation can be used to make sure that compila-
tion is proceeding as expected.
Advanced Compiler Tunings
This section fills in some remaining details on how compilation works, and in the process ex-
plores some additional tunings that can affect it. However, although these values can be
changed, there is really little reason to do so; the tunings exist to a large degree to help JVM
engineers diagnose the behavior of the JVM. If you're quite curious as to how the compiler
works, then this section will be interesting to you; otherwise, feel free to read ahead.
Search WWH ::

Custom Search