X hits on this document

PDF document

Program Transformations for Light-Weight CPU Accounting and Control in the Java Virtual Machine A ... - page 26 / 40





26 / 40


  • 2.

    Successors-based heuristics, by order of efficiency:

    • a)

      Avoid direct successors that raise an exception (3% miss rate).

    • b)

      Avoid direct successors that end with a return statement (27% miss rate).

    • c)

      In the presence of an if-then without an else structure, take the then branch (31% miss rate); this contradicts the hypothesis we made at point 3.b.i, but conforms to the findings of Ball and Larus [2] in the case of the C language. This heuristic nevertheless suffers from a high standard deviation, with e.g. a miss rate as high as 96% with the ‘db’ program of JVM98, and as low as 9% with ‘jess’.

3. Our default strategy is to choose the successor that follows the current branching node sequentially instead of the one targeted by the branch (41% miss rate). Part of the explanation for this may stem from the fact that each Java if condition is usually compiled into a bytecode that tests for the negation of the condition (in order to branch to the else part, if any, otherwise to the endif); therefore it could mean that the Java programmer tends to write his if tests in such a way that the most common treatment is located inside the then block, instead of the else block, if any.

We found that all other heuristics were unreliable (i.e. close to 50% of miss rate and/or a high standard deviation), such as the opcode- based tests for equality or nullness of operands. It is likely that such heuristics must be enhanced with data-flow analysis to become effec- tive. One could imagine further heuristics to experiment with, but at the same time, it is good to have only a few that do not require too much processing on each branching node.

As a caution, one should generalize from these results only if the SPEC JVM98 suite actually represents “standard Java coding practices”.

6.2.3. Benchmarking the SPP Scheme In addition to measuring the overhead due to our SPP scheme with the given heuristics, we also benchmarked a version of SPP where all heuristics were replaced by a completely random choice, using the random number generation of the Java class library. We can see that the random version performs almost as well as SPP with heuristics, and that the aggressive approximation performs clearly better, which is somewhat disappointing. This is because the random version may take good paths by chance, short-circuiting accounting operations that would otherwise exist with the Simple scheme. At places the gain of

Document info
Document views61
Page views61
Page last viewedMon Oct 24 05:59:58 UTC 2016