Mercurial > hg > truffle
comparison src/share/vm/opto/doCall.cpp @ 6804:e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
Summary: Deleted placement new operator of Node - node(size_t, Compile *, int).
Reviewed-by: kvn, twisti
Contributed-by: bharadwaj.yadavalli@oracle.com
author | kvn |
---|---|
date | Thu, 27 Sep 2012 09:38:42 -0700 |
parents | 9d89c76b0505 |
children | a3ecd773a7b9 |
comparison
equal
deleted
inserted
replaced
6803:06f52c4d0e18 | 6804:e626685e9f6c |
---|---|
510 pop_node(rt); // whatever it was, pop it | 510 pop_node(rt); // whatever it was, pop it |
511 retnode = top(); | 511 retnode = top(); |
512 } else if (rt == T_INT || is_subword_type(rt)) { | 512 } else if (rt == T_INT || is_subword_type(rt)) { |
513 // FIXME: This logic should be factored out. | 513 // FIXME: This logic should be factored out. |
514 if (ct == T_BOOLEAN) { | 514 if (ct == T_BOOLEAN) { |
515 retnode = _gvn.transform( new (C, 3) AndINode(retnode, intcon(0x1)) ); | 515 retnode = _gvn.transform( new (C) AndINode(retnode, intcon(0x1)) ); |
516 } else if (ct == T_CHAR) { | 516 } else if (ct == T_CHAR) { |
517 retnode = _gvn.transform( new (C, 3) AndINode(retnode, intcon(0xFFFF)) ); | 517 retnode = _gvn.transform( new (C) AndINode(retnode, intcon(0xFFFF)) ); |
518 } else if (ct == T_BYTE) { | 518 } else if (ct == T_BYTE) { |
519 retnode = _gvn.transform( new (C, 3) LShiftINode(retnode, intcon(24)) ); | 519 retnode = _gvn.transform( new (C) LShiftINode(retnode, intcon(24)) ); |
520 retnode = _gvn.transform( new (C, 3) RShiftINode(retnode, intcon(24)) ); | 520 retnode = _gvn.transform( new (C) RShiftINode(retnode, intcon(24)) ); |
521 } else if (ct == T_SHORT) { | 521 } else if (ct == T_SHORT) { |
522 retnode = _gvn.transform( new (C, 3) LShiftINode(retnode, intcon(16)) ); | 522 retnode = _gvn.transform( new (C) LShiftINode(retnode, intcon(16)) ); |
523 retnode = _gvn.transform( new (C, 3) RShiftINode(retnode, intcon(16)) ); | 523 retnode = _gvn.transform( new (C) RShiftINode(retnode, intcon(16)) ); |
524 } else { | 524 } else { |
525 assert(ct == T_INT, err_msg_res("rt=%s, ct=%s", type2name(rt), type2name(ct))); | 525 assert(ct == T_INT, err_msg_res("rt=%s, ct=%s", type2name(rt), type2name(ct))); |
526 } | 526 } |
527 } else if (rt == T_OBJECT || rt == T_ARRAY) { | 527 } else if (rt == T_OBJECT || rt == T_ARRAY) { |
528 assert(ct == T_OBJECT || ct == T_ARRAY, err_msg_res("rt=%s, ct=%s", type2name(rt), type2name(ct))); | 528 assert(ct == T_OBJECT || ct == T_ARRAY, err_msg_res("rt=%s, ct=%s", type2name(rt), type2name(ct))); |
529 if (ctype->is_loaded()) { | 529 if (ctype->is_loaded()) { |
530 const TypeOopPtr* arg_type = TypeOopPtr::make_from_klass(rtype->as_klass()); | 530 const TypeOopPtr* arg_type = TypeOopPtr::make_from_klass(rtype->as_klass()); |
531 const Type* sig_type = TypeOopPtr::make_from_klass(ctype->as_klass()); | 531 const Type* sig_type = TypeOopPtr::make_from_klass(ctype->as_klass()); |
532 if (arg_type != NULL && !arg_type->higher_equal(sig_type)) { | 532 if (arg_type != NULL && !arg_type->higher_equal(sig_type)) { |
533 Node* cast_obj = _gvn.transform(new (C, 2) CheckCastPPNode(control(), retnode, sig_type)); | 533 Node* cast_obj = _gvn.transform(new (C) CheckCastPPNode(control(), retnode, sig_type)); |
534 pop(); | 534 pop(); |
535 push(cast_obj); | 535 push(cast_obj); |
536 } | 536 } |
537 } | 537 } |
538 } else { | 538 } else { |
610 bcis->append(h_bci); | 610 bcis->append(h_bci); |
611 extypes->append(h_extype); | 611 extypes->append(h_extype); |
612 } | 612 } |
613 | 613 |
614 int len = bcis->length(); | 614 int len = bcis->length(); |
615 CatchNode *cn = new (C, 2) CatchNode(control(), i_o, len+1); | 615 CatchNode *cn = new (C) CatchNode(control(), i_o, len+1); |
616 Node *catch_ = _gvn.transform(cn); | 616 Node *catch_ = _gvn.transform(cn); |
617 | 617 |
618 // now branch with the exception state to each of the (potential) | 618 // now branch with the exception state to each of the (potential) |
619 // handlers | 619 // handlers |
620 for(int i=0; i < len; i++) { | 620 for(int i=0; i < len; i++) { |
621 // Setup JVM state to enter the handler. | 621 // Setup JVM state to enter the handler. |
622 PreserveJVMState pjvms(this); | 622 PreserveJVMState pjvms(this); |
623 // Locals are just copied from before the call. | 623 // Locals are just copied from before the call. |
624 // Get control from the CatchNode. | 624 // Get control from the CatchNode. |
625 int handler_bci = bcis->at(i); | 625 int handler_bci = bcis->at(i); |
626 Node* ctrl = _gvn.transform( new (C, 1) CatchProjNode(catch_, i+1,handler_bci)); | 626 Node* ctrl = _gvn.transform( new (C) CatchProjNode(catch_, i+1,handler_bci)); |
627 // This handler cannot happen? | 627 // This handler cannot happen? |
628 if (ctrl == top()) continue; | 628 if (ctrl == top()) continue; |
629 set_control(ctrl); | 629 set_control(ctrl); |
630 | 630 |
631 // Create exception oop | 631 // Create exception oop |
632 const TypeInstPtr* extype = extypes->at(i)->is_instptr(); | 632 const TypeInstPtr* extype = extypes->at(i)->is_instptr(); |
633 Node *ex_oop = _gvn.transform(new (C, 2) CreateExNode(extypes->at(i), ctrl, i_o)); | 633 Node *ex_oop = _gvn.transform(new (C) CreateExNode(extypes->at(i), ctrl, i_o)); |
634 | 634 |
635 // Handle unloaded exception classes. | 635 // Handle unloaded exception classes. |
636 if (saw_unloaded->contains(handler_bci)) { | 636 if (saw_unloaded->contains(handler_bci)) { |
637 // An unloaded exception type is coming here. Do an uncommon trap. | 637 // An unloaded exception type is coming here. Do an uncommon trap. |
638 #ifndef PRODUCT | 638 #ifndef PRODUCT |
667 } | 667 } |
668 } | 668 } |
669 | 669 |
670 // The first CatchProj is for the normal return. | 670 // The first CatchProj is for the normal return. |
671 // (Note: If this is a call to rethrow_Java, this node goes dead.) | 671 // (Note: If this is a call to rethrow_Java, this node goes dead.) |
672 set_control(_gvn.transform( new (C, 1) CatchProjNode(catch_, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci))); | 672 set_control(_gvn.transform( new (C) CatchProjNode(catch_, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci))); |
673 } | 673 } |
674 | 674 |
675 | 675 |
676 //----------------------------catch_inline_exceptions-------------------------- | 676 //----------------------------catch_inline_exceptions-------------------------- |
677 // Handle all exceptions thrown by an inlined method or individual bytecode. | 677 // Handle all exceptions thrown by an inlined method or individual bytecode. |
718 // However, if the ex_node is a PhiNode, I'm going to do a LoadKlass for | 718 // However, if the ex_node is a PhiNode, I'm going to do a LoadKlass for |
719 // each arm of the Phi. If I know something clever about the exceptions | 719 // each arm of the Phi. If I know something clever about the exceptions |
720 // I'm loading the class from, I can replace the LoadKlass with the | 720 // I'm loading the class from, I can replace the LoadKlass with the |
721 // klass constant for the exception oop. | 721 // klass constant for the exception oop. |
722 if( ex_node->is_Phi() ) { | 722 if( ex_node->is_Phi() ) { |
723 ex_klass_node = new (C, ex_node->req()) PhiNode( ex_node->in(0), TypeKlassPtr::OBJECT ); | 723 ex_klass_node = new (C) PhiNode( ex_node->in(0), TypeKlassPtr::OBJECT ); |
724 for( uint i = 1; i < ex_node->req(); i++ ) { | 724 for( uint i = 1; i < ex_node->req(); i++ ) { |
725 Node* p = basic_plus_adr( ex_node->in(i), ex_node->in(i), oopDesc::klass_offset_in_bytes() ); | 725 Node* p = basic_plus_adr( ex_node->in(i), ex_node->in(i), oopDesc::klass_offset_in_bytes() ); |
726 Node* k = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT) ); | 726 Node* k = _gvn.transform( LoadKlassNode::make(_gvn, immutable_memory(), p, TypeInstPtr::KLASS, TypeKlassPtr::OBJECT) ); |
727 ex_klass_node->init_req( i, k ); | 727 ex_klass_node->init_req( i, k ); |
728 } | 728 } |
784 Node* not_subtype_ctrl = gen_subtype_check(ex_klass_node, con); | 784 Node* not_subtype_ctrl = gen_subtype_check(ex_klass_node, con); |
785 if (!stopped()) { | 785 if (!stopped()) { |
786 PreserveJVMState pjvms(this); | 786 PreserveJVMState pjvms(this); |
787 const TypeInstPtr* tinst = TypeOopPtr::make_from_klass_unique(klass)->cast_to_ptr_type(TypePtr::NotNull)->is_instptr(); | 787 const TypeInstPtr* tinst = TypeOopPtr::make_from_klass_unique(klass)->cast_to_ptr_type(TypePtr::NotNull)->is_instptr(); |
788 assert(klass->has_subklass() || tinst->klass_is_exact(), "lost exactness"); | 788 assert(klass->has_subklass() || tinst->klass_is_exact(), "lost exactness"); |
789 Node* ex_oop = _gvn.transform(new (C, 2) CheckCastPPNode(control(), ex_node, tinst)); | 789 Node* ex_oop = _gvn.transform(new (C) CheckCastPPNode(control(), ex_node, tinst)); |
790 push_ex_oop(ex_oop); // Push exception oop for handler | 790 push_ex_oop(ex_oop); // Push exception oop for handler |
791 #ifndef PRODUCT | 791 #ifndef PRODUCT |
792 if (PrintOpto && WizardMode) { | 792 if (PrintOpto && WizardMode) { |
793 tty->print(" Catching inline exception bci:%d -> handler_bci:%d -- ", bci(), handler_bci); | 793 tty->print(" Catching inline exception bci:%d -> handler_bci:%d -- ", bci(), handler_bci); |
794 klass->print_name(); | 794 klass->print_name(); |