hotspot inlining decision seems to be random

Christian Thalinger Christian.Thalinger at Sun.COM
Mon Dec 14 01:36:18 PST 2009


On Sat, 2009-12-12 at 18:01 +0100, Ulf Zibis wrote:
> Please refer to:
> [1]
> https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/j7_EUC_TW/log/C_d_b_reverse1-2_highSurrogate_PA.xml?rev=866&view=markup
> [2]
> https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/j7_EUC_TW/log/C_d_b_reverse1-2_highSurrogate_PA_2.xml?rev=866&view=markup
> [3] 
> https://java-nio-charset-enhanced.dev.java.net/source/browse/java-nio-charset-enhanced/branches/j7_EUC_TW/log/C_d_b_reverse1-2_highSurrogate_PA_3.xml?rev=868&view=markup
> 
> I have run [4] the same code [5] 3 times.
> On 1st run, method highSurrogate(int) [6] was inlined in Decoder$decode(...) [7] as hot ([1] line 
> 276-293), but not on 2nd run ([2] line 332-358).
> Can someone explain this, because method highSurrogate() was executed 26,314,402 times ([3] line 1932) ?
> 
> In [2] (line 125, 215) hotspot log says:
> @ 479   sun.nio.cs.ext.EUC_TW_C_d_b_reverse1$Decoder::decode  never executed
> @ 95   java.lang.Character::highSurrogate  executed < MinInliningThreshold
> 
> On 3rd run, method highSurrogate(char,char) [6] was inlined in Decoder$decode(...) [8] as hot ([3] 
> line 832-846), but not in 1st ([1] line 1012-1034) or 2nd run ([2] line 992-1014).
> So I can see that hotspot inlining decision was different in each 3 runs:
> 
>                               [1]       [2]       [3]
> 
> highSurrogate(int)         276-293   332-358   473-490
> [7] line 277                inline     call     inline
> 
> highSurrogate(char,char)  1012-1034  992-1014  832-846
> [8] line 277                 call      call     inline

I don't know what to do with all this information.  "I've run the same
code 3 times" is not very informative.  How did you run it 3 times?

It's true that the logs look different but without being able to
reproduce I can't tell what's going on.

-- Christian



More information about the hotspot-compiler-dev mailing list