author | thartmann |
Tue, 07 Jun 2016 18:20:44 +0200 | |
changeset 39263 | d139a133ba27 |
parent 38060 | 954c9575f653 |
child 43673 | bf2f6d3f8f5e |
permissions | -rw-r--r-- |
1 | 1 |
/* |
39263
d139a133ba27
8158228: C1 incorrectly folds mismatched loads from stable arrays
thartmann
parents:
38060
diff
changeset
|
2 |
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5046
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5046
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5046
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "c1/c1_Canonicalizer.hpp" |
|
27 |
#include "c1/c1_InstructionPrinter.hpp" |
|
28 |
#include "c1/c1_ValueStack.hpp" |
|
29 |
#include "ci/ciArray.hpp" |
|
30 |
#include "runtime/sharedRuntime.hpp" |
|
1 | 31 |
|
32 |
||
5707 | 33 |
class PrintValueVisitor: public ValueVisitor { |
34 |
void visit(Value* vp) { |
|
35 |
(*vp)->print_line(); |
|
36 |
} |
|
37 |
}; |
|
1 | 38 |
|
39 |
void Canonicalizer::set_canonical(Value x) { |
|
40 |
assert(x != NULL, "value must exist"); |
|
41 |
// Note: we can not currently substitute root nodes which show up in |
|
42 |
// the instruction stream (because the instruction list is embedded |
|
43 |
// in the instructions). |
|
44 |
if (canonical() != x) { |
|
12947
ba8ba6c2dd83
7172843: C1: fix "assert(has_printable_bci()) failed: _printable_bci should have been set"
twisti
parents:
11886
diff
changeset
|
45 |
#ifndef PRODUCT |
ba8ba6c2dd83
7172843: C1: fix "assert(has_printable_bci()) failed: _printable_bci should have been set"
twisti
parents:
11886
diff
changeset
|
46 |
if (!x->has_printable_bci()) { |
ba8ba6c2dd83
7172843: C1: fix "assert(has_printable_bci()) failed: _printable_bci should have been set"
twisti
parents:
11886
diff
changeset
|
47 |
x->set_printable_bci(bci()); |
ba8ba6c2dd83
7172843: C1: fix "assert(has_printable_bci()) failed: _printable_bci should have been set"
twisti
parents:
11886
diff
changeset
|
48 |
} |
ba8ba6c2dd83
7172843: C1: fix "assert(has_printable_bci()) failed: _printable_bci should have been set"
twisti
parents:
11886
diff
changeset
|
49 |
#endif |
1 | 50 |
if (PrintCanonicalization) { |
5707 | 51 |
PrintValueVisitor do_print_value; |
52 |
canonical()->input_values_do(&do_print_value); |
|
1 | 53 |
canonical()->print_line(); |
54 |
tty->print_cr("canonicalized to:"); |
|
5707 | 55 |
x->input_values_do(&do_print_value); |
1 | 56 |
x->print_line(); |
57 |
tty->cr(); |
|
58 |
} |
|
59 |
assert(_canonical->type()->tag() == x->type()->tag(), "types must match"); |
|
60 |
_canonical = x; |
|
61 |
} |
|
62 |
} |
|
63 |
||
64 |
||
65 |
void Canonicalizer::move_const_to_right(Op2* x) { |
|
66 |
if (x->x()->type()->is_constant() && x->is_commutative()) x->swap_operands(); |
|
67 |
} |
|
68 |
||
69 |
||
70 |
void Canonicalizer::do_Op2(Op2* x) { |
|
71 |
if (x->x() == x->y()) { |
|
72 |
switch (x->op()) { |
|
73 |
case Bytecodes::_isub: set_constant(0); return; |
|
74 |
case Bytecodes::_lsub: set_constant(jlong_cast(0)); return; |
|
75 |
case Bytecodes::_iand: // fall through |
|
76 |
case Bytecodes::_land: // fall through |
|
77 |
case Bytecodes::_ior: // fall through |
|
78 |
case Bytecodes::_lor : set_canonical(x->x()); return; |
|
79 |
case Bytecodes::_ixor: set_constant(0); return; |
|
80 |
case Bytecodes::_lxor: set_constant(jlong_cast(0)); return; |
|
81 |
} |
|
82 |
} |
|
83 |
||
84 |
if (x->x()->type()->is_constant() && x->y()->type()->is_constant()) { |
|
85 |
// do constant folding for selected operations |
|
86 |
switch (x->type()->tag()) { |
|
87 |
case intTag: |
|
88 |
{ jint a = x->x()->type()->as_IntConstant()->value(); |
|
89 |
jint b = x->y()->type()->as_IntConstant()->value(); |
|
90 |
switch (x->op()) { |
|
91 |
case Bytecodes::_iadd: set_constant(a + b); return; |
|
92 |
case Bytecodes::_isub: set_constant(a - b); return; |
|
93 |
case Bytecodes::_imul: set_constant(a * b); return; |
|
94 |
case Bytecodes::_idiv: |
|
95 |
if (b != 0) { |
|
96 |
if (a == min_jint && b == -1) { |
|
97 |
set_constant(min_jint); |
|
98 |
} else { |
|
99 |
set_constant(a / b); |
|
100 |
} |
|
101 |
return; |
|
102 |
} |
|
103 |
break; |
|
104 |
case Bytecodes::_irem: |
|
105 |
if (b != 0) { |
|
106 |
if (a == min_jint && b == -1) { |
|
107 |
set_constant(0); |
|
108 |
} else { |
|
109 |
set_constant(a % b); |
|
110 |
} |
|
111 |
return; |
|
112 |
} |
|
113 |
break; |
|
114 |
case Bytecodes::_iand: set_constant(a & b); return; |
|
115 |
case Bytecodes::_ior : set_constant(a | b); return; |
|
116 |
case Bytecodes::_ixor: set_constant(a ^ b); return; |
|
117 |
} |
|
118 |
} |
|
119 |
break; |
|
120 |
case longTag: |
|
121 |
{ jlong a = x->x()->type()->as_LongConstant()->value(); |
|
122 |
jlong b = x->y()->type()->as_LongConstant()->value(); |
|
123 |
switch (x->op()) { |
|
124 |
case Bytecodes::_ladd: set_constant(a + b); return; |
|
125 |
case Bytecodes::_lsub: set_constant(a - b); return; |
|
126 |
case Bytecodes::_lmul: set_constant(a * b); return; |
|
127 |
case Bytecodes::_ldiv: |
|
128 |
if (b != 0) { |
|
129 |
set_constant(SharedRuntime::ldiv(b, a)); |
|
130 |
return; |
|
131 |
} |
|
132 |
break; |
|
133 |
case Bytecodes::_lrem: |
|
134 |
if (b != 0) { |
|
135 |
set_constant(SharedRuntime::lrem(b, a)); |
|
136 |
return; |
|
137 |
} |
|
138 |
break; |
|
139 |
case Bytecodes::_land: set_constant(a & b); return; |
|
140 |
case Bytecodes::_lor : set_constant(a | b); return; |
|
141 |
case Bytecodes::_lxor: set_constant(a ^ b); return; |
|
142 |
} |
|
143 |
} |
|
144 |
break; |
|
145 |
// other cases not implemented (must be extremely careful with floats & doubles!) |
|
146 |
} |
|
147 |
} |
|
148 |
// make sure constant is on the right side, if any |
|
149 |
move_const_to_right(x); |
|
150 |
||
151 |
if (x->y()->type()->is_constant()) { |
|
152 |
// do constant folding for selected operations |
|
153 |
switch (x->type()->tag()) { |
|
154 |
case intTag: |
|
155 |
if (x->y()->type()->as_IntConstant()->value() == 0) { |
|
156 |
switch (x->op()) { |
|
157 |
case Bytecodes::_iadd: set_canonical(x->x()); return; |
|
158 |
case Bytecodes::_isub: set_canonical(x->x()); return; |
|
159 |
case Bytecodes::_imul: set_constant(0); return; |
|
160 |
// Note: for div and rem, make sure that C semantics |
|
161 |
// corresponds to Java semantics! |
|
162 |
case Bytecodes::_iand: set_constant(0); return; |
|
163 |
case Bytecodes::_ior : set_canonical(x->x()); return; |
|
164 |
} |
|
165 |
} |
|
166 |
break; |
|
167 |
case longTag: |
|
168 |
if (x->y()->type()->as_LongConstant()->value() == (jlong)0) { |
|
169 |
switch (x->op()) { |
|
170 |
case Bytecodes::_ladd: set_canonical(x->x()); return; |
|
171 |
case Bytecodes::_lsub: set_canonical(x->x()); return; |
|
172 |
case Bytecodes::_lmul: set_constant((jlong)0); return; |
|
173 |
// Note: for div and rem, make sure that C semantics |
|
174 |
// corresponds to Java semantics! |
|
175 |
case Bytecodes::_land: set_constant((jlong)0); return; |
|
176 |
case Bytecodes::_lor : set_canonical(x->x()); return; |
|
177 |
} |
|
178 |
} |
|
179 |
break; |
|
180 |
} |
|
181 |
} |
|
182 |
} |
|
183 |
||
184 |
||
185 |
void Canonicalizer::do_Phi (Phi* x) {} |
|
186 |
void Canonicalizer::do_Constant (Constant* x) {} |
|
187 |
void Canonicalizer::do_Local (Local* x) {} |
|
188 |
void Canonicalizer::do_LoadField (LoadField* x) {} |
|
189 |
||
190 |
// checks if v is in the block that is currently processed by |
|
191 |
// GraphBuilder. This is the only block that has not BlockEnd yet. |
|
192 |
static bool in_current_block(Value v) { |
|
193 |
int max_distance = 4; |
|
194 |
while (max_distance > 0 && v != NULL && v->as_BlockEnd() == NULL) { |
|
195 |
v = v->next(); |
|
196 |
max_distance--; |
|
197 |
} |
|
198 |
return v == NULL; |
|
199 |
} |
|
200 |
||
201 |
void Canonicalizer::do_StoreField (StoreField* x) { |
|
202 |
// If a value is going to be stored into a field or array some of |
|
203 |
// the conversions emitted by javac are unneeded because the fields |
|
204 |
// are packed to their natural size. |
|
205 |
Convert* conv = x->value()->as_Convert(); |
|
206 |
if (conv) { |
|
207 |
Value value = NULL; |
|
208 |
BasicType type = x->field()->type()->basic_type(); |
|
209 |
switch (conv->op()) { |
|
210 |
case Bytecodes::_i2b: if (type == T_BYTE) value = conv->value(); break; |
|
211 |
case Bytecodes::_i2s: if (type == T_SHORT || type == T_BYTE) value = conv->value(); break; |
|
212 |
case Bytecodes::_i2c: if (type == T_CHAR || type == T_BYTE) value = conv->value(); break; |
|
213 |
} |
|
214 |
// limit this optimization to current block |
|
215 |
if (value != NULL && in_current_block(conv)) { |
|
216 |
set_canonical(new StoreField(x->obj(), x->offset(), x->field(), value, x->is_static(), |
|
8671
13ffa40a2f0a
6965570: assert(!needs_patching && x->is_loaded(),"how do we know it's volatile if it's not loaded")
never
parents:
8065
diff
changeset
|
217 |
x->state_before(), x->needs_patching())); |
1 | 218 |
return; |
219 |
} |
|
220 |
} |
|
221 |
||
222 |
} |
|
223 |
||
224 |
void Canonicalizer::do_ArrayLength (ArrayLength* x) { |
|
36310
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
225 |
NewArray* na; |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
226 |
Constant* ct; |
36325
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
227 |
LoadField* lf; |
36310
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
228 |
|
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
229 |
if ((na = x->array()->as_NewArray()) != NULL) { |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
230 |
// New arrays might have the known length. |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
231 |
// Do not use the Constant itself, but create a new Constant |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
232 |
// with same value Otherwise a Constant is live over multiple |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
233 |
// blocks without being registered in a state array. |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
234 |
Constant* length; |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
235 |
if (na->length() != NULL && |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
236 |
(length = na->length()->as_Constant()) != NULL) { |
1 | 237 |
assert(length->type()->as_IntConstant() != NULL, "array length must be integer"); |
238 |
set_constant(length->type()->as_IntConstant()->value()); |
|
239 |
} |
|
36310
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
240 |
|
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
241 |
} else if ((ct = x->array()->as_Constant()) != NULL) { |
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
242 |
// Constant arrays have constant lengths. |
36317
5c78a6c34390
8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
36310
diff
changeset
|
243 |
ArrayConstant* cnst = ct->type()->as_ArrayConstant(); |
5c78a6c34390
8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
36310
diff
changeset
|
244 |
if (cnst != NULL) { |
5c78a6c34390
8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
36310
diff
changeset
|
245 |
set_constant(cnst->value()->length()); |
5c78a6c34390
8150514: C1 crashes in Canonicalizer::do_ArrayLength() after fix for JDK-8150102
shade
parents:
36310
diff
changeset
|
246 |
} |
36310
bcc01156b370
8150102: C1 should fold arraylength for constant/trusted arrays
shade
parents:
36058
diff
changeset
|
247 |
|
36325
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
248 |
} else if ((lf = x->array()->as_LoadField()) != NULL) { |
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
249 |
ciField* field = lf->field(); |
38030
93f24e7b3c43
8152590: C2: @Stable support doesn't always work w/ incremental inlining
vlivanov
parents:
36604
diff
changeset
|
250 |
if (field->is_static_constant()) { |
36325
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
251 |
assert(PatchALot || ScavengeRootsInCode < 2, "Constant field loads are folded during parsing"); |
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
252 |
ciObject* c = field->constant_value().as_object(); |
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
253 |
if (!c->is_null_object()) { |
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
254 |
set_constant(c->as_array()->length()); |
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
255 |
} |
1330e79162ac
8150534: C1 compilation fails with "Constant field loads are folded during parsing"
shade
parents:
36317
diff
changeset
|
256 |
} |
1 | 257 |
} |
258 |
} |
|
259 |
||
36604 | 260 |
void Canonicalizer::do_LoadIndexed (LoadIndexed* x) { |
261 |
StableArrayConstant* array = x->array()->type()->as_StableArrayConstant(); |
|
262 |
IntConstant* index = x->index()->type()->as_IntConstant(); |
|
263 |
||
264 |
assert(array == NULL || FoldStableValues, "not enabled"); |
|
265 |
||
266 |
// Constant fold loads from stable arrays. |
|
39263
d139a133ba27
8158228: C1 incorrectly folds mismatched loads from stable arrays
thartmann
parents:
38060
diff
changeset
|
267 |
if (!x->mismatched() && array != NULL && index != NULL) { |
36604 | 268 |
jint idx = index->value(); |
269 |
if (idx < 0 || idx >= array->value()->length()) { |
|
270 |
// Leave the load as is. The range check will handle it. |
|
271 |
return; |
|
272 |
} |
|
273 |
||
274 |
ciConstant field_val = array->value()->element_value(idx); |
|
275 |
if (!field_val.is_null_or_zero()) { |
|
276 |
jint dimension = array->dimension(); |
|
277 |
assert(dimension <= array->value()->array_type()->dimension(), "inconsistent info"); |
|
278 |
ValueType* value = NULL; |
|
279 |
if (dimension > 1) { |
|
280 |
// Preserve information about the dimension for the element. |
|
281 |
assert(field_val.as_object()->is_array(), "not an array"); |
|
282 |
value = new StableArrayConstant(field_val.as_object()->as_array(), dimension - 1); |
|
283 |
} else { |
|
284 |
assert(dimension == 1, "sanity"); |
|
285 |
value = as_ValueType(field_val); |
|
286 |
} |
|
287 |
set_canonical(new Constant(value)); |
|
288 |
} |
|
289 |
} |
|
290 |
} |
|
291 |
||
1 | 292 |
void Canonicalizer::do_StoreIndexed (StoreIndexed* x) { |
293 |
// If a value is going to be stored into a field or array some of |
|
294 |
// the conversions emitted by javac are unneeded because the fields |
|
295 |
// are packed to their natural size. |
|
296 |
Convert* conv = x->value()->as_Convert(); |
|
297 |
if (conv) { |
|
298 |
Value value = NULL; |
|
299 |
BasicType type = x->elt_type(); |
|
300 |
switch (conv->op()) { |
|
301 |
case Bytecodes::_i2b: if (type == T_BYTE) value = conv->value(); break; |
|
302 |
case Bytecodes::_i2s: if (type == T_SHORT || type == T_BYTE) value = conv->value(); break; |
|
303 |
case Bytecodes::_i2c: if (type == T_CHAR || type == T_BYTE) value = conv->value(); break; |
|
304 |
} |
|
305 |
// limit this optimization to current block |
|
306 |
if (value != NULL && in_current_block(conv)) { |
|
307 |
set_canonical(new StoreIndexed(x->array(), x->index(), x->length(), |
|
37480 | 308 |
x->elt_type(), value, x->state_before(), |
309 |
x->check_boolean())); |
|
1 | 310 |
return; |
311 |
} |
|
312 |
} |
|
313 |
} |
|
314 |
||
315 |
||
316 |
void Canonicalizer::do_NegateOp(NegateOp* x) { |
|
317 |
ValueType* t = x->x()->type(); |
|
318 |
if (t->is_constant()) { |
|
319 |
switch (t->tag()) { |
|
320 |
case intTag : set_constant(-t->as_IntConstant ()->value()); return; |
|
321 |
case longTag : set_constant(-t->as_LongConstant ()->value()); return; |
|
322 |
case floatTag : set_constant(-t->as_FloatConstant ()->value()); return; |
|
323 |
case doubleTag: set_constant(-t->as_DoubleConstant()->value()); return; |
|
324 |
default : ShouldNotReachHere(); |
|
325 |
} |
|
326 |
} |
|
327 |
} |
|
328 |
||
329 |
||
330 |
void Canonicalizer::do_ArithmeticOp (ArithmeticOp* x) { do_Op2(x); } |
|
331 |
||
332 |
||
333 |
void Canonicalizer::do_ShiftOp (ShiftOp* x) { |
|
334 |
ValueType* t = x->x()->type(); |
|
335 |
ValueType* t2 = x->y()->type(); |
|
336 |
if (t->is_constant()) { |
|
337 |
switch (t->tag()) { |
|
338 |
case intTag : if (t->as_IntConstant()->value() == 0) { set_constant(0); return; } break; |
|
339 |
case longTag : if (t->as_LongConstant()->value() == (jlong)0) { set_constant(jlong_cast(0)); return; } break; |
|
340 |
default : ShouldNotReachHere(); |
|
341 |
} |
|
342 |
if (t2->is_constant()) { |
|
343 |
if (t->tag() == intTag) { |
|
344 |
int value = t->as_IntConstant()->value(); |
|
345 |
int shift = t2->as_IntConstant()->value() & 31; |
|
346 |
jint mask = ~(~0 << (32 - shift)); |
|
347 |
if (shift == 0) mask = ~0; |
|
348 |
switch (x->op()) { |
|
349 |
case Bytecodes::_ishl: set_constant(value << shift); return; |
|
350 |
case Bytecodes::_ishr: set_constant(value >> shift); return; |
|
351 |
case Bytecodes::_iushr: set_constant((value >> shift) & mask); return; |
|
352 |
} |
|
353 |
} else if (t->tag() == longTag) { |
|
354 |
jlong value = t->as_LongConstant()->value(); |
|
355 |
int shift = t2->as_IntConstant()->value() & 63; |
|
356 |
jlong mask = ~(~jlong_cast(0) << (64 - shift)); |
|
357 |
if (shift == 0) mask = ~jlong_cast(0); |
|
358 |
switch (x->op()) { |
|
359 |
case Bytecodes::_lshl: set_constant(value << shift); return; |
|
360 |
case Bytecodes::_lshr: set_constant(value >> shift); return; |
|
361 |
case Bytecodes::_lushr: set_constant((value >> shift) & mask); return; |
|
362 |
} |
|
363 |
} |
|
364 |
} |
|
365 |
} |
|
366 |
if (t2->is_constant()) { |
|
367 |
switch (t2->tag()) { |
|
368 |
case intTag : if (t2->as_IntConstant()->value() == 0) set_canonical(x->x()); return; |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
369 |
case longTag : if (t2->as_LongConstant()->value() == (jlong)0) set_canonical(x->x()); return; |
1 | 370 |
default : ShouldNotReachHere(); |
371 |
} |
|
372 |
} |
|
373 |
} |
|
374 |
||
375 |
||
376 |
void Canonicalizer::do_LogicOp (LogicOp* x) { do_Op2(x); } |
|
377 |
void Canonicalizer::do_CompareOp (CompareOp* x) { |
|
378 |
if (x->x() == x->y()) { |
|
379 |
switch (x->x()->type()->tag()) { |
|
380 |
case longTag: set_constant(0); break; |
|
381 |
case floatTag: { |
|
382 |
FloatConstant* fc = x->x()->type()->as_FloatConstant(); |
|
383 |
if (fc) { |
|
384 |
if (g_isnan(fc->value())) { |
|
385 |
set_constant(x->op() == Bytecodes::_fcmpl ? -1 : 1); |
|
386 |
} else { |
|
387 |
set_constant(0); |
|
388 |
} |
|
389 |
} |
|
390 |
break; |
|
391 |
} |
|
392 |
case doubleTag: { |
|
393 |
DoubleConstant* dc = x->x()->type()->as_DoubleConstant(); |
|
394 |
if (dc) { |
|
395 |
if (g_isnan(dc->value())) { |
|
396 |
set_constant(x->op() == Bytecodes::_dcmpl ? -1 : 1); |
|
397 |
} else { |
|
398 |
set_constant(0); |
|
399 |
} |
|
400 |
} |
|
401 |
break; |
|
402 |
} |
|
403 |
} |
|
404 |
} else if (x->x()->type()->is_constant() && x->y()->type()->is_constant()) { |
|
405 |
switch (x->x()->type()->tag()) { |
|
406 |
case longTag: { |
|
407 |
jlong vx = x->x()->type()->as_LongConstant()->value(); |
|
408 |
jlong vy = x->y()->type()->as_LongConstant()->value(); |
|
409 |
if (vx == vy) |
|
410 |
set_constant(0); |
|
411 |
else if (vx < vy) |
|
412 |
set_constant(-1); |
|
413 |
else |
|
414 |
set_constant(1); |
|
415 |
break; |
|
416 |
} |
|
417 |
||
418 |
case floatTag: { |
|
419 |
float vx = x->x()->type()->as_FloatConstant()->value(); |
|
420 |
float vy = x->y()->type()->as_FloatConstant()->value(); |
|
421 |
if (g_isnan(vx) || g_isnan(vy)) |
|
422 |
set_constant(x->op() == Bytecodes::_fcmpl ? -1 : 1); |
|
423 |
else if (vx == vy) |
|
424 |
set_constant(0); |
|
425 |
else if (vx < vy) |
|
426 |
set_constant(-1); |
|
427 |
else |
|
428 |
set_constant(1); |
|
429 |
break; |
|
430 |
} |
|
431 |
||
432 |
case doubleTag: { |
|
433 |
double vx = x->x()->type()->as_DoubleConstant()->value(); |
|
434 |
double vy = x->y()->type()->as_DoubleConstant()->value(); |
|
435 |
if (g_isnan(vx) || g_isnan(vy)) |
|
436 |
set_constant(x->op() == Bytecodes::_dcmpl ? -1 : 1); |
|
437 |
else if (vx == vy) |
|
438 |
set_constant(0); |
|
439 |
else if (vx < vy) |
|
440 |
set_constant(-1); |
|
441 |
else |
|
442 |
set_constant(1); |
|
443 |
break; |
|
444 |
} |
|
445 |
} |
|
446 |
||
447 |
} |
|
448 |
} |
|
449 |
||
450 |
||
451 |
void Canonicalizer::do_IfInstanceOf(IfInstanceOf* x) {} |
|
452 |
||
453 |
void Canonicalizer::do_IfOp(IfOp* x) { |
|
454 |
// Caution: do not use do_Op2(x) here for now since |
|
455 |
// we map the condition to the op for now! |
|
456 |
move_const_to_right(x); |
|
457 |
} |
|
458 |
||
459 |
||
460 |
void Canonicalizer::do_Intrinsic (Intrinsic* x) { |
|
461 |
switch (x->id()) { |
|
462 |
case vmIntrinsics::_floatToRawIntBits : { |
|
463 |
FloatConstant* c = x->argument_at(0)->type()->as_FloatConstant(); |
|
464 |
if (c != NULL) { |
|
465 |
JavaValue v; |
|
466 |
v.set_jfloat(c->value()); |
|
467 |
set_constant(v.get_jint()); |
|
468 |
} |
|
469 |
break; |
|
470 |
} |
|
471 |
case vmIntrinsics::_intBitsToFloat : { |
|
472 |
IntConstant* c = x->argument_at(0)->type()->as_IntConstant(); |
|
473 |
if (c != NULL) { |
|
474 |
JavaValue v; |
|
475 |
v.set_jint(c->value()); |
|
476 |
set_constant(v.get_jfloat()); |
|
477 |
} |
|
478 |
break; |
|
479 |
} |
|
480 |
case vmIntrinsics::_doubleToRawLongBits : { |
|
481 |
DoubleConstant* c = x->argument_at(0)->type()->as_DoubleConstant(); |
|
482 |
if (c != NULL) { |
|
483 |
JavaValue v; |
|
484 |
v.set_jdouble(c->value()); |
|
485 |
set_constant(v.get_jlong()); |
|
486 |
} |
|
487 |
break; |
|
488 |
} |
|
489 |
case vmIntrinsics::_longBitsToDouble : { |
|
490 |
LongConstant* c = x->argument_at(0)->type()->as_LongConstant(); |
|
491 |
if (c != NULL) { |
|
492 |
JavaValue v; |
|
493 |
v.set_jlong(c->value()); |
|
494 |
set_constant(v.get_jdouble()); |
|
495 |
} |
|
496 |
break; |
|
497 |
} |
|
12949 | 498 |
case vmIntrinsics::_isInstance : { |
499 |
assert(x->number_of_arguments() == 2, "wrong type"); |
|
500 |
||
501 |
InstanceConstant* c = x->argument_at(0)->type()->as_InstanceConstant(); |
|
502 |
if (c != NULL && !c->value()->is_null_object()) { |
|
503 |
// ciInstance::java_mirror_type() returns non-NULL only for Java mirrors |
|
36552 | 504 |
ciType* t = c->value()->java_mirror_type(); |
12949 | 505 |
if (t->is_klass()) { |
506 |
// substitute cls.isInstance(obj) of a constant Class into |
|
507 |
// an InstantOf instruction |
|
12950
ab4f4afb3988
7174884: C1: failures after 7171890: assert(cur_state != NULL) failed: state_before must be set
twisti
parents:
12949
diff
changeset
|
508 |
InstanceOf* i = new InstanceOf(t->as_klass(), x->argument_at(1), x->state_before()); |
12949 | 509 |
set_canonical(i); |
510 |
// and try to canonicalize even further |
|
511 |
do_InstanceOf(i); |
|
512 |
} else { |
|
513 |
assert(t->is_primitive_type(), "should be a primitive type"); |
|
514 |
// cls.isInstance(obj) always returns false for primitive classes |
|
515 |
set_constant(0); |
|
516 |
} |
|
517 |
} |
|
518 |
break; |
|
519 |
} |
|
36552 | 520 |
case vmIntrinsics::_isPrimitive : { |
521 |
assert(x->number_of_arguments() == 1, "wrong type"); |
|
522 |
||
523 |
// Class.isPrimitive is known on constant classes: |
|
524 |
InstanceConstant* c = x->argument_at(0)->type()->as_InstanceConstant(); |
|
525 |
if (c != NULL && !c->value()->is_null_object()) { |
|
526 |
ciType* t = c->value()->java_mirror_type(); |
|
527 |
set_constant(t->is_primitive_type()); |
|
528 |
} |
|
529 |
break; |
|
530 |
} |
|
1 | 531 |
} |
532 |
} |
|
533 |
||
534 |
void Canonicalizer::do_Convert (Convert* x) { |
|
535 |
if (x->value()->type()->is_constant()) { |
|
536 |
switch (x->op()) { |
|
537 |
case Bytecodes::_i2b: set_constant((int)((x->value()->type()->as_IntConstant()->value() << 24) >> 24)); break; |
|
538 |
case Bytecodes::_i2s: set_constant((int)((x->value()->type()->as_IntConstant()->value() << 16) >> 16)); break; |
|
539 |
case Bytecodes::_i2c: set_constant((int)(x->value()->type()->as_IntConstant()->value() & ((1<<16)-1))); break; |
|
540 |
case Bytecodes::_i2l: set_constant((jlong)(x->value()->type()->as_IntConstant()->value())); break; |
|
541 |
case Bytecodes::_i2f: set_constant((float)(x->value()->type()->as_IntConstant()->value())); break; |
|
542 |
case Bytecodes::_i2d: set_constant((double)(x->value()->type()->as_IntConstant()->value())); break; |
|
543 |
case Bytecodes::_l2i: set_constant((int)(x->value()->type()->as_LongConstant()->value())); break; |
|
544 |
case Bytecodes::_l2f: set_constant(SharedRuntime::l2f(x->value()->type()->as_LongConstant()->value())); break; |
|
545 |
case Bytecodes::_l2d: set_constant(SharedRuntime::l2d(x->value()->type()->as_LongConstant()->value())); break; |
|
546 |
case Bytecodes::_f2d: set_constant((double)(x->value()->type()->as_FloatConstant()->value())); break; |
|
547 |
case Bytecodes::_f2i: set_constant(SharedRuntime::f2i(x->value()->type()->as_FloatConstant()->value())); break; |
|
548 |
case Bytecodes::_f2l: set_constant(SharedRuntime::f2l(x->value()->type()->as_FloatConstant()->value())); break; |
|
549 |
case Bytecodes::_d2f: set_constant((float)(x->value()->type()->as_DoubleConstant()->value())); break; |
|
550 |
case Bytecodes::_d2i: set_constant(SharedRuntime::d2i(x->value()->type()->as_DoubleConstant()->value())); break; |
|
551 |
case Bytecodes::_d2l: set_constant(SharedRuntime::d2l(x->value()->type()->as_DoubleConstant()->value())); break; |
|
552 |
default: |
|
553 |
ShouldNotReachHere(); |
|
554 |
} |
|
555 |
} |
|
556 |
||
557 |
Value value = x->value(); |
|
558 |
BasicType type = T_ILLEGAL; |
|
559 |
LoadField* lf = value->as_LoadField(); |
|
560 |
if (lf) { |
|
561 |
type = lf->field_type(); |
|
562 |
} else { |
|
563 |
LoadIndexed* li = value->as_LoadIndexed(); |
|
564 |
if (li) { |
|
565 |
type = li->elt_type(); |
|
566 |
} else { |
|
567 |
Convert* conv = value->as_Convert(); |
|
568 |
if (conv) { |
|
569 |
switch (conv->op()) { |
|
570 |
case Bytecodes::_i2b: type = T_BYTE; break; |
|
571 |
case Bytecodes::_i2s: type = T_SHORT; break; |
|
572 |
case Bytecodes::_i2c: type = T_CHAR; break; |
|
573 |
} |
|
574 |
} |
|
575 |
} |
|
576 |
} |
|
577 |
if (type != T_ILLEGAL) { |
|
578 |
switch (x->op()) { |
|
579 |
case Bytecodes::_i2b: if (type == T_BYTE) set_canonical(x->value()); break; |
|
580 |
case Bytecodes::_i2s: if (type == T_SHORT || type == T_BYTE) set_canonical(x->value()); break; |
|
581 |
case Bytecodes::_i2c: if (type == T_CHAR) set_canonical(x->value()); break; |
|
582 |
} |
|
583 |
} else { |
|
584 |
Op2* op2 = x->value()->as_Op2(); |
|
585 |
if (op2 && op2->op() == Bytecodes::_iand && op2->y()->type()->is_constant()) { |
|
586 |
jint safebits = 0; |
|
587 |
jint mask = op2->y()->type()->as_IntConstant()->value(); |
|
588 |
switch (x->op()) { |
|
589 |
case Bytecodes::_i2b: safebits = 0x7f; break; |
|
590 |
case Bytecodes::_i2s: safebits = 0x7fff; break; |
|
591 |
case Bytecodes::_i2c: safebits = 0xffff; break; |
|
592 |
} |
|
593 |
// When casting a masked integer to a smaller signed type, if |
|
594 |
// the mask doesn't include the sign bit the cast isn't needed. |
|
595 |
if (safebits && (mask & ~safebits) == 0) { |
|
596 |
set_canonical(x->value()); |
|
597 |
} |
|
598 |
} |
|
599 |
} |
|
600 |
||
601 |
} |
|
602 |
||
603 |
void Canonicalizer::do_NullCheck (NullCheck* x) { |
|
604 |
if (x->obj()->as_NewArray() != NULL || x->obj()->as_NewInstance() != NULL) { |
|
605 |
set_canonical(x->obj()); |
|
606 |
} else { |
|
607 |
Constant* con = x->obj()->as_Constant(); |
|
608 |
if (con) { |
|
609 |
ObjectType* c = con->type()->as_ObjectType(); |
|
610 |
if (c && c->is_loaded()) { |
|
611 |
ObjectConstant* oc = c->as_ObjectConstant(); |
|
612 |
if (!oc || !oc->value()->is_null_object()) { |
|
613 |
set_canonical(con); |
|
614 |
} |
|
615 |
} |
|
616 |
} |
|
617 |
} |
|
618 |
} |
|
619 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
12950
diff
changeset
|
620 |
void Canonicalizer::do_TypeCast (TypeCast* x) {} |
1 | 621 |
void Canonicalizer::do_Invoke (Invoke* x) {} |
622 |
void Canonicalizer::do_NewInstance (NewInstance* x) {} |
|
623 |
void Canonicalizer::do_NewTypeArray (NewTypeArray* x) {} |
|
624 |
void Canonicalizer::do_NewObjectArray (NewObjectArray* x) {} |
|
625 |
void Canonicalizer::do_NewMultiArray (NewMultiArray* x) {} |
|
626 |
void Canonicalizer::do_CheckCast (CheckCast* x) { |
|
627 |
if (x->klass()->is_loaded()) { |
|
628 |
Value obj = x->obj(); |
|
629 |
ciType* klass = obj->exact_type(); |
|
630 |
if (klass == NULL) klass = obj->declared_type(); |
|
631 |
if (klass != NULL && klass->is_loaded() && klass->is_subtype_of(x->klass())) { |
|
632 |
set_canonical(obj); |
|
633 |
return; |
|
634 |
} |
|
635 |
// checkcast of null returns null |
|
636 |
if (obj->as_Constant() && obj->type()->as_ObjectType()->constant_value()->is_null_object()) { |
|
637 |
set_canonical(obj); |
|
638 |
} |
|
639 |
} |
|
640 |
} |
|
641 |
void Canonicalizer::do_InstanceOf (InstanceOf* x) { |
|
642 |
if (x->klass()->is_loaded()) { |
|
643 |
Value obj = x->obj(); |
|
644 |
ciType* exact = obj->exact_type(); |
|
645 |
if (exact != NULL && exact->is_loaded() && (obj->as_NewInstance() || obj->as_NewArray())) { |
|
646 |
set_constant(exact->is_subtype_of(x->klass()) ? 1 : 0); |
|
647 |
return; |
|
648 |
} |
|
649 |
// instanceof null returns false |
|
650 |
if (obj->as_Constant() && obj->type()->as_ObjectType()->constant_value()->is_null_object()) { |
|
651 |
set_constant(0); |
|
652 |
} |
|
653 |
} |
|
654 |
||
655 |
} |
|
656 |
void Canonicalizer::do_MonitorEnter (MonitorEnter* x) {} |
|
657 |
void Canonicalizer::do_MonitorExit (MonitorExit* x) {} |
|
658 |
void Canonicalizer::do_BlockBegin (BlockBegin* x) {} |
|
659 |
void Canonicalizer::do_Goto (Goto* x) {} |
|
660 |
||
661 |
||
662 |
static bool is_true(jlong x, If::Condition cond, jlong y) { |
|
663 |
switch (cond) { |
|
664 |
case If::eql: return x == y; |
|
665 |
case If::neq: return x != y; |
|
666 |
case If::lss: return x < y; |
|
667 |
case If::leq: return x <= y; |
|
668 |
case If::gtr: return x > y; |
|
669 |
case If::geq: return x >= y; |
|
670 |
} |
|
671 |
ShouldNotReachHere(); |
|
672 |
return false; |
|
673 |
} |
|
674 |
||
11787
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
675 |
static bool is_safepoint(BlockEnd* x, BlockBegin* sux) { |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
676 |
// An Instruction with multiple successors, x, is replaced by a Goto |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
677 |
// to a single successor, sux. Is a safepoint check needed = was the |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
678 |
// instruction being replaced a safepoint and the single remaining |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
679 |
// successor a back branch? |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
680 |
return x->is_safepoint() && (sux->bci() < x->state_before()->bci()); |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
681 |
} |
1 | 682 |
|
683 |
void Canonicalizer::do_If(If* x) { |
|
684 |
// move const to right |
|
685 |
if (x->x()->type()->is_constant()) x->swap_operands(); |
|
686 |
// simplify |
|
687 |
const Value l = x->x(); ValueType* lt = l->type(); |
|
688 |
const Value r = x->y(); ValueType* rt = r->type(); |
|
689 |
||
690 |
if (l == r && !lt->is_float_kind()) { |
|
691 |
// pattern: If (a cond a) => simplify to Goto |
|
33589
7cbd1b2c139b
8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.
goetz
parents:
28954
diff
changeset
|
692 |
BlockBegin* sux = NULL; |
1 | 693 |
switch (x->cond()) { |
694 |
case If::eql: sux = x->sux_for(true); break; |
|
695 |
case If::neq: sux = x->sux_for(false); break; |
|
696 |
case If::lss: sux = x->sux_for(false); break; |
|
697 |
case If::leq: sux = x->sux_for(true); break; |
|
698 |
case If::gtr: sux = x->sux_for(false); break; |
|
699 |
case If::geq: sux = x->sux_for(true); break; |
|
33589
7cbd1b2c139b
8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.
goetz
parents:
28954
diff
changeset
|
700 |
default: ShouldNotReachHere(); |
1 | 701 |
} |
702 |
// If is a safepoint then the debug information should come from the state_before of the If. |
|
11787
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
703 |
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux))); |
1 | 704 |
return; |
705 |
} |
|
706 |
||
707 |
if (lt->is_constant() && rt->is_constant()) { |
|
708 |
if (x->x()->as_Constant() != NULL) { |
|
709 |
// pattern: If (lc cond rc) => simplify to: Goto |
|
710 |
BlockBegin* sux = x->x()->as_Constant()->compare(x->cond(), x->y(), |
|
711 |
x->sux_for(true), |
|
712 |
x->sux_for(false)); |
|
713 |
if (sux != NULL) { |
|
714 |
// If is a safepoint then the debug information should come from the state_before of the If. |
|
11787
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
715 |
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux))); |
1 | 716 |
} |
717 |
} |
|
718 |
} else if (rt->as_IntConstant() != NULL) { |
|
719 |
// pattern: If (l cond rc) => investigate further |
|
720 |
const jint rc = rt->as_IntConstant()->value(); |
|
721 |
if (l->as_CompareOp() != NULL) { |
|
722 |
// pattern: If ((a cmp b) cond rc) => simplify to: If (x cond y) or: Goto |
|
723 |
CompareOp* cmp = l->as_CompareOp(); |
|
724 |
bool unordered_is_less = cmp->op() == Bytecodes::_fcmpl || cmp->op() == Bytecodes::_dcmpl; |
|
725 |
BlockBegin* lss_sux = x->sux_for(is_true(-1, x->cond(), rc)); // successor for a < b |
|
726 |
BlockBegin* eql_sux = x->sux_for(is_true( 0, x->cond(), rc)); // successor for a = b |
|
727 |
BlockBegin* gtr_sux = x->sux_for(is_true(+1, x->cond(), rc)); // successor for a > b |
|
728 |
BlockBegin* nan_sux = unordered_is_less ? lss_sux : gtr_sux ; // successor for unordered |
|
729 |
// Note: At this point all successors (lss_sux, eql_sux, gtr_sux, nan_sux) are |
|
730 |
// equal to x->tsux() or x->fsux(). Furthermore, nan_sux equals either |
|
731 |
// lss_sux or gtr_sux. |
|
732 |
if (lss_sux == eql_sux && eql_sux == gtr_sux) { |
|
733 |
// all successors identical => simplify to: Goto |
|
734 |
set_canonical(new Goto(lss_sux, x->state_before(), x->is_safepoint())); |
|
735 |
} else { |
|
736 |
// two successors differ and two successors are the same => simplify to: If (x cmp y) |
|
737 |
// determine new condition & successors |
|
33589
7cbd1b2c139b
8139040: Fix initializations before ShouldNotReachHere() etc. and enable -Wuninitialized on linux.
goetz
parents:
28954
diff
changeset
|
738 |
If::Condition cond = If::eql; |
1 | 739 |
BlockBegin* tsux = NULL; |
740 |
BlockBegin* fsux = NULL; |
|
741 |
if (lss_sux == eql_sux) { cond = If::leq; tsux = lss_sux; fsux = gtr_sux; } |
|
742 |
else if (lss_sux == gtr_sux) { cond = If::neq; tsux = lss_sux; fsux = eql_sux; } |
|
743 |
else if (eql_sux == gtr_sux) { cond = If::geq; tsux = eql_sux; fsux = lss_sux; } |
|
744 |
else { ShouldNotReachHere(); } |
|
6453 | 745 |
If* canon = new If(cmp->x(), cond, nan_sux == tsux, cmp->y(), tsux, fsux, cmp->state_before(), x->is_safepoint()); |
1 | 746 |
if (cmp->x() == cmp->y()) { |
747 |
do_If(canon); |
|
748 |
} else { |
|
6453 | 749 |
if (compilation()->profile_branches()) { |
750 |
// TODO: If profiling, leave floating point comparisons unoptimized. |
|
751 |
// We currently do not support profiling of the unordered case. |
|
752 |
switch(cmp->op()) { |
|
753 |
case Bytecodes::_fcmpl: case Bytecodes::_fcmpg: |
|
754 |
case Bytecodes::_dcmpl: case Bytecodes::_dcmpg: |
|
755 |
set_canonical(x); |
|
756 |
return; |
|
757 |
} |
|
758 |
} |
|
12947
ba8ba6c2dd83
7172843: C1: fix "assert(has_printable_bci()) failed: _printable_bci should have been set"
twisti
parents:
11886
diff
changeset
|
759 |
set_bci(cmp->state_before()->bci()); |
1 | 760 |
set_canonical(canon); |
761 |
} |
|
762 |
} |
|
763 |
} else if (l->as_InstanceOf() != NULL) { |
|
764 |
// NOTE: Code permanently disabled for now since it leaves the old InstanceOf |
|
765 |
// instruction in the graph (it is pinned). Need to fix this at some point. |
|
6461
cfc616b49f58
6919069: client compiler needs to capture more profile information for tiered work
iveresov
parents:
6453
diff
changeset
|
766 |
// It should also be left in the graph when generating a profiled method version or Goto |
cfc616b49f58
6919069: client compiler needs to capture more profile information for tiered work
iveresov
parents:
6453
diff
changeset
|
767 |
// has to know that it was an InstanceOf. |
1 | 768 |
return; |
769 |
// pattern: If ((obj instanceof klass) cond rc) => simplify to: IfInstanceOf or: Goto |
|
770 |
InstanceOf* inst = l->as_InstanceOf(); |
|
771 |
BlockBegin* is_inst_sux = x->sux_for(is_true(1, x->cond(), rc)); // successor for instanceof == 1 |
|
772 |
BlockBegin* no_inst_sux = x->sux_for(is_true(0, x->cond(), rc)); // successor for instanceof == 0 |
|
773 |
if (is_inst_sux == no_inst_sux && inst->is_loaded()) { |
|
774 |
// both successors identical and klass is loaded => simplify to: Goto |
|
775 |
set_canonical(new Goto(is_inst_sux, x->state_before(), x->is_safepoint())); |
|
776 |
} else { |
|
777 |
// successors differ => simplify to: IfInstanceOf |
|
6745 | 778 |
set_canonical(new IfInstanceOf(inst->klass(), inst->obj(), true, inst->state_before()->bci(), is_inst_sux, no_inst_sux)); |
1 | 779 |
} |
780 |
} |
|
33633 | 781 |
} else if (rt == objectNull && |
782 |
(l->as_NewInstance() || l->as_NewArray() || |
|
36058
caff909b4e1f
8149356: Leftover from JDK-8141044: UseNewCode usage
shade
parents:
33638
diff
changeset
|
783 |
(l->as_Local() && l->as_Local()->is_receiver()))) { |
1 | 784 |
if (x->cond() == Instruction::eql) { |
11787
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
785 |
BlockBegin* sux = x->fsux(); |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
786 |
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux))); |
1 | 787 |
} else { |
788 |
assert(x->cond() == Instruction::neq, "only other valid case"); |
|
11787
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
789 |
BlockBegin* sux = x->tsux(); |
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
790 |
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux))); |
1 | 791 |
} |
792 |
} |
|
793 |
} |
|
794 |
||
795 |
||
796 |
void Canonicalizer::do_TableSwitch(TableSwitch* x) { |
|
797 |
if (x->tag()->type()->is_constant()) { |
|
798 |
int v = x->tag()->type()->as_IntConstant()->value(); |
|
799 |
BlockBegin* sux = x->default_sux(); |
|
800 |
if (v >= x->lo_key() && v <= x->hi_key()) { |
|
801 |
sux = x->sux_at(v - x->lo_key()); |
|
802 |
} |
|
11787
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
803 |
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux))); |
1 | 804 |
} else if (x->number_of_sux() == 1) { |
805 |
// NOTE: Code permanently disabled for now since the switch statement's |
|
806 |
// tag expression may produce side-effects in which case it must |
|
807 |
// be executed. |
|
808 |
return; |
|
809 |
// simplify to Goto |
|
810 |
set_canonical(new Goto(x->default_sux(), x->state_before(), x->is_safepoint())); |
|
811 |
} else if (x->number_of_sux() == 2) { |
|
812 |
// NOTE: Code permanently disabled for now since it produces two new nodes |
|
813 |
// (Constant & If) and the Canonicalizer cannot return them correctly |
|
814 |
// yet. For now we copied the corresponding code directly into the |
|
815 |
// GraphBuilder (i.e., we should never reach here). |
|
816 |
return; |
|
817 |
// simplify to If |
|
818 |
assert(x->lo_key() == x->hi_key(), "keys must be the same"); |
|
819 |
Constant* key = new Constant(new IntConstant(x->lo_key())); |
|
820 |
set_canonical(new If(x->tag(), If::eql, true, key, x->sux_at(0), x->default_sux(), x->state_before(), x->is_safepoint())); |
|
821 |
} |
|
822 |
} |
|
823 |
||
824 |
||
825 |
void Canonicalizer::do_LookupSwitch(LookupSwitch* x) { |
|
826 |
if (x->tag()->type()->is_constant()) { |
|
827 |
int v = x->tag()->type()->as_IntConstant()->value(); |
|
828 |
BlockBegin* sux = x->default_sux(); |
|
829 |
for (int i = 0; i < x->length(); i++) { |
|
830 |
if (v == x->key_at(i)) { |
|
831 |
sux = x->sux_at(i); |
|
832 |
} |
|
833 |
} |
|
11787
cfb5950b7706
7126041: jdk7u4 b05 and b06 crash with RubyMine 3.2.4, works well with b04
roland
parents:
8671
diff
changeset
|
834 |
set_canonical(new Goto(sux, x->state_before(), is_safepoint(x, sux))); |
1 | 835 |
} else if (x->number_of_sux() == 1) { |
836 |
// NOTE: Code permanently disabled for now since the switch statement's |
|
837 |
// tag expression may produce side-effects in which case it must |
|
838 |
// be executed. |
|
839 |
return; |
|
840 |
// simplify to Goto |
|
841 |
set_canonical(new Goto(x->default_sux(), x->state_before(), x->is_safepoint())); |
|
842 |
} else if (x->number_of_sux() == 2) { |
|
843 |
// NOTE: Code permanently disabled for now since it produces two new nodes |
|
844 |
// (Constant & If) and the Canonicalizer cannot return them correctly |
|
845 |
// yet. For now we copied the corresponding code directly into the |
|
846 |
// GraphBuilder (i.e., we should never reach here). |
|
847 |
return; |
|
848 |
// simplify to If |
|
849 |
assert(x->length() == 1, "length must be the same"); |
|
850 |
Constant* key = new Constant(new IntConstant(x->key_at(0))); |
|
851 |
set_canonical(new If(x->tag(), If::eql, true, key, x->sux_at(0), x->default_sux(), x->state_before(), x->is_safepoint())); |
|
852 |
} |
|
853 |
} |
|
854 |
||
855 |
||
856 |
void Canonicalizer::do_Return (Return* x) {} |
|
857 |
void Canonicalizer::do_Throw (Throw* x) {} |
|
858 |
void Canonicalizer::do_Base (Base* x) {} |
|
859 |
void Canonicalizer::do_OsrEntry (OsrEntry* x) {} |
|
860 |
void Canonicalizer::do_ExceptionObject(ExceptionObject* x) {} |
|
861 |
||
862 |
static bool match_index_and_scale(Instruction* instr, |
|
863 |
Instruction** index, |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
864 |
int* log2_scale) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
865 |
// Skip conversion ops. This works only on 32bit because of the implicit l2i that the |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
866 |
// unsafe performs. |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
867 |
#ifndef _LP64 |
1 | 868 |
Convert* convert = instr->as_Convert(); |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
869 |
if (convert != NULL && convert->op() == Bytecodes::_i2l) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
870 |
assert(convert->value()->type() == intType, "invalid input type"); |
1 | 871 |
instr = convert->value(); |
872 |
} |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
873 |
#endif |
1 | 874 |
|
875 |
ShiftOp* shift = instr->as_ShiftOp(); |
|
876 |
if (shift != NULL) { |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
877 |
if (shift->op() == Bytecodes::_lshl) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
878 |
assert(shift->x()->type() == longType, "invalid input type"); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
879 |
} else { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
880 |
#ifndef _LP64 |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
881 |
if (shift->op() == Bytecodes::_ishl) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
882 |
assert(shift->x()->type() == intType, "invalid input type"); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
883 |
} else { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
884 |
return false; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
885 |
} |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
886 |
#else |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
887 |
return false; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
888 |
#endif |
1 | 889 |
} |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
890 |
|
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
891 |
|
1 | 892 |
// Constant shift value? |
893 |
Constant* con = shift->y()->as_Constant(); |
|
894 |
if (con == NULL) return false; |
|
895 |
// Well-known type and value? |
|
896 |
IntConstant* val = con->type()->as_IntConstant(); |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
897 |
assert(val != NULL, "Should be an int constant"); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
898 |
|
1 | 899 |
*index = shift->x(); |
900 |
int tmp_scale = val->value(); |
|
901 |
if (tmp_scale >= 0 && tmp_scale < 4) { |
|
902 |
*log2_scale = tmp_scale; |
|
903 |
return true; |
|
904 |
} else { |
|
905 |
return false; |
|
906 |
} |
|
907 |
} |
|
908 |
||
909 |
ArithmeticOp* arith = instr->as_ArithmeticOp(); |
|
910 |
if (arith != NULL) { |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
911 |
// See if either arg is a known constant |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
912 |
Constant* con = arith->x()->as_Constant(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
913 |
if (con != NULL) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
914 |
*index = arith->y(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
915 |
} else { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
916 |
con = arith->y()->as_Constant(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
917 |
if (con == NULL) return false; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
918 |
*index = arith->x(); |
1 | 919 |
} |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
920 |
long const_value; |
1 | 921 |
// Check for integer multiply |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
922 |
if (arith->op() == Bytecodes::_lmul) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
923 |
assert((*index)->type() == longType, "invalid input type"); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
924 |
LongConstant* val = con->type()->as_LongConstant(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
925 |
assert(val != NULL, "expecting a long constant"); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
926 |
const_value = val->value(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
927 |
} else { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
928 |
#ifndef _LP64 |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
929 |
if (arith->op() == Bytecodes::_imul) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
930 |
assert((*index)->type() == intType, "invalid input type"); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
931 |
IntConstant* val = con->type()->as_IntConstant(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
932 |
assert(val != NULL, "expecting an int constant"); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
933 |
const_value = val->value(); |
1 | 934 |
} else { |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
935 |
return false; |
1 | 936 |
} |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
937 |
#else |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
938 |
return false; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
939 |
#endif |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
940 |
} |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
941 |
switch (const_value) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
942 |
case 1: *log2_scale = 0; return true; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
943 |
case 2: *log2_scale = 1; return true; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
944 |
case 4: *log2_scale = 2; return true; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
945 |
case 8: *log2_scale = 3; return true; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
946 |
default: return false; |
1 | 947 |
} |
948 |
} |
|
949 |
||
950 |
// Unknown instruction sequence; don't touch it |
|
951 |
return false; |
|
952 |
} |
|
953 |
||
954 |
||
955 |
static bool match(UnsafeRawOp* x, |
|
956 |
Instruction** base, |
|
957 |
Instruction** index, |
|
958 |
int* log2_scale) { |
|
959 |
ArithmeticOp* root = x->base()->as_ArithmeticOp(); |
|
960 |
if (root == NULL) return false; |
|
961 |
// Limit ourselves to addition for now |
|
962 |
if (root->op() != Bytecodes::_ladd) return false; |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
963 |
|
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
964 |
bool match_found = false; |
1 | 965 |
// Try to find shift or scale op |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
966 |
if (match_index_and_scale(root->y(), index, log2_scale)) { |
1 | 967 |
*base = root->x(); |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
968 |
match_found = true; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
969 |
} else if (match_index_and_scale(root->x(), index, log2_scale)) { |
1 | 970 |
*base = root->y(); |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
971 |
match_found = true; |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
972 |
} else if (NOT_LP64(root->y()->as_Convert() != NULL) LP64_ONLY(false)) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
973 |
// Skipping i2l works only on 32bit because of the implicit l2i that the unsafe performs. |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
974 |
// 64bit needs a real sign-extending conversion. |
1 | 975 |
Convert* convert = root->y()->as_Convert(); |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
976 |
if (convert->op() == Bytecodes::_i2l) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
977 |
assert(convert->value()->type() == intType, "should be an int"); |
1 | 978 |
// pick base and index, setting scale at 1 |
979 |
*base = root->x(); |
|
980 |
*index = convert->value(); |
|
981 |
*log2_scale = 0; |
|
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
982 |
match_found = true; |
1 | 983 |
} |
26819
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
984 |
} |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
985 |
// The default solution |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
986 |
if (!match_found) { |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
987 |
*base = root->x(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
988 |
*index = root->y(); |
9f09d23f946c
8058744: Crash in C1 OSRed method w/ Unsafe usage
iveresov
parents:
22234
diff
changeset
|
989 |
*log2_scale = 0; |
1 | 990 |
} |
991 |
||
992 |
// If the value is pinned then it will be always be computed so |
|
993 |
// there's no profit to reshaping the expression. |
|
994 |
return !root->is_pinned(); |
|
995 |
} |
|
996 |
||
997 |
||
998 |
void Canonicalizer::do_UnsafeRawOp(UnsafeRawOp* x) { |
|
999 |
Instruction* base = NULL; |
|
1000 |
Instruction* index = NULL; |
|
1001 |
int log2_scale; |
|
1002 |
||
1003 |
if (match(x, &base, &index, &log2_scale)) { |
|
1004 |
x->set_base(base); |
|
1005 |
x->set_index(index); |
|
1006 |
x->set_log2_scale(log2_scale); |
|
1007 |
if (PrintUnsafeOptimization) { |
|
1008 |
tty->print_cr("Canonicalizer: UnsafeRawOp id %d: base = id %d, index = id %d, log2_scale = %d", |
|
1009 |
x->id(), x->base()->id(), x->index()->id(), x->log2_scale()); |
|
1010 |
} |
|
1011 |
} |
|
1012 |
} |
|
1013 |
||
1014 |
void Canonicalizer::do_RoundFP(RoundFP* x) {} |
|
1015 |
void Canonicalizer::do_UnsafeGetRaw(UnsafeGetRaw* x) { if (OptimizeUnsafes) do_UnsafeRawOp(x); } |
|
1016 |
void Canonicalizer::do_UnsafePutRaw(UnsafePutRaw* x) { if (OptimizeUnsafes) do_UnsafeRawOp(x); } |
|
1017 |
void Canonicalizer::do_UnsafeGetObject(UnsafeGetObject* x) {} |
|
1018 |
void Canonicalizer::do_UnsafePutObject(UnsafePutObject* x) {} |
|
13886
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13391
diff
changeset
|
1019 |
void Canonicalizer::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {} |
1 | 1020 |
void Canonicalizer::do_ProfileCall(ProfileCall* x) {} |
20709
034be898bf04
8026054: New type profiling points: type of return values at calls
roland
parents:
17011
diff
changeset
|
1021 |
void Canonicalizer::do_ProfileReturnType(ProfileReturnType* x) {} |
6453 | 1022 |
void Canonicalizer::do_ProfileInvoke(ProfileInvoke* x) {} |
8065
7ca689ce3d32
6809483: hotspot:::method_entry are not correctly generated for "method()V"
never
parents:
7397
diff
changeset
|
1023 |
void Canonicalizer::do_RuntimeCall(RuntimeCall* x) {} |
16611 | 1024 |
void Canonicalizer::do_RangeCheckPredicate(RangeCheckPredicate* x) {} |
17011
def8879c5b81
8011648: C1: optimized build is broken after 7153771
roland
parents:
16611
diff
changeset
|
1025 |
#ifdef ASSERT |
16611 | 1026 |
void Canonicalizer::do_Assert(Assert* x) {} |
17011
def8879c5b81
8011648: C1: optimized build is broken after 7153771
roland
parents:
16611
diff
changeset
|
1027 |
#endif |
11886
feebf5c9f40c
7120481: storeStore barrier in constructor with final field
jiangli
parents:
11787
diff
changeset
|
1028 |
void Canonicalizer::do_MemBar(MemBar* x) {} |