提交 c4f76e46 编写于 作者: K kvn

6807084: AutoBox elimination is broken with compressed oops

Summary: Add checks for DecodeN nodes into AutoBox elimination code.
Reviewed-by: never
上级 6edc5672
...@@ -1066,11 +1066,11 @@ Node* LoadNode::eliminate_autobox(PhaseGVN* phase) { ...@@ -1066,11 +1066,11 @@ Node* LoadNode::eliminate_autobox(PhaseGVN* phase) {
break; break;
} }
} }
LoadNode* load = NULL; bool has_load = ( allocation != NULL &&
if (allocation != NULL && base->in(load_index)->is_Load()) { (base->in(load_index)->is_Load() ||
load = base->in(load_index)->as_Load(); base->in(load_index)->is_DecodeN() &&
} base->in(load_index)->in(1)->is_Load()) );
if (load != NULL && in(Memory)->is_Phi() && in(Memory)->in(0) == base->in(0)) { if (has_load && in(Memory)->is_Phi() && in(Memory)->in(0) == base->in(0)) {
// Push the loads from the phi that comes from valueOf up // Push the loads from the phi that comes from valueOf up
// through it to allow elimination of the loads and the recovery // through it to allow elimination of the loads and the recovery
// of the original value. // of the original value.
...@@ -1106,11 +1106,20 @@ Node* LoadNode::eliminate_autobox(PhaseGVN* phase) { ...@@ -1106,11 +1106,20 @@ Node* LoadNode::eliminate_autobox(PhaseGVN* phase) {
result->set_req(load_index, in2); result->set_req(load_index, in2);
return result; return result;
} }
} else if (base->is_Load()) { } else if (base->is_Load() ||
base->is_DecodeN() && base->in(1)->is_Load()) {
if (base->is_DecodeN()) {
// Get LoadN node which loads cached Integer object
base = base->in(1);
}
// Eliminate the load of Integer.value for integers from the cache // Eliminate the load of Integer.value for integers from the cache
// array by deriving the value from the index into the array. // array by deriving the value from the index into the array.
// Capture the offset of the load and then reverse the computation. // Capture the offset of the load and then reverse the computation.
Node* load_base = base->in(Address)->in(AddPNode::Base); Node* load_base = base->in(Address)->in(AddPNode::Base);
if (load_base->is_DecodeN()) {
// Get LoadN node which loads IntegerCache.cache field
load_base = load_base->in(1);
}
if (load_base != NULL) { if (load_base != NULL) {
Compile::AliasType* atp = phase->C->alias_type(load_base->adr_type()); Compile::AliasType* atp = phase->C->alias_type(load_base->adr_type());
intptr_t cache_offset; intptr_t cache_offset;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册