8059621: JVM crashes with "unexpected index type" assert in LIRGenerator::do_UnsafeGetRaw
Get types from LIR instructions instead of HIR Reviewed-by: kvn
This commit is contained in:
parent
8327c8c62e
commit
c39454ae56
@ -2069,14 +2069,14 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) {
|
|||||||
LIR_Opr base_op = base.result();
|
LIR_Opr base_op = base.result();
|
||||||
LIR_Opr index_op = idx.result();
|
LIR_Opr index_op = idx.result();
|
||||||
#ifndef _LP64
|
#ifndef _LP64
|
||||||
if (x->base()->type()->tag() == longTag) {
|
if (base_op->type() == T_LONG) {
|
||||||
base_op = new_register(T_INT);
|
base_op = new_register(T_INT);
|
||||||
__ convert(Bytecodes::_l2i, base.result(), base_op);
|
__ convert(Bytecodes::_l2i, base.result(), base_op);
|
||||||
}
|
}
|
||||||
if (x->has_index()) {
|
if (x->has_index()) {
|
||||||
if (x->index()->type()->tag() == longTag) {
|
if (index_op->type() == T_LONG) {
|
||||||
LIR_Opr long_index_op = index_op;
|
LIR_Opr long_index_op = index_op;
|
||||||
if (x->index()->type()->is_constant()) {
|
if (index_op->is_constant()) {
|
||||||
long_index_op = new_register(T_LONG);
|
long_index_op = new_register(T_LONG);
|
||||||
__ move(index_op, long_index_op);
|
__ move(index_op, long_index_op);
|
||||||
}
|
}
|
||||||
@ -2091,14 +2091,14 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) {
|
|||||||
assert(!x->has_index() || index_op->type() == T_INT, "index should be an int");
|
assert(!x->has_index() || index_op->type() == T_INT, "index should be an int");
|
||||||
#else
|
#else
|
||||||
if (x->has_index()) {
|
if (x->has_index()) {
|
||||||
if (x->index()->type()->tag() == intTag) {
|
if (index_op->type() == T_INT) {
|
||||||
if (!x->index()->type()->is_constant()) {
|
if (!index_op->is_constant()) {
|
||||||
index_op = new_register(T_LONG);
|
index_op = new_register(T_LONG);
|
||||||
__ convert(Bytecodes::_i2l, idx.result(), index_op);
|
__ convert(Bytecodes::_i2l, idx.result(), index_op);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(x->index()->type()->tag() == longTag, "must be");
|
assert(index_op->type() == T_LONG, "must be");
|
||||||
if (x->index()->type()->is_constant()) {
|
if (index_op->is_constant()) {
|
||||||
index_op = new_register(T_LONG);
|
index_op = new_register(T_LONG);
|
||||||
__ move(idx.result(), index_op);
|
__ move(idx.result(), index_op);
|
||||||
}
|
}
|
||||||
@ -2179,12 +2179,12 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) {
|
|||||||
LIR_Opr index_op = idx.result();
|
LIR_Opr index_op = idx.result();
|
||||||
|
|
||||||
#ifndef _LP64
|
#ifndef _LP64
|
||||||
if (x->base()->type()->tag() == longTag) {
|
if (base_op->type() == T_LONG) {
|
||||||
base_op = new_register(T_INT);
|
base_op = new_register(T_INT);
|
||||||
__ convert(Bytecodes::_l2i, base.result(), base_op);
|
__ convert(Bytecodes::_l2i, base.result(), base_op);
|
||||||
}
|
}
|
||||||
if (x->has_index()) {
|
if (x->has_index()) {
|
||||||
if (x->index()->type()->tag() == longTag) {
|
if (index_op->type() == T_LONG) {
|
||||||
index_op = new_register(T_INT);
|
index_op = new_register(T_INT);
|
||||||
__ convert(Bytecodes::_l2i, idx.result(), index_op);
|
__ convert(Bytecodes::_l2i, idx.result(), index_op);
|
||||||
}
|
}
|
||||||
@ -2194,7 +2194,7 @@ void LIRGenerator::do_UnsafePutRaw(UnsafePutRaw* x) {
|
|||||||
assert(!x->has_index() || (index_op->type() == T_INT && !index_op->is_constant()), "index should be an non-constant int");
|
assert(!x->has_index() || (index_op->type() == T_INT && !index_op->is_constant()), "index should be an non-constant int");
|
||||||
#else
|
#else
|
||||||
if (x->has_index()) {
|
if (x->has_index()) {
|
||||||
if (x->index()->type()->tag() == intTag) {
|
if (index_op->type() == T_INT) {
|
||||||
index_op = new_register(T_LONG);
|
index_op = new_register(T_LONG);
|
||||||
__ convert(Bytecodes::_i2l, idx.result(), index_op);
|
__ convert(Bytecodes::_i2l, idx.result(), index_op);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user