comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerAsserts.java @ 16051:da9b9b625818

Truffle FrameDescriptor: add compiler asserts
author Bernhard Urban <bernhard.urban@jku.at>
date Fri, 06 Jun 2014 09:40:22 +0200
parents 494b818b527c
children 9c4168877444
comparison
equal deleted inserted replaced
16050:7b37f1b6d188 16051:da9b9b625818
27 /** 27 /**
28 * Assertions about the code produced by the Truffle compiler. All operations have no effect when 28 * Assertions about the code produced by the Truffle compiler. All operations have no effect when
29 * either executed in the interpreter or in the compiled code. The assertions are checked during 29 * either executed in the interpreter or in the compiled code. The assertions are checked during
30 * code generation and the Truffle compiler produces for failing assertions a stack trace that 30 * code generation and the Truffle compiler produces for failing assertions a stack trace that
31 * identifies the code position of the assertion in the context of the current compilation. 31 * identifies the code position of the assertion in the context of the current compilation.
32 * 32 *
33 */ 33 */
34 public class CompilerAsserts { 34 public class CompilerAsserts {
35 35
36 /** 36 /**
37 * Assertion that this code position should never be reached during compilation. It can be used 37 * Assertion that this code position should never be reached during compilation. It can be used
40 * directive. 40 * directive.
41 */ 41 */
42 public static void neverPartOfCompilation() { 42 public static void neverPartOfCompilation() {
43 } 43 }
44 44
45 public static void neverPartOfCompilation(@SuppressWarnings("unused") String message) {
46 }
47
45 /** 48 /**
46 * Assertion that the corresponding value is reduced to a constant during compilation. 49 * Assertion that the corresponding value is reduced to a constant during compilation.
47 * 50 *
48 * @param value the value that must be constant during compilation 51 * @param value the value that must be constant during compilation
49 * @return the value given as parameter 52 * @return the value given as parameter
50 */ 53 */
51 public static boolean compilationConstant(boolean value) { 54 public static boolean compilationConstant(boolean value) {
52 return value; 55 return value;
53 } 56 }
54 57
55 /** 58 /**
56 * Assertion that the corresponding value is reduced to a constant during compilation. 59 * Assertion that the corresponding value is reduced to a constant during compilation.
57 * 60 *
58 * @param value the value that must be constant during compilation 61 * @param value the value that must be constant during compilation
59 * @return the value given as parameter 62 * @return the value given as parameter
60 */ 63 */
61 public static byte compilationConstant(byte value) { 64 public static byte compilationConstant(byte value) {
62 return value; 65 return value;
63 } 66 }
64 67
65 /** 68 /**
66 * Assertion that the corresponding value is reduced to a constant during compilation. 69 * Assertion that the corresponding value is reduced to a constant during compilation.
67 * 70 *
68 * @param value the value that must be constant during compilation 71 * @param value the value that must be constant during compilation
69 * @return the value given as parameter 72 * @return the value given as parameter
70 */ 73 */
71 public static char compilationConstant(char value) { 74 public static char compilationConstant(char value) {
72 return value; 75 return value;
73 } 76 }
74 77
75 /** 78 /**
76 * Assertion that the corresponding value is reduced to a constant during compilation. 79 * Assertion that the corresponding value is reduced to a constant during compilation.
77 * 80 *
78 * @param value the value that must be constant during compilation 81 * @param value the value that must be constant during compilation
79 * @return the value given as parameter 82 * @return the value given as parameter
80 */ 83 */
81 public static short compilationConstant(short value) { 84 public static short compilationConstant(short value) {
82 return value; 85 return value;
83 } 86 }
84 87
85 /** 88 /**
86 * Assertion that the corresponding value is reduced to a constant during compilation. 89 * Assertion that the corresponding value is reduced to a constant during compilation.
87 * 90 *
88 * @param value the value that must be constant during compilation 91 * @param value the value that must be constant during compilation
89 * @return the value given as parameter 92 * @return the value given as parameter
90 */ 93 */
91 public static int compilationConstant(int value) { 94 public static int compilationConstant(int value) {
92 return value; 95 return value;
93 } 96 }
94 97
95 /** 98 /**
96 * Assertion that the corresponding value is reduced to a constant during compilation. 99 * Assertion that the corresponding value is reduced to a constant during compilation.
97 * 100 *
98 * @param value the value that must be constant during compilation 101 * @param value the value that must be constant during compilation
99 * @return the value given as parameter 102 * @return the value given as parameter
100 */ 103 */
101 public static long compilationConstant(long value) { 104 public static long compilationConstant(long value) {
102 return value; 105 return value;
103 } 106 }
104 107
105 /** 108 /**
106 * Assertion that the corresponding value is reduced to a constant during compilation. 109 * Assertion that the corresponding value is reduced to a constant during compilation.
107 * 110 *
108 * @param value the value that must be constant during compilation 111 * @param value the value that must be constant during compilation
109 * @return the value given as parameter 112 * @return the value given as parameter
110 */ 113 */
111 public static float compilationConstant(float value) { 114 public static float compilationConstant(float value) {
112 return value; 115 return value;
113 } 116 }
114 117
115 /** 118 /**
116 * Assertion that the corresponding value is reduced to a constant during compilation. 119 * Assertion that the corresponding value is reduced to a constant during compilation.
117 * 120 *
118 * @param value the value that must be constant during compilation 121 * @param value the value that must be constant during compilation
119 * @return the value given as parameter 122 * @return the value given as parameter
120 */ 123 */
121 public static double compilationConstant(double value) { 124 public static double compilationConstant(double value) {
122 return value; 125 return value;
123 } 126 }
124 127
125 /** 128 /**
126 * Assertion that the corresponding value is reduced to a constant during compilation. 129 * Assertion that the corresponding value is reduced to a constant during compilation.
127 * 130 *
128 * @param value the value that must be constant during compilation 131 * @param value the value that must be constant during compilation
129 * @return the value given as parameter 132 * @return the value given as parameter
130 */ 133 */
131 public static Object compilationConstant(Object value) { 134 public static Object compilationConstant(Object value) {
132 return value; 135 return value;