Fri, 03 Oct 2014 13:34:46 -0700
8059621: JVM crashes with "unexpected index type" assert in LIRGenerator::do_UnsafeGetRaw
Summary: Get types from LIR instructions instead of HIR
Reviewed-by: kvn
src/share/vm/c1/c1_LIRGenerator.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp Fri Oct 03 01:27:41 2014 -0700 1.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp Fri Oct 03 13:34:46 2014 -0700 1.3 @@ -2066,14 +2066,14 @@ 1.4 LIR_Opr base_op = base.result(); 1.5 LIR_Opr index_op = idx.result(); 1.6 #ifndef _LP64 1.7 - if (x->base()->type()->tag() == longTag) { 1.8 + if (base_op->type() == T_LONG) { 1.9 base_op = new_register(T_INT); 1.10 __ convert(Bytecodes::_l2i, base.result(), base_op); 1.11 } 1.12 if (x->has_index()) { 1.13 - if (x->index()->type()->tag() == longTag) { 1.14 + if (index_op->type() == T_LONG) { 1.15 LIR_Opr long_index_op = index_op; 1.16 - if (x->index()->type()->is_constant()) { 1.17 + if (index_op->is_constant()) { 1.18 long_index_op = new_register(T_LONG); 1.19 __ move(index_op, long_index_op); 1.20 } 1.21 @@ -2088,14 +2088,14 @@ 1.22 assert(!x->has_index() || index_op->type() == T_INT, "index should be an int"); 1.23 #else 1.24 if (x->has_index()) { 1.25 - if (x->index()->type()->tag() == intTag) { 1.26 - if (!x->index()->type()->is_constant()) { 1.27 + if (index_op->type() == T_INT) { 1.28 + if (!index_op->is_constant()) { 1.29 index_op = new_register(T_LONG); 1.30 __ convert(Bytecodes::_i2l, idx.result(), index_op); 1.31 } 1.32 } else { 1.33 - assert(x->index()->type()->tag() == longTag, "must be"); 1.34 - if (x->index()->type()->is_constant()) { 1.35 + assert(index_op->type() == T_LONG, "must be"); 1.36 + if (index_op->is_constant()) { 1.37 index_op = new_register(T_LONG); 1.38 __ move(idx.result(), index_op); 1.39 } 1.40 @@ -2176,12 +2176,12 @@ 1.41 LIR_Opr index_op = idx.result(); 1.42 1.43 #ifndef _LP64 1.44 - if (x->base()->type()->tag() == longTag) { 1.45 + if (base_op->type() == T_LONG) { 1.46 base_op = new_register(T_INT); 1.47 __ convert(Bytecodes::_l2i, base.result(), base_op); 1.48 } 1.49 if (x->has_index()) { 1.50 - if (x->index()->type()->tag() == longTag) { 1.51 + if (index_op->type() == T_LONG) { 1.52 index_op = new_register(T_INT); 1.53 __ convert(Bytecodes::_l2i, idx.result(), index_op); 1.54 } 1.55 @@ -2191,7 +2191,7 @@ 1.56 assert(!x->has_index() || (index_op->type() == T_INT && !index_op->is_constant()), "index should be an non-constant int"); 1.57 #else 1.58 if (x->has_index()) { 1.59 - if (x->index()->type()->tag() == intTag) { 1.60 + if (index_op->type() == T_INT) { 1.61 index_op = new_register(T_LONG); 1.62 __ convert(Bytecodes::_i2l, idx.result(), index_op); 1.63 }