3394 Node* in1 = n->in(1);
3395 if (in1->is_DecodeNarrowPtr()) {
3396 n->subsume_by(in1->in(1), this);
3397 } else if (in1->Opcode() == Op_ConP) {
3398 const Type* t = in1->bottom_type();
3399 if (t == TypePtr::NULL_PTR) {
3400 assert(t->isa_oopptr(), "null klass?");
3401 n->subsume_by(ConNode::make(TypeNarrowOop::NULL_PTR), this);
3402 } else if (t->isa_oopptr()) {
3403 n->subsume_by(ConNode::make(t->make_narrowoop()), this);
3404 } else if (t->isa_klassptr()) {
3405 n->subsume_by(ConNode::make(t->make_narrowklass()), this);
3406 }
3407 }
3408 if (in1->outcnt() == 0) {
3409 in1->disconnect_inputs(this);
3410 }
3411 break;
3412 }
3413
3414 case Op_Proj: {
3415 if (OptimizeStringConcat || IncrementalInline) {
3416 ProjNode* proj = n->as_Proj();
3417 if (proj->_is_io_use) {
3418 assert(proj->_con == TypeFunc::I_O || proj->_con == TypeFunc::Memory, "");
3419 // Separate projections were used for the exception path which
3420 // are normally removed by a late inline. If it wasn't inlined
3421 // then they will hang around and should just be replaced with
3422 // the original one. Merge them.
3423 Node* non_io_proj = proj->in(0)->as_Multi()->proj_out_or_null(proj->_con, false /*is_io_use*/);
3424 if (non_io_proj != NULL) {
3425 proj->subsume_by(non_io_proj , this);
3426 }
3427 }
3428 }
3429 break;
3430 }
3431
3432 case Op_Phi:
3433 if (n->as_Phi()->bottom_type()->isa_narrowoop() || n->as_Phi()->bottom_type()->isa_narrowklass()) {
|
3394 Node* in1 = n->in(1);
3395 if (in1->is_DecodeNarrowPtr()) {
3396 n->subsume_by(in1->in(1), this);
3397 } else if (in1->Opcode() == Op_ConP) {
3398 const Type* t = in1->bottom_type();
3399 if (t == TypePtr::NULL_PTR) {
3400 assert(t->isa_oopptr(), "null klass?");
3401 n->subsume_by(ConNode::make(TypeNarrowOop::NULL_PTR), this);
3402 } else if (t->isa_oopptr()) {
3403 n->subsume_by(ConNode::make(t->make_narrowoop()), this);
3404 } else if (t->isa_klassptr()) {
3405 n->subsume_by(ConNode::make(t->make_narrowklass()), this);
3406 }
3407 }
3408 if (in1->outcnt() == 0) {
3409 in1->disconnect_inputs(this);
3410 }
3411 break;
3412 }
3413
3414 case Op_ReverseBytesV:
3415 case Op_ReverseV: {
3416 if ((uint)n->in(1)->Opcode() == nop) {
3417 if (n->is_predicated_vector() && n->in(1)->is_predicated_vector() &&
3418 n->in(2) == n->in(1)->in(2)) {
3419 // Node (Node X , Mask) Mask => X
3420 n->subsume_by(n->in(1)->in(1), this);
3421 } else if (!n->is_predicated_using_blend() && !n->in(1)->is_predicated_using_blend()) {
3422 // Node (Node X) => X
3423 n->subsume_by(n->in(1)->in(1), this);
3424 }
3425 }
3426 break;
3427 }
3428
3429 case Op_Proj: {
3430 if (OptimizeStringConcat || IncrementalInline) {
3431 ProjNode* proj = n->as_Proj();
3432 if (proj->_is_io_use) {
3433 assert(proj->_con == TypeFunc::I_O || proj->_con == TypeFunc::Memory, "");
3434 // Separate projections were used for the exception path which
3435 // are normally removed by a late inline. If it wasn't inlined
3436 // then they will hang around and should just be replaced with
3437 // the original one. Merge them.
3438 Node* non_io_proj = proj->in(0)->as_Multi()->proj_out_or_null(proj->_con, false /*is_io_use*/);
3439 if (non_io_proj != NULL) {
3440 proj->subsume_by(non_io_proj , this);
3441 }
3442 }
3443 }
3444 break;
3445 }
3446
3447 case Op_Phi:
3448 if (n->as_Phi()->bottom_type()->isa_narrowoop() || n->as_Phi()->bottom_type()->isa_narrowklass()) {
|