Mercurial > hg > truffle
comparison graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java @ 19507:1cde96b96673
Fixed code format issues.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 19 Feb 2015 16:15:56 +0100 |
parents | 9619ba4daf4c |
children | 48c1ebd24120 |
comparison
equal
deleted
inserted
replaced
19506:8c7536965c95 | 19507:1cde96b96673 |
---|---|
29 import com.oracle.graal.compiler.common.calc.*; | 29 import com.oracle.graal.compiler.common.calc.*; |
30 import com.oracle.graal.lir.asm.*; | 30 import com.oracle.graal.lir.asm.*; |
31 | 31 |
32 /** | 32 /** |
33 * This class encapsulates different strategies on how to generate code for switch instructions. | 33 * This class encapsulates different strategies on how to generate code for switch instructions. |
34 * | 34 * |
35 * The {@link #getBestStrategy(double[], JavaConstant[], LabelRef[])} method can be used to get | 35 * The {@link #getBestStrategy(double[], JavaConstant[], LabelRef[])} method can be used to get |
36 * strategy with the smallest average effort (average number of comparisons until a decision is | 36 * strategy with the smallest average effort (average number of comparisons until a decision is |
37 * reached). The strategy returned by this method will have its averageEffort set, while a strategy | 37 * reached). The strategy returned by this method will have its averageEffort set, while a strategy |
38 * constructed directly will not. | 38 * constructed directly will not. |
39 */ | 39 */ |
41 | 41 |
42 private interface SwitchClosure { | 42 private interface SwitchClosure { |
43 /** | 43 /** |
44 * Generates a conditional or unconditional jump. The jump will be unconditional if | 44 * Generates a conditional or unconditional jump. The jump will be unconditional if |
45 * condition is null. If defaultTarget is true, then the jump will go the the default. | 45 * condition is null. If defaultTarget is true, then the jump will go the the default. |
46 * | 46 * |
47 * @param index Index of the value and the jump target (only used if defaultTarget == false) | 47 * @param index Index of the value and the jump target (only used if defaultTarget == false) |
48 * @param condition The condition on which to jump (can be null) | 48 * @param condition The condition on which to jump (can be null) |
49 * @param defaultTarget true if the jump should go to the default target, false if index | 49 * @param defaultTarget true if the jump should go to the default target, false if index |
50 * should be used. | 50 * should be used. |
51 */ | 51 */ |
52 void conditionalJump(int index, Condition condition, boolean defaultTarget); | 52 void conditionalJump(int index, Condition condition, boolean defaultTarget); |
53 | 53 |
54 /** | 54 /** |
55 * Generates a conditional jump to the target with the specified index. The fall through | 55 * Generates a conditional jump to the target with the specified index. The fall through |
56 * should go to the default target. | 56 * should go to the default target. |
57 * | 57 * |
58 * @param index Index of the value and the jump target | 58 * @param index Index of the value and the jump target |
59 * @param condition The condition on which to jump | 59 * @param condition The condition on which to jump |
60 * @param canFallThrough true if this is the last instruction in the switch statement, to | 60 * @param canFallThrough true if this is the last instruction in the switch statement, to |
61 * allow for fall-through optimizations. | 61 * allow for fall-through optimizations. |
62 */ | 62 */ |
63 void conditionalJumpOrDefault(int index, Condition condition, boolean canFallThrough); | 63 void conditionalJumpOrDefault(int index, Condition condition, boolean canFallThrough); |
64 | 64 |
65 /** | 65 /** |
66 * Create a new label and generate a conditional jump to it. | 66 * Create a new label and generate a conditional jump to it. |
67 * | 67 * |
68 * @param index Index of the value and the jump target | 68 * @param index Index of the value and the jump target |
69 * @param condition The condition on which to jump | 69 * @param condition The condition on which to jump |
70 * @return a new Label | 70 * @return a new Label |
71 */ | 71 */ |
72 Label conditionalJump(int index, Condition condition); | 72 Label conditionalJump(int index, Condition condition); |