Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Running the below code with the parameters reveals that both methods m3 is inlined first. i used the following parameters for jvm: <code>-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining</code>. Apparenly the method who's first execution count reaches the inlining threshold is inlined first. In our case m3. So for the hotspot i used for testing is down-top as <code>m3</code> is first executed and the <code>m2</code> execution ends.</p> <p>Code was run with jdk7_u40 with TieredCompilation disabled, server mode on windows 8 box. Output of the command was:</p> <pre><code> @ 66 java.lang.String::indexOfSupplementary (71 bytes) too big @ 21 methodTest::m3 (31 bytes) inline (hot) @ 11 methodTest::m2 (35 bytes) inline (hot) @ 21 methodTest::m3 (31 bytes) inline (hot) @ 14 methodTest::m1 (25 bytes) inline (hot) @ 11 methodTest::m2 (35 bytes) inline (hot) @ 21 methodTest::m3 (31 bytes) inline (hot) </code></pre> <p><code>m1</code> is <code>25 bytes</code> in size, <code>m2</code> is <code>35 bytes</code> and <code>m3</code> has <code>31 bytes</code>.</p> <pre><code>public class methodTest { public static void main(String[] args) { doTest(); } int i = 0; int j = 0; int k = 0; private static void doTest() { methodTest m = new methodTest(); for (int i = 0; i &lt; 1000000000; i++) { m.m1(); } System.out.println(m.i); System.out.println(m.j); System.out.println(m.k); } private void m1() { i++; m2(); j++; } private void m2() { i++; i++; m3(); j++; } private void m3() { i++; j++; k++; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload