mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8036667: "assert(adr->is_AddP() && adr->in(AddPNode::Offset)->is_Con()) failed: offset is a constant" with FoldStableValues on
Reviewed-by: kvn
This commit is contained in:
parent
e021d60c5a
commit
bd8255eaa4
1 changed files with 25 additions and 28 deletions
|
@ -1593,9 +1593,9 @@ LoadNode::load_array_final_field(const TypeKlassPtr *tkls,
|
|||
|
||||
// Try to constant-fold a stable array element.
|
||||
static const Type* fold_stable_ary_elem(const TypeAryPtr* ary, int off, BasicType loadbt) {
|
||||
assert(ary->const_oop(), "array should be constant");
|
||||
assert(ary->is_stable(), "array should be stable");
|
||||
|
||||
if (ary->const_oop() != NULL) {
|
||||
// Decode the results of GraphKit::array_element_address.
|
||||
ciArray* aobj = ary->const_oop()->as_array();
|
||||
ciConstant con = aobj->element_value_by_offset(off);
|
||||
|
@ -1620,8 +1620,6 @@ static const Type* fold_stable_ary_elem(const TypeAryPtr* ary, int off, BasicTyp
|
|||
return con_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1653,10 +1651,9 @@ const Type *LoadNode::Value( PhaseTransform *phase ) const {
|
|||
const bool off_beyond_header = ((uint)off >= (uint)min_base_off);
|
||||
|
||||
// Try to constant-fold a stable array element.
|
||||
if (FoldStableValues && ary->is_stable()) {
|
||||
// Make sure the reference is not into the header
|
||||
if (off_beyond_header && off != Type::OffsetBot) {
|
||||
assert(adr->is_AddP() && adr->in(AddPNode::Offset)->is_Con(), "offset is a constant");
|
||||
if (FoldStableValues && ary->is_stable() && ary->const_oop() != NULL) {
|
||||
// Make sure the reference is not into the header and the offset is constant
|
||||
if (off_beyond_header && adr->is_AddP() && off != Type::OffsetBot) {
|
||||
const Type* con_type = fold_stable_ary_elem(ary, off, memory_type());
|
||||
if (con_type != NULL) {
|
||||
return con_type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue