src/share/vm/opto/escape.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
6695810 Cdiff src/share/vm/opto/escape.cpp
src/share/vm/opto/escape.cpp
Print this page
*** 886,895 ****
--- 886,912 ----
n->raise_bottom_type(tinst);
igvn->hash_insert(n);
record_for_optimizer(n);
if (alloc->is_Allocate() && ptn->_scalar_replaceable &&
(t->isa_instptr() || t->isa_aryptr())) {
+
+ // First, put on the worklist all Field edges from Connection Graph
+ // which is more accurate then putting immediate users from Ideal Graph.
+ for (uint e = 0; e < ptn->edge_count(); e++) {
+ Node *use = _nodes->adr_at(ptn->edge_target(e))->_node;
+ assert(ptn->edge_type(e) == PointsToNode::FieldEdge && use->is_AddP(),
+ "only AddP nodes are Field edges in CG");
+ if (use->outcnt() > 0) { // Don't process dead nodes
+ Node* addp2 = find_second_addp(use, use->in(AddPNode::Base));
+ if (addp2 != NULL) {
+ assert(alloc->is_AllocateArray(),"array allocation was expected");
+ alloc_worklist.append_if_missing(addp2);
+ }
+ alloc_worklist.append_if_missing(use);
+ }
+ }
+
// An allocation may have an Initialize which has raw stores. Scan
// the users of the raw allocation result and push AddP users
// on alloc_worklist.
Node *raw_result = alloc->proj_out(TypeFunc::Parms);
assert (raw_result != NULL, "must have an allocation result");
*** 917,926 ****
--- 934,945 ----
Node *base = get_map(elem); // CheckCastPP node
split_AddP(n, base, igvn);
tinst = igvn->type(base)->isa_oopptr();
} else if (n->is_Phi() ||
n->is_CheckCastPP() ||
+ n->Opcode() == Op_EncodeP ||
+ n->Opcode() == Op_DecodeN ||
(n->is_ConstraintCast() && n->Opcode() == Op_CastPP)) {
if (visited.test_set(n->_idx)) {
assert(n->is_Phi(), "loops only through Phi's");
continue; // already processed
}
*** 933,949 ****
Node *val = get_map(elem); // CheckCastPP node
TypeNode *tn = n->as_Type();
tinst = igvn->type(val)->isa_oopptr();
assert(tinst != NULL && tinst->is_instance() &&
tinst->instance_id() == elem , "instance type expected.");
- const TypeOopPtr *tn_t = igvn->type(tn)->isa_oopptr();
if (tn_t != NULL &&
tinst->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE)->higher_equal(tn_t)) {
igvn->hash_delete(tn);
! igvn->set_type(tn, tinst);
! tn->set_type(tinst);
igvn->hash_insert(tn);
record_for_optimizer(n);
}
}
} else {
--- 952,980 ----
Node *val = get_map(elem); // CheckCastPP node
TypeNode *tn = n->as_Type();
tinst = igvn->type(val)->isa_oopptr();
assert(tinst != NULL && tinst->is_instance() &&
tinst->instance_id() == elem , "instance type expected.");
+ const TypeOopPtr *tn_t = NULL;
+ const Type *tn_type = igvn->type(tn);
+ if (tn_type->isa_narrowoop()) {
+ tn_t = tn_type->is_narrowoop()->make_oopptr()->isa_oopptr();
+ } else {
+ tn_t = tn_type->isa_oopptr();
+ }
+
if (tn_t != NULL &&
tinst->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE)->higher_equal(tn_t)) {
+ if (tn_type->isa_narrowoop()) {
+ tn_type = tinst->make_narrowoop();
+ } else {
+ tn_type = tinst;
+ }
igvn->hash_delete(tn);
! igvn->set_type(tn, tn_type);
! tn->set_type(tn_type);
igvn->hash_insert(tn);
record_for_optimizer(n);
}
}
} else {
*** 976,985 ****
--- 1007,1018 ----
alloc_worklist.append_if_missing(addp2);
}
alloc_worklist.append_if_missing(use);
} else if (use->is_Phi() ||
use->is_CheckCastPP() ||
+ use->Opcode() == Op_EncodeP ||
+ use->Opcode() == Op_DecodeN ||
(use->is_ConstraintCast() && use->Opcode() == Op_CastPP)) {
alloc_worklist.append_if_missing(use);
}
}
*** 1197,1207 ****
}
}
void ConnectionGraph::compute_escape() {
! // 1. Populate Connection Graph with Ideal nodes.
Unique_Node_List worklist_init;
worklist_init.map(_compile->unique(), NULL); // preallocate space
// Initialize worklist
--- 1230,1240 ----
}
}
void ConnectionGraph::compute_escape() {
! // 1. Populate Connection Graph (CG) with Ideal nodes.
Unique_Node_List worklist_init;
worklist_init.map(_compile->unique(), NULL); // preallocate space
// Initialize worklist
*** 1279,1293 ****
Node *n = ptn->_node;
if (nt == PointsToNode::LocalVar || nt == PointsToNode::Field) {
remove_deferred(ni, &deferred_edges, &visited);
if (n->is_AddP()) {
// If this AddP computes an address which may point to more that one
! // object, nothing the address points to can be scalar replaceable.
Node *base = get_addp_base(n);
ptset.Clear();
PointsTo(ptset, base, igvn);
! if (ptset.Size() > 1) {
for( VectorSetI j(&ptset); j.test(); ++j ) {
uint pt = j.elem;
ptnode_adr(pt)->_scalar_replaceable = false;
}
}
--- 1312,1328 ----
Node *n = ptn->_node;
if (nt == PointsToNode::LocalVar || nt == PointsToNode::Field) {
remove_deferred(ni, &deferred_edges, &visited);
if (n->is_AddP()) {
// If this AddP computes an address which may point to more that one
! // object or more then one field (array's element), nothing the address
! // points to can be scalar replaceable.
Node *base = get_addp_base(n);
ptset.Clear();
PointsTo(ptset, base, igvn);
! if (ptset.Size() > 1 ||
! (ptset.Size() != 0 && ptn->offset() == Type::OffsetBot)) {
for( VectorSetI j(&ptset); j.test(); ++j ) {
uint pt = j.elem;
ptnode_adr(pt)->_scalar_replaceable = false;
}
}
*** 1977,1986 ****
--- 2012,2026 ----
case Op_ConP:
{
assert(false, "Op_ConP");
break;
}
+ case Op_ConN:
+ {
+ assert(false, "Op_ConN");
+ break;
+ }
case Op_CreateEx:
{
assert(false, "Op_CreateEx");
break;
}
src/share/vm/opto/escape.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File