comparison src/share/vm/opto/parse2.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 da91efe96a93
children 8e47bac5643a
comparison
equal deleted inserted replaced
6803:06f52c4d0e18 6804:e626685e9f6c
125 } else { 125 } else {
126 // Range is constant in array-oop, so we can use the original state of mem 126 // Range is constant in array-oop, so we can use the original state of mem
127 Node* len = load_array_length(ary); 127 Node* len = load_array_length(ary);
128 128
129 // Test length vs index (standard trick using unsigned compare) 129 // Test length vs index (standard trick using unsigned compare)
130 Node* chk = _gvn.transform( new (C, 3) CmpUNode(idx, len) ); 130 Node* chk = _gvn.transform( new (C) CmpUNode(idx, len) );
131 BoolTest::mask btest = BoolTest::lt; 131 BoolTest::mask btest = BoolTest::lt;
132 tst = _gvn.transform( new (C, 2) BoolNode(chk, btest) ); 132 tst = _gvn.transform( new (C) BoolNode(chk, btest) );
133 } 133 }
134 // Branch to failure if out of bounds 134 // Branch to failure if out of bounds
135 { BuildCutout unless(this, tst, PROB_MAX); 135 { BuildCutout unless(this, tst, PROB_MAX);
136 if (C->allow_range_check_smearing()) { 136 if (C->allow_range_check_smearing()) {
137 // Do not use builtin_throw, since range checks are sometimes 137 // Do not use builtin_throw, since range checks are sometimes
163 } 163 }
164 164
165 165
166 // returns IfNode 166 // returns IfNode
167 IfNode* Parse::jump_if_fork_int(Node* a, Node* b, BoolTest::mask mask) { 167 IfNode* Parse::jump_if_fork_int(Node* a, Node* b, BoolTest::mask mask) {
168 Node *cmp = _gvn.transform( new (C, 3) CmpINode( a, b)); // two cases: shiftcount > 32 and shiftcount <= 32 168 Node *cmp = _gvn.transform( new (C) CmpINode( a, b)); // two cases: shiftcount > 32 and shiftcount <= 32
169 Node *tst = _gvn.transform( new (C, 2) BoolNode( cmp, mask)); 169 Node *tst = _gvn.transform( new (C) BoolNode( cmp, mask));
170 IfNode *iff = create_and_map_if( control(), tst, ((mask == BoolTest::eq) ? PROB_STATIC_INFREQUENT : PROB_FAIR), COUNT_UNKNOWN ); 170 IfNode *iff = create_and_map_if( control(), tst, ((mask == BoolTest::eq) ? PROB_STATIC_INFREQUENT : PROB_FAIR), COUNT_UNKNOWN );
171 return iff; 171 return iff;
172 } 172 }
173 173
174 // return Region node 174 // return Region node
175 Node* Parse::jump_if_join(Node* iffalse, Node* iftrue) { 175 Node* Parse::jump_if_join(Node* iffalse, Node* iftrue) {
176 Node *region = new (C, 3) RegionNode(3); // 2 results 176 Node *region = new (C) RegionNode(3); // 2 results
177 record_for_igvn(region); 177 record_for_igvn(region);
178 region->init_req(1, iffalse); 178 region->init_req(1, iffalse);
179 region->init_req(2, iftrue ); 179 region->init_req(2, iftrue );
180 _gvn.set_type(region, Type::CONTROL); 180 _gvn.set_type(region, Type::CONTROL);
181 region = _gvn.transform(region); 181 region = _gvn.transform(region);
186 186
187 //------------------------------helper for tableswitch------------------------- 187 //------------------------------helper for tableswitch-------------------------
188 void Parse::jump_if_true_fork(IfNode *iff, int dest_bci_if_true, int prof_table_index) { 188 void Parse::jump_if_true_fork(IfNode *iff, int dest_bci_if_true, int prof_table_index) {
189 // True branch, use existing map info 189 // True branch, use existing map info
190 { PreserveJVMState pjvms(this); 190 { PreserveJVMState pjvms(this);
191 Node *iftrue = _gvn.transform( new (C, 1) IfTrueNode (iff) ); 191 Node *iftrue = _gvn.transform( new (C) IfTrueNode (iff) );
192 set_control( iftrue ); 192 set_control( iftrue );
193 profile_switch_case(prof_table_index); 193 profile_switch_case(prof_table_index);
194 merge_new_path(dest_bci_if_true); 194 merge_new_path(dest_bci_if_true);
195 } 195 }
196 196
197 // False branch 197 // False branch
198 Node *iffalse = _gvn.transform( new (C, 1) IfFalseNode(iff) ); 198 Node *iffalse = _gvn.transform( new (C) IfFalseNode(iff) );
199 set_control( iffalse ); 199 set_control( iffalse );
200 } 200 }
201 201
202 void Parse::jump_if_false_fork(IfNode *iff, int dest_bci_if_true, int prof_table_index) { 202 void Parse::jump_if_false_fork(IfNode *iff, int dest_bci_if_true, int prof_table_index) {
203 // True branch, use existing map info 203 // True branch, use existing map info
204 { PreserveJVMState pjvms(this); 204 { PreserveJVMState pjvms(this);
205 Node *iffalse = _gvn.transform( new (C, 1) IfFalseNode (iff) ); 205 Node *iffalse = _gvn.transform( new (C) IfFalseNode (iff) );
206 set_control( iffalse ); 206 set_control( iffalse );
207 profile_switch_case(prof_table_index); 207 profile_switch_case(prof_table_index);
208 merge_new_path(dest_bci_if_true); 208 merge_new_path(dest_bci_if_true);
209 } 209 }
210 210
211 // False branch 211 // False branch
212 Node *iftrue = _gvn.transform( new (C, 1) IfTrueNode(iff) ); 212 Node *iftrue = _gvn.transform( new (C) IfTrueNode(iff) );
213 set_control( iftrue ); 213 set_control( iftrue );
214 } 214 }
215 215
216 void Parse::jump_if_always_fork(int dest_bci, int prof_table_index) { 216 void Parse::jump_if_always_fork(int dest_bci, int prof_table_index) {
217 // False branch, use existing map and control() 217 // False branch, use existing map and control()
435 if (num_cases > (MaxJumpTableSparseness * num_range)) 435 if (num_cases > (MaxJumpTableSparseness * num_range))
436 return false; 436 return false;
437 437
438 // Normalize table lookups to zero 438 // Normalize table lookups to zero
439 int lowval = lo->lo(); 439 int lowval = lo->lo();
440 key_val = _gvn.transform( new (C, 3) SubINode(key_val, _gvn.intcon(lowval)) ); 440 key_val = _gvn.transform( new (C) SubINode(key_val, _gvn.intcon(lowval)) );
441 441
442 // Generate a guard to protect against input keyvals that aren't 442 // Generate a guard to protect against input keyvals that aren't
443 // in the switch domain. 443 // in the switch domain.
444 if (needs_guard) { 444 if (needs_guard) {
445 Node* size = _gvn.intcon(num_cases); 445 Node* size = _gvn.intcon(num_cases);
446 Node* cmp = _gvn.transform( new (C, 3) CmpUNode(key_val, size) ); 446 Node* cmp = _gvn.transform( new (C) CmpUNode(key_val, size) );
447 Node* tst = _gvn.transform( new (C, 2) BoolNode(cmp, BoolTest::ge) ); 447 Node* tst = _gvn.transform( new (C) BoolNode(cmp, BoolTest::ge) );
448 IfNode* iff = create_and_map_if( control(), tst, PROB_FAIR, COUNT_UNKNOWN); 448 IfNode* iff = create_and_map_if( control(), tst, PROB_FAIR, COUNT_UNKNOWN);
449 jump_if_true_fork(iff, default_dest, NullTableIndex); 449 jump_if_true_fork(iff, default_dest, NullTableIndex);
450 } 450 }
451 451
452 // Create an ideal node JumpTable that has projections 452 // Create an ideal node JumpTable that has projections
455 // Compare Parse::array_addressing above. 455 // Compare Parse::array_addressing above.
456 #ifdef _LP64 456 #ifdef _LP64
457 // Clean the 32-bit int into a real 64-bit offset. 457 // Clean the 32-bit int into a real 64-bit offset.
458 // Otherwise, the jint value 0 might turn into an offset of 0x0800000000. 458 // Otherwise, the jint value 0 might turn into an offset of 0x0800000000.
459 const TypeLong* lkeytype = TypeLong::make(CONST64(0), num_cases-1, Type::WidenMin); 459 const TypeLong* lkeytype = TypeLong::make(CONST64(0), num_cases-1, Type::WidenMin);
460 key_val = _gvn.transform( new (C, 2) ConvI2LNode(key_val, lkeytype) ); 460 key_val = _gvn.transform( new (C) ConvI2LNode(key_val, lkeytype) );
461 #endif 461 #endif
462 // Shift the value by wordsize so we have an index into the table, rather 462 // Shift the value by wordsize so we have an index into the table, rather
463 // than a switch value 463 // than a switch value
464 Node *shiftWord = _gvn.MakeConX(wordSize); 464 Node *shiftWord = _gvn.MakeConX(wordSize);
465 key_val = _gvn.transform( new (C, 3) MulXNode( key_val, shiftWord)); 465 key_val = _gvn.transform( new (C) MulXNode( key_val, shiftWord));
466 466
467 // Create the JumpNode 467 // Create the JumpNode
468 Node* jtn = _gvn.transform( new (C, 2) JumpNode(control(), key_val, num_cases) ); 468 Node* jtn = _gvn.transform( new (C) JumpNode(control(), key_val, num_cases) );
469 469
470 // These are the switch destinations hanging off the jumpnode 470 // These are the switch destinations hanging off the jumpnode
471 int i = 0; 471 int i = 0;
472 for (SwitchRange* r = lo; r <= hi; r++) { 472 for (SwitchRange* r = lo; r <= hi; r++) {
473 for (int j = r->lo(); j <= r->hi(); j++, i++) { 473 for (int j = r->lo(); j <= r->hi(); j++, i++) {
474 Node* input = _gvn.transform(new (C, 1) JumpProjNode(jtn, i, r->dest(), j - lowval)); 474 Node* input = _gvn.transform(new (C) JumpProjNode(jtn, i, r->dest(), j - lowval));
475 { 475 {
476 PreserveJVMState pjvms(this); 476 PreserveJVMState pjvms(this);
477 set_control(input); 477 set_control(input);
478 jump_if_always_fork(r->dest(), r->table_index()); 478 jump_if_always_fork(r->dest(), r->table_index());
479 } 479 }
570 // if there is a higher range, test for it and process it: 570 // if there is a higher range, test for it and process it:
571 if (mid < hi && !eq_test_only) { 571 if (mid < hi && !eq_test_only) {
572 // two comparisons of same values--should enable 1 test for 2 branches 572 // two comparisons of same values--should enable 1 test for 2 branches
573 // Use BoolTest::le instead of BoolTest::gt 573 // Use BoolTest::le instead of BoolTest::gt
574 IfNode *iff_le = jump_if_fork_int(key_val, test_val, BoolTest::le); 574 IfNode *iff_le = jump_if_fork_int(key_val, test_val, BoolTest::le);
575 Node *iftrue = _gvn.transform( new (C, 1) IfTrueNode(iff_le) ); 575 Node *iftrue = _gvn.transform( new (C) IfTrueNode(iff_le) );
576 Node *iffalse = _gvn.transform( new (C, 1) IfFalseNode(iff_le) ); 576 Node *iffalse = _gvn.transform( new (C) IfFalseNode(iff_le) );
577 { PreserveJVMState pjvms(this); 577 { PreserveJVMState pjvms(this);
578 set_control(iffalse); 578 set_control(iffalse);
579 jump_switch_ranges(key_val, mid+1, hi, switch_depth+1); 579 jump_switch_ranges(key_val, mid+1, hi, switch_depth+1);
580 } 580 }
581 set_control(iftrue); 581 set_control(iftrue);
587 587
588 // if there is a higher range, test for it and process it: 588 // if there is a higher range, test for it and process it:
589 if (mid == hi) { 589 if (mid == hi) {
590 jump_if_true_fork(iff_ge, mid->dest(), mid->table_index()); 590 jump_if_true_fork(iff_ge, mid->dest(), mid->table_index());
591 } else { 591 } else {
592 Node *iftrue = _gvn.transform( new (C, 1) IfTrueNode(iff_ge) ); 592 Node *iftrue = _gvn.transform( new (C) IfTrueNode(iff_ge) );
593 Node *iffalse = _gvn.transform( new (C, 1) IfFalseNode(iff_ge) ); 593 Node *iffalse = _gvn.transform( new (C) IfFalseNode(iff_ge) );
594 { PreserveJVMState pjvms(this); 594 { PreserveJVMState pjvms(this);
595 set_control(iftrue); 595 set_control(iftrue);
596 jump_switch_ranges(key_val, mid, hi, switch_depth+1); 596 jump_switch_ranges(key_val, mid, hi, switch_depth+1);
597 } 597 }
598 set_control(iffalse); 598 set_control(iffalse);
643 Node *f1 = pop(); 643 Node *f1 = pop();
644 Node* c = make_runtime_call(RC_LEAF, OptoRuntime::modf_Type(), 644 Node* c = make_runtime_call(RC_LEAF, OptoRuntime::modf_Type(),
645 CAST_FROM_FN_PTR(address, SharedRuntime::frem), 645 CAST_FROM_FN_PTR(address, SharedRuntime::frem),
646 "frem", NULL, //no memory effects 646 "frem", NULL, //no memory effects
647 f1, f2); 647 f1, f2);
648 Node* res = _gvn.transform(new (C, 1) ProjNode(c, TypeFunc::Parms + 0)); 648 Node* res = _gvn.transform(new (C) ProjNode(c, TypeFunc::Parms + 0));
649 649
650 push(res); 650 push(res);
651 } 651 }
652 652
653 void Parse::modd() { 653 void Parse::modd() {
655 Node *d1 = pop_pair(); 655 Node *d1 = pop_pair();
656 Node* c = make_runtime_call(RC_LEAF, OptoRuntime::Math_DD_D_Type(), 656 Node* c = make_runtime_call(RC_LEAF, OptoRuntime::Math_DD_D_Type(),
657 CAST_FROM_FN_PTR(address, SharedRuntime::drem), 657 CAST_FROM_FN_PTR(address, SharedRuntime::drem),
658 "drem", NULL, //no memory effects 658 "drem", NULL, //no memory effects
659 d1, top(), d2, top()); 659 d1, top(), d2, top());
660 Node* res_d = _gvn.transform(new (C, 1) ProjNode(c, TypeFunc::Parms + 0)); 660 Node* res_d = _gvn.transform(new (C) ProjNode(c, TypeFunc::Parms + 0));
661 661
662 #ifdef ASSERT 662 #ifdef ASSERT
663 Node* res_top = _gvn.transform(new (C, 1) ProjNode(c, TypeFunc::Parms + 1)); 663 Node* res_top = _gvn.transform(new (C) ProjNode(c, TypeFunc::Parms + 1));
664 assert(res_top == top(), "second value must be top"); 664 assert(res_top == top(), "second value must be top");
665 #endif 665 #endif
666 666
667 push_pair(res_d); 667 push_pair(res_d);
668 } 668 }
672 Node* f1 = pop(); 672 Node* f1 = pop();
673 Node* c = make_runtime_call(RC_LEAF, OptoRuntime::l2f_Type(), 673 Node* c = make_runtime_call(RC_LEAF, OptoRuntime::l2f_Type(),
674 CAST_FROM_FN_PTR(address, SharedRuntime::l2f), 674 CAST_FROM_FN_PTR(address, SharedRuntime::l2f),
675 "l2f", NULL, //no memory effects 675 "l2f", NULL, //no memory effects
676 f1, f2); 676 f1, f2);
677 Node* res = _gvn.transform(new (C, 1) ProjNode(c, TypeFunc::Parms + 0)); 677 Node* res = _gvn.transform(new (C) ProjNode(c, TypeFunc::Parms + 0));
678 678
679 push(res); 679 push(res);
680 } 680 }
681 681
682 void Parse::do_irem() { 682 void Parse::do_irem() {
699 // yes ! 699 // yes !
700 Node *mask = _gvn.intcon((divisor - 1)); 700 Node *mask = _gvn.intcon((divisor - 1));
701 // Sigh, must handle negative dividends 701 // Sigh, must handle negative dividends
702 Node *zero = _gvn.intcon(0); 702 Node *zero = _gvn.intcon(0);
703 IfNode *ifff = jump_if_fork_int(a, zero, BoolTest::lt); 703 IfNode *ifff = jump_if_fork_int(a, zero, BoolTest::lt);
704 Node *iff = _gvn.transform( new (C, 1) IfFalseNode(ifff) ); 704 Node *iff = _gvn.transform( new (C) IfFalseNode(ifff) );
705 Node *ift = _gvn.transform( new (C, 1) IfTrueNode (ifff) ); 705 Node *ift = _gvn.transform( new (C) IfTrueNode (ifff) );
706 Node *reg = jump_if_join(ift, iff); 706 Node *reg = jump_if_join(ift, iff);
707 Node *phi = PhiNode::make(reg, NULL, TypeInt::INT); 707 Node *phi = PhiNode::make(reg, NULL, TypeInt::INT);
708 // Negative path; negate/and/negate 708 // Negative path; negate/and/negate
709 Node *neg = _gvn.transform( new (C, 3) SubINode(zero, a) ); 709 Node *neg = _gvn.transform( new (C) SubINode(zero, a) );
710 Node *andn= _gvn.transform( new (C, 3) AndINode(neg, mask) ); 710 Node *andn= _gvn.transform( new (C) AndINode(neg, mask) );
711 Node *negn= _gvn.transform( new (C, 3) SubINode(zero, andn) ); 711 Node *negn= _gvn.transform( new (C) SubINode(zero, andn) );
712 phi->init_req(1, negn); 712 phi->init_req(1, negn);
713 // Fast positive case 713 // Fast positive case
714 Node *andx = _gvn.transform( new (C, 3) AndINode(a, mask) ); 714 Node *andx = _gvn.transform( new (C) AndINode(a, mask) );
715 phi->init_req(2, andx); 715 phi->init_req(2, andx);
716 // Push the merge 716 // Push the merge
717 push( _gvn.transform(phi) ); 717 push( _gvn.transform(phi) );
718 return; 718 return;
719 } 719 }
720 } 720 }
721 } 721 }
722 // Default case 722 // Default case
723 push( _gvn.transform( new (C, 3) ModINode(control(),a,b) ) ); 723 push( _gvn.transform( new (C) ModINode(control(),a,b) ) );
724 } 724 }
725 725
726 // Handle jsr and jsr_w bytecode 726 // Handle jsr and jsr_w bytecode
727 void Parse::do_jsr() { 727 void Parse::do_jsr() {
728 assert(bc() == Bytecodes::_jsr || bc() == Bytecodes::_jsr_w, "wrong bytecode"); 728 assert(bc() == Bytecodes::_jsr || bc() == Bytecodes::_jsr_w, "wrong bytecode");
995 } 995 }
996 996
997 explicit_null_checks_inserted++; 997 explicit_null_checks_inserted++;
998 998
999 // Generate real control flow 999 // Generate real control flow
1000 Node *tst = _gvn.transform( new (C, 2) BoolNode( c, btest ) ); 1000 Node *tst = _gvn.transform( new (C) BoolNode( c, btest ) );
1001 1001
1002 // Sanity check the probability value 1002 // Sanity check the probability value
1003 assert(prob > 0.0f,"Bad probability in Parser"); 1003 assert(prob > 0.0f,"Bad probability in Parser");
1004 // Need xform to put node in hash table 1004 // Need xform to put node in hash table
1005 IfNode *iff = create_and_xform_if( control(), tst, prob, cnt ); 1005 IfNode *iff = create_and_xform_if( control(), tst, prob, cnt );
1006 assert(iff->_prob > 0.0f,"Optimizer made bad probability in parser"); 1006 assert(iff->_prob > 0.0f,"Optimizer made bad probability in parser");
1007 // True branch 1007 // True branch
1008 { PreserveJVMState pjvms(this); 1008 { PreserveJVMState pjvms(this);
1009 Node* iftrue = _gvn.transform( new (C, 1) IfTrueNode (iff) ); 1009 Node* iftrue = _gvn.transform( new (C) IfTrueNode (iff) );
1010 set_control(iftrue); 1010 set_control(iftrue);
1011 1011
1012 if (stopped()) { // Path is dead? 1012 if (stopped()) { // Path is dead?
1013 explicit_null_checks_elided++; 1013 explicit_null_checks_elided++;
1014 if (EliminateAutoBox) { 1014 if (EliminateAutoBox) {
1024 } 1024 }
1025 } 1025 }
1026 } 1026 }
1027 1027
1028 // False branch 1028 // False branch
1029 Node* iffalse = _gvn.transform( new (C, 1) IfFalseNode(iff) ); 1029 Node* iffalse = _gvn.transform( new (C) IfFalseNode(iff) );
1030 set_control(iffalse); 1030 set_control(iffalse);
1031 1031
1032 if (stopped()) { // Path is dead? 1032 if (stopped()) { // Path is dead?
1033 explicit_null_checks_elided++; 1033 explicit_null_checks_elided++;
1034 if (EliminateAutoBox) { 1034 if (EliminateAutoBox) {
1087 // prob is NOT updated here; it remains the probability of the taken 1087 // prob is NOT updated here; it remains the probability of the taken
1088 // path (as opposed to the prob of the path guarded by an 'IfTrueNode'). 1088 // path (as opposed to the prob of the path guarded by an 'IfTrueNode').
1089 } 1089 }
1090 assert(btest != BoolTest::eq, "!= is the only canonical exact test"); 1090 assert(btest != BoolTest::eq, "!= is the only canonical exact test");
1091 1091
1092 Node* tst0 = new (C, 2) BoolNode(c, btest); 1092 Node* tst0 = new (C) BoolNode(c, btest);
1093 Node* tst = _gvn.transform(tst0); 1093 Node* tst = _gvn.transform(tst0);
1094 BoolTest::mask taken_btest = BoolTest::illegal; 1094 BoolTest::mask taken_btest = BoolTest::illegal;
1095 BoolTest::mask untaken_btest = BoolTest::illegal; 1095 BoolTest::mask untaken_btest = BoolTest::illegal;
1096 1096
1097 if (tst->is_Bool()) { 1097 if (tst->is_Bool()) {
1118 1118
1119 // Generate real control flow 1119 // Generate real control flow
1120 float true_prob = (taken_if_true ? prob : untaken_prob); 1120 float true_prob = (taken_if_true ? prob : untaken_prob);
1121 IfNode* iff = create_and_map_if(control(), tst, true_prob, cnt); 1121 IfNode* iff = create_and_map_if(control(), tst, true_prob, cnt);
1122 assert(iff->_prob > 0.0f,"Optimizer made bad probability in parser"); 1122 assert(iff->_prob > 0.0f,"Optimizer made bad probability in parser");
1123 Node* taken_branch = new (C, 1) IfTrueNode(iff); 1123 Node* taken_branch = new (C) IfTrueNode(iff);
1124 Node* untaken_branch = new (C, 1) IfFalseNode(iff); 1124 Node* untaken_branch = new (C) IfFalseNode(iff);
1125 if (!taken_if_true) { // Finish conversion to canonical form 1125 if (!taken_if_true) { // Finish conversion to canonical form
1126 Node* tmp = taken_branch; 1126 Node* tmp = taken_branch;
1127 taken_branch = untaken_branch; 1127 taken_branch = untaken_branch;
1128 untaken_branch = tmp; 1128 untaken_branch = tmp;
1129 } 1129 }
1283 // obj has to be of the exact type Foo if the CmpP succeeds. 1283 // obj has to be of the exact type Foo if the CmpP succeeds.
1284 int obj_in_map = map()->find_edge(obj); 1284 int obj_in_map = map()->find_edge(obj);
1285 JVMState* jvms = this->jvms(); 1285 JVMState* jvms = this->jvms();
1286 if (obj_in_map >= 0 && 1286 if (obj_in_map >= 0 &&
1287 (jvms->is_loc(obj_in_map) || jvms->is_stk(obj_in_map))) { 1287 (jvms->is_loc(obj_in_map) || jvms->is_stk(obj_in_map))) {
1288 TypeNode* ccast = new (C, 2) CheckCastPPNode(control(), obj, tboth); 1288 TypeNode* ccast = new (C) CheckCastPPNode(control(), obj, tboth);
1289 const Type* tcc = ccast->as_Type()->type(); 1289 const Type* tcc = ccast->as_Type()->type();
1290 assert(tcc != obj_type && tcc->higher_equal(obj_type), "must improve"); 1290 assert(tcc != obj_type && tcc->higher_equal(obj_type), "must improve");
1291 // Delay transform() call to allow recovery of pre-cast value 1291 // Delay transform() call to allow recovery of pre-cast value
1292 // at the control merge. 1292 // at the control merge.
1293 _gvn.set_type_bottom(ccast); 1293 _gvn.set_type_bottom(ccast);
1318 case BoolTest::eq: // Constant test? 1318 case BoolTest::eq: // Constant test?
1319 { 1319 {
1320 const Type* tboth = tcon->join(tval); 1320 const Type* tboth = tcon->join(tval);
1321 if (tboth == tval) break; // Nothing to gain. 1321 if (tboth == tval) break; // Nothing to gain.
1322 if (tcon->isa_int()) { 1322 if (tcon->isa_int()) {
1323 ccast = new (C, 2) CastIINode(val, tboth); 1323 ccast = new (C) CastIINode(val, tboth);
1324 } else if (tcon == TypePtr::NULL_PTR) { 1324 } else if (tcon == TypePtr::NULL_PTR) {
1325 // Cast to null, but keep the pointer identity temporarily live. 1325 // Cast to null, but keep the pointer identity temporarily live.
1326 ccast = new (C, 2) CastPPNode(val, tboth); 1326 ccast = new (C) CastPPNode(val, tboth);
1327 } else { 1327 } else {
1328 const TypeF* tf = tcon->isa_float_constant(); 1328 const TypeF* tf = tcon->isa_float_constant();
1329 const TypeD* td = tcon->isa_double_constant(); 1329 const TypeD* td = tcon->isa_double_constant();
1330 // Exclude tests vs float/double 0 as these could be 1330 // Exclude tests vs float/double 0 as these could be
1331 // either +0 or -0. Just because you are equal to +0 1331 // either +0 or -0. Just because you are equal to +0
1736 do_null_check(peek(), T_INT); 1736 do_null_check(peek(), T_INT);
1737 // Compile-time detect of null-exception? 1737 // Compile-time detect of null-exception?
1738 if (stopped()) return; 1738 if (stopped()) return;
1739 b = pop(); 1739 b = pop();
1740 a = pop(); 1740 a = pop();
1741 push( _gvn.transform( new (C, 3) DivINode(control(),a,b) ) ); 1741 push( _gvn.transform( new (C) DivINode(control(),a,b) ) );
1742 break; 1742 break;
1743 case Bytecodes::_imul: 1743 case Bytecodes::_imul:
1744 b = pop(); a = pop(); 1744 b = pop(); a = pop();
1745 push( _gvn.transform( new (C, 3) MulINode(a,b) ) ); 1745 push( _gvn.transform( new (C) MulINode(a,b) ) );
1746 break; 1746 break;
1747 case Bytecodes::_iadd: 1747 case Bytecodes::_iadd:
1748 b = pop(); a = pop(); 1748 b = pop(); a = pop();
1749 push( _gvn.transform( new (C, 3) AddINode(a,b) ) ); 1749 push( _gvn.transform( new (C) AddINode(a,b) ) );
1750 break; 1750 break;
1751 case Bytecodes::_ineg: 1751 case Bytecodes::_ineg:
1752 a = pop(); 1752 a = pop();
1753 push( _gvn.transform( new (C, 3) SubINode(_gvn.intcon(0),a)) ); 1753 push( _gvn.transform( new (C) SubINode(_gvn.intcon(0),a)) );
1754 break; 1754 break;
1755 case Bytecodes::_isub: 1755 case Bytecodes::_isub:
1756 b = pop(); a = pop(); 1756 b = pop(); a = pop();
1757 push( _gvn.transform( new (C, 3) SubINode(a,b) ) ); 1757 push( _gvn.transform( new (C) SubINode(a,b) ) );
1758 break; 1758 break;
1759 case Bytecodes::_iand: 1759 case Bytecodes::_iand:
1760 b = pop(); a = pop(); 1760 b = pop(); a = pop();
1761 push( _gvn.transform( new (C, 3) AndINode(a,b) ) ); 1761 push( _gvn.transform( new (C) AndINode(a,b) ) );
1762 break; 1762 break;
1763 case Bytecodes::_ior: 1763 case Bytecodes::_ior:
1764 b = pop(); a = pop(); 1764 b = pop(); a = pop();
1765 push( _gvn.transform( new (C, 3) OrINode(a,b) ) ); 1765 push( _gvn.transform( new (C) OrINode(a,b) ) );
1766 break; 1766 break;
1767 case Bytecodes::_ixor: 1767 case Bytecodes::_ixor:
1768 b = pop(); a = pop(); 1768 b = pop(); a = pop();
1769 push( _gvn.transform( new (C, 3) XorINode(a,b) ) ); 1769 push( _gvn.transform( new (C) XorINode(a,b) ) );
1770 break; 1770 break;
1771 case Bytecodes::_ishl: 1771 case Bytecodes::_ishl:
1772 b = pop(); a = pop(); 1772 b = pop(); a = pop();
1773 push( _gvn.transform( new (C, 3) LShiftINode(a,b) ) ); 1773 push( _gvn.transform( new (C) LShiftINode(a,b) ) );
1774 break; 1774 break;
1775 case Bytecodes::_ishr: 1775 case Bytecodes::_ishr:
1776 b = pop(); a = pop(); 1776 b = pop(); a = pop();
1777 push( _gvn.transform( new (C, 3) RShiftINode(a,b) ) ); 1777 push( _gvn.transform( new (C) RShiftINode(a,b) ) );
1778 break; 1778 break;
1779 case Bytecodes::_iushr: 1779 case Bytecodes::_iushr:
1780 b = pop(); a = pop(); 1780 b = pop(); a = pop();
1781 push( _gvn.transform( new (C, 3) URShiftINode(a,b) ) ); 1781 push( _gvn.transform( new (C) URShiftINode(a,b) ) );
1782 break; 1782 break;
1783 1783
1784 case Bytecodes::_fneg: 1784 case Bytecodes::_fneg:
1785 a = pop(); 1785 a = pop();
1786 b = _gvn.transform(new (C, 2) NegFNode (a)); 1786 b = _gvn.transform(new (C) NegFNode (a));
1787 push(b); 1787 push(b);
1788 break; 1788 break;
1789 1789
1790 case Bytecodes::_fsub: 1790 case Bytecodes::_fsub:
1791 b = pop(); 1791 b = pop();
1792 a = pop(); 1792 a = pop();
1793 c = _gvn.transform( new (C, 3) SubFNode(a,b) ); 1793 c = _gvn.transform( new (C) SubFNode(a,b) );
1794 d = precision_rounding(c); 1794 d = precision_rounding(c);
1795 push( d ); 1795 push( d );
1796 break; 1796 break;
1797 1797
1798 case Bytecodes::_fadd: 1798 case Bytecodes::_fadd:
1799 b = pop(); 1799 b = pop();
1800 a = pop(); 1800 a = pop();
1801 c = _gvn.transform( new (C, 3) AddFNode(a,b) ); 1801 c = _gvn.transform( new (C) AddFNode(a,b) );
1802 d = precision_rounding(c); 1802 d = precision_rounding(c);
1803 push( d ); 1803 push( d );
1804 break; 1804 break;
1805 1805
1806 case Bytecodes::_fmul: 1806 case Bytecodes::_fmul:
1807 b = pop(); 1807 b = pop();
1808 a = pop(); 1808 a = pop();
1809 c = _gvn.transform( new (C, 3) MulFNode(a,b) ); 1809 c = _gvn.transform( new (C) MulFNode(a,b) );
1810 d = precision_rounding(c); 1810 d = precision_rounding(c);
1811 push( d ); 1811 push( d );
1812 break; 1812 break;
1813 1813
1814 case Bytecodes::_fdiv: 1814 case Bytecodes::_fdiv:
1815 b = pop(); 1815 b = pop();
1816 a = pop(); 1816 a = pop();
1817 c = _gvn.transform( new (C, 3) DivFNode(0,a,b) ); 1817 c = _gvn.transform( new (C) DivFNode(0,a,b) );
1818 d = precision_rounding(c); 1818 d = precision_rounding(c);
1819 push( d ); 1819 push( d );
1820 break; 1820 break;
1821 1821
1822 case Bytecodes::_frem: 1822 case Bytecodes::_frem:
1823 if (Matcher::has_match_rule(Op_ModF)) { 1823 if (Matcher::has_match_rule(Op_ModF)) {
1824 // Generate a ModF node. 1824 // Generate a ModF node.
1825 b = pop(); 1825 b = pop();
1826 a = pop(); 1826 a = pop();
1827 c = _gvn.transform( new (C, 3) ModFNode(0,a,b) ); 1827 c = _gvn.transform( new (C) ModFNode(0,a,b) );
1828 d = precision_rounding(c); 1828 d = precision_rounding(c);
1829 push( d ); 1829 push( d );
1830 } 1830 }
1831 else { 1831 else {
1832 // Generate a call. 1832 // Generate a call.
1835 break; 1835 break;
1836 1836
1837 case Bytecodes::_fcmpl: 1837 case Bytecodes::_fcmpl:
1838 b = pop(); 1838 b = pop();
1839 a = pop(); 1839 a = pop();
1840 c = _gvn.transform( new (C, 3) CmpF3Node( a, b)); 1840 c = _gvn.transform( new (C) CmpF3Node( a, b));
1841 push(c); 1841 push(c);
1842 break; 1842 break;
1843 case Bytecodes::_fcmpg: 1843 case Bytecodes::_fcmpg:
1844 b = pop(); 1844 b = pop();
1845 a = pop(); 1845 a = pop();
1847 // Same as fcmpl but need to flip the unordered case. Swap the inputs, 1847 // Same as fcmpl but need to flip the unordered case. Swap the inputs,
1848 // which negates the result sign except for unordered. Flip the unordered 1848 // which negates the result sign except for unordered. Flip the unordered
1849 // as well by using CmpF3 which implements unordered-lesser instead of 1849 // as well by using CmpF3 which implements unordered-lesser instead of
1850 // unordered-greater semantics. Finally, commute the result bits. Result 1850 // unordered-greater semantics. Finally, commute the result bits. Result
1851 // is same as using a CmpF3Greater except we did it with CmpF3 alone. 1851 // is same as using a CmpF3Greater except we did it with CmpF3 alone.
1852 c = _gvn.transform( new (C, 3) CmpF3Node( b, a)); 1852 c = _gvn.transform( new (C) CmpF3Node( b, a));
1853 c = _gvn.transform( new (C, 3) SubINode(_gvn.intcon(0),c) ); 1853 c = _gvn.transform( new (C) SubINode(_gvn.intcon(0),c) );
1854 push(c); 1854 push(c);
1855 break; 1855 break;
1856 1856
1857 case Bytecodes::_f2i: 1857 case Bytecodes::_f2i:
1858 a = pop(); 1858 a = pop();
1859 push(_gvn.transform(new (C, 2) ConvF2INode(a))); 1859 push(_gvn.transform(new (C) ConvF2INode(a)));
1860 break; 1860 break;
1861 1861
1862 case Bytecodes::_d2i: 1862 case Bytecodes::_d2i:
1863 a = pop_pair(); 1863 a = pop_pair();
1864 b = _gvn.transform(new (C, 2) ConvD2INode(a)); 1864 b = _gvn.transform(new (C) ConvD2INode(a));
1865 push( b ); 1865 push( b );
1866 break; 1866 break;
1867 1867
1868 case Bytecodes::_f2d: 1868 case Bytecodes::_f2d:
1869 a = pop(); 1869 a = pop();
1870 b = _gvn.transform( new (C, 2) ConvF2DNode(a)); 1870 b = _gvn.transform( new (C) ConvF2DNode(a));
1871 push_pair( b ); 1871 push_pair( b );
1872 break; 1872 break;
1873 1873
1874 case Bytecodes::_d2f: 1874 case Bytecodes::_d2f:
1875 a = pop_pair(); 1875 a = pop_pair();
1876 b = _gvn.transform( new (C, 2) ConvD2FNode(a)); 1876 b = _gvn.transform( new (C) ConvD2FNode(a));
1877 // This breaks _227_mtrt (speed & correctness) and _222_mpegaudio (speed) 1877 // This breaks _227_mtrt (speed & correctness) and _222_mpegaudio (speed)
1878 //b = _gvn.transform(new (C, 2) RoundFloatNode(0, b) ); 1878 //b = _gvn.transform(new (C) RoundFloatNode(0, b) );
1879 push( b ); 1879 push( b );
1880 break; 1880 break;
1881 1881
1882 case Bytecodes::_l2f: 1882 case Bytecodes::_l2f:
1883 if (Matcher::convL2FSupported()) { 1883 if (Matcher::convL2FSupported()) {
1884 a = pop_pair(); 1884 a = pop_pair();
1885 b = _gvn.transform( new (C, 2) ConvL2FNode(a)); 1885 b = _gvn.transform( new (C) ConvL2FNode(a));
1886 // For i486.ad, FILD doesn't restrict precision to 24 or 53 bits. 1886 // For i486.ad, FILD doesn't restrict precision to 24 or 53 bits.
1887 // Rather than storing the result into an FP register then pushing 1887 // Rather than storing the result into an FP register then pushing
1888 // out to memory to round, the machine instruction that implements 1888 // out to memory to round, the machine instruction that implements
1889 // ConvL2D is responsible for rounding. 1889 // ConvL2D is responsible for rounding.
1890 // c = precision_rounding(b); 1890 // c = precision_rounding(b);
1895 } 1895 }
1896 break; 1896 break;
1897 1897
1898 case Bytecodes::_l2d: 1898 case Bytecodes::_l2d:
1899 a = pop_pair(); 1899 a = pop_pair();
1900 b = _gvn.transform( new (C, 2) ConvL2DNode(a)); 1900 b = _gvn.transform( new (C) ConvL2DNode(a));
1901 // For i486.ad, rounding is always necessary (see _l2f above). 1901 // For i486.ad, rounding is always necessary (see _l2f above).
1902 // c = dprecision_rounding(b); 1902 // c = dprecision_rounding(b);
1903 c = _gvn.transform(b); 1903 c = _gvn.transform(b);
1904 push_pair(c); 1904 push_pair(c);
1905 break; 1905 break;
1906 1906
1907 case Bytecodes::_f2l: 1907 case Bytecodes::_f2l:
1908 a = pop(); 1908 a = pop();
1909 b = _gvn.transform( new (C, 2) ConvF2LNode(a)); 1909 b = _gvn.transform( new (C) ConvF2LNode(a));
1910 push_pair(b); 1910 push_pair(b);
1911 break; 1911 break;
1912 1912
1913 case Bytecodes::_d2l: 1913 case Bytecodes::_d2l:
1914 a = pop_pair(); 1914 a = pop_pair();
1915 b = _gvn.transform( new (C, 2) ConvD2LNode(a)); 1915 b = _gvn.transform( new (C) ConvD2LNode(a));
1916 push_pair(b); 1916 push_pair(b);
1917 break; 1917 break;
1918 1918
1919 case Bytecodes::_dsub: 1919 case Bytecodes::_dsub:
1920 b = pop_pair(); 1920 b = pop_pair();
1921 a = pop_pair(); 1921 a = pop_pair();
1922 c = _gvn.transform( new (C, 3) SubDNode(a,b) ); 1922 c = _gvn.transform( new (C) SubDNode(a,b) );
1923 d = dprecision_rounding(c); 1923 d = dprecision_rounding(c);
1924 push_pair( d ); 1924 push_pair( d );
1925 break; 1925 break;
1926 1926
1927 case Bytecodes::_dadd: 1927 case Bytecodes::_dadd:
1928 b = pop_pair(); 1928 b = pop_pair();
1929 a = pop_pair(); 1929 a = pop_pair();
1930 c = _gvn.transform( new (C, 3) AddDNode(a,b) ); 1930 c = _gvn.transform( new (C) AddDNode(a,b) );
1931 d = dprecision_rounding(c); 1931 d = dprecision_rounding(c);
1932 push_pair( d ); 1932 push_pair( d );
1933 break; 1933 break;
1934 1934
1935 case Bytecodes::_dmul: 1935 case Bytecodes::_dmul:
1936 b = pop_pair(); 1936 b = pop_pair();
1937 a = pop_pair(); 1937 a = pop_pair();
1938 c = _gvn.transform( new (C, 3) MulDNode(a,b) ); 1938 c = _gvn.transform( new (C) MulDNode(a,b) );
1939 d = dprecision_rounding(c); 1939 d = dprecision_rounding(c);
1940 push_pair( d ); 1940 push_pair( d );
1941 break; 1941 break;
1942 1942
1943 case Bytecodes::_ddiv: 1943 case Bytecodes::_ddiv:
1944 b = pop_pair(); 1944 b = pop_pair();
1945 a = pop_pair(); 1945 a = pop_pair();
1946 c = _gvn.transform( new (C, 3) DivDNode(0,a,b) ); 1946 c = _gvn.transform( new (C) DivDNode(0,a,b) );
1947 d = dprecision_rounding(c); 1947 d = dprecision_rounding(c);
1948 push_pair( d ); 1948 push_pair( d );
1949 break; 1949 break;
1950 1950
1951 case Bytecodes::_dneg: 1951 case Bytecodes::_dneg:
1952 a = pop_pair(); 1952 a = pop_pair();
1953 b = _gvn.transform(new (C, 2) NegDNode (a)); 1953 b = _gvn.transform(new (C) NegDNode (a));
1954 push_pair(b); 1954 push_pair(b);
1955 break; 1955 break;
1956 1956
1957 case Bytecodes::_drem: 1957 case Bytecodes::_drem:
1958 if (Matcher::has_match_rule(Op_ModD)) { 1958 if (Matcher::has_match_rule(Op_ModD)) {
1959 // Generate a ModD node. 1959 // Generate a ModD node.
1960 b = pop_pair(); 1960 b = pop_pair();
1961 a = pop_pair(); 1961 a = pop_pair();
1962 // a % b 1962 // a % b
1963 1963
1964 c = _gvn.transform( new (C, 3) ModDNode(0,a,b) ); 1964 c = _gvn.transform( new (C) ModDNode(0,a,b) );
1965 d = dprecision_rounding(c); 1965 d = dprecision_rounding(c);
1966 push_pair( d ); 1966 push_pair( d );
1967 } 1967 }
1968 else { 1968 else {
1969 // Generate a call. 1969 // Generate a call.
1972 break; 1972 break;
1973 1973
1974 case Bytecodes::_dcmpl: 1974 case Bytecodes::_dcmpl:
1975 b = pop_pair(); 1975 b = pop_pair();
1976 a = pop_pair(); 1976 a = pop_pair();
1977 c = _gvn.transform( new (C, 3) CmpD3Node( a, b)); 1977 c = _gvn.transform( new (C) CmpD3Node( a, b));
1978 push(c); 1978 push(c);
1979 break; 1979 break;
1980 1980
1981 case Bytecodes::_dcmpg: 1981 case Bytecodes::_dcmpg:
1982 b = pop_pair(); 1982 b = pop_pair();
1985 // Commute the inputs, which negates the result sign except for unordered. 1985 // Commute the inputs, which negates the result sign except for unordered.
1986 // Flip the unordered as well by using CmpD3 which implements 1986 // Flip the unordered as well by using CmpD3 which implements
1987 // unordered-lesser instead of unordered-greater semantics. 1987 // unordered-lesser instead of unordered-greater semantics.
1988 // Finally, negate the result bits. Result is same as using a 1988 // Finally, negate the result bits. Result is same as using a
1989 // CmpD3Greater except we did it with CmpD3 alone. 1989 // CmpD3Greater except we did it with CmpD3 alone.
1990 c = _gvn.transform( new (C, 3) CmpD3Node( b, a)); 1990 c = _gvn.transform( new (C) CmpD3Node( b, a));
1991 c = _gvn.transform( new (C, 3) SubINode(_gvn.intcon(0),c) ); 1991 c = _gvn.transform( new (C) SubINode(_gvn.intcon(0),c) );
1992 push(c); 1992 push(c);
1993 break; 1993 break;
1994 1994
1995 1995
1996 // Note for longs -> lo word is on TOS, hi word is on TOS - 1 1996 // Note for longs -> lo word is on TOS, hi word is on TOS - 1
1997 case Bytecodes::_land: 1997 case Bytecodes::_land:
1998 b = pop_pair(); 1998 b = pop_pair();
1999 a = pop_pair(); 1999 a = pop_pair();
2000 c = _gvn.transform( new (C, 3) AndLNode(a,b) ); 2000 c = _gvn.transform( new (C) AndLNode(a,b) );
2001 push_pair(c); 2001 push_pair(c);
2002 break; 2002 break;
2003 case Bytecodes::_lor: 2003 case Bytecodes::_lor:
2004 b = pop_pair(); 2004 b = pop_pair();
2005 a = pop_pair(); 2005 a = pop_pair();
2006 c = _gvn.transform( new (C, 3) OrLNode(a,b) ); 2006 c = _gvn.transform( new (C) OrLNode(a,b) );
2007 push_pair(c); 2007 push_pair(c);
2008 break; 2008 break;
2009 case Bytecodes::_lxor: 2009 case Bytecodes::_lxor:
2010 b = pop_pair(); 2010 b = pop_pair();
2011 a = pop_pair(); 2011 a = pop_pair();
2012 c = _gvn.transform( new (C, 3) XorLNode(a,b) ); 2012 c = _gvn.transform( new (C) XorLNode(a,b) );
2013 push_pair(c); 2013 push_pair(c);
2014 break; 2014 break;
2015 2015
2016 case Bytecodes::_lshl: 2016 case Bytecodes::_lshl:
2017 b = pop(); // the shift count 2017 b = pop(); // the shift count
2018 a = pop_pair(); // value to be shifted 2018 a = pop_pair(); // value to be shifted
2019 c = _gvn.transform( new (C, 3) LShiftLNode(a,b) ); 2019 c = _gvn.transform( new (C) LShiftLNode(a,b) );
2020 push_pair(c); 2020 push_pair(c);
2021 break; 2021 break;
2022 case Bytecodes::_lshr: 2022 case Bytecodes::_lshr:
2023 b = pop(); // the shift count 2023 b = pop(); // the shift count
2024 a = pop_pair(); // value to be shifted 2024 a = pop_pair(); // value to be shifted
2025 c = _gvn.transform( new (C, 3) RShiftLNode(a,b) ); 2025 c = _gvn.transform( new (C) RShiftLNode(a,b) );
2026 push_pair(c); 2026 push_pair(c);
2027 break; 2027 break;
2028 case Bytecodes::_lushr: 2028 case Bytecodes::_lushr:
2029 b = pop(); // the shift count 2029 b = pop(); // the shift count
2030 a = pop_pair(); // value to be shifted 2030 a = pop_pair(); // value to be shifted
2031 c = _gvn.transform( new (C, 3) URShiftLNode(a,b) ); 2031 c = _gvn.transform( new (C) URShiftLNode(a,b) );
2032 push_pair(c); 2032 push_pair(c);
2033 break; 2033 break;
2034 case Bytecodes::_lmul: 2034 case Bytecodes::_lmul:
2035 b = pop_pair(); 2035 b = pop_pair();
2036 a = pop_pair(); 2036 a = pop_pair();
2037 c = _gvn.transform( new (C, 3) MulLNode(a,b) ); 2037 c = _gvn.transform( new (C) MulLNode(a,b) );
2038 push_pair(c); 2038 push_pair(c);
2039 break; 2039 break;
2040 2040
2041 case Bytecodes::_lrem: 2041 case Bytecodes::_lrem:
2042 // Must keep both values on the expression-stack during null-check 2042 // Must keep both values on the expression-stack during null-check
2044 do_null_check(peek(1), T_LONG); 2044 do_null_check(peek(1), T_LONG);
2045 // Compile-time detect of null-exception? 2045 // Compile-time detect of null-exception?
2046 if (stopped()) return; 2046 if (stopped()) return;
2047 b = pop_pair(); 2047 b = pop_pair();
2048 a = pop_pair(); 2048 a = pop_pair();
2049 c = _gvn.transform( new (C, 3) ModLNode(control(),a,b) ); 2049 c = _gvn.transform( new (C) ModLNode(control(),a,b) );
2050 push_pair(c); 2050 push_pair(c);
2051 break; 2051 break;
2052 2052
2053 case Bytecodes::_ldiv: 2053 case Bytecodes::_ldiv:
2054 // Must keep both values on the expression-stack during null-check 2054 // Must keep both values on the expression-stack during null-check
2056 do_null_check(peek(1), T_LONG); 2056 do_null_check(peek(1), T_LONG);
2057 // Compile-time detect of null-exception? 2057 // Compile-time detect of null-exception?
2058 if (stopped()) return; 2058 if (stopped()) return;
2059 b = pop_pair(); 2059 b = pop_pair();
2060 a = pop_pair(); 2060 a = pop_pair();
2061 c = _gvn.transform( new (C, 3) DivLNode(control(),a,b) ); 2061 c = _gvn.transform( new (C) DivLNode(control(),a,b) );
2062 push_pair(c); 2062 push_pair(c);
2063 break; 2063 break;
2064 2064
2065 case Bytecodes::_ladd: 2065 case Bytecodes::_ladd:
2066 b = pop_pair(); 2066 b = pop_pair();
2067 a = pop_pair(); 2067 a = pop_pair();
2068 c = _gvn.transform( new (C, 3) AddLNode(a,b) ); 2068 c = _gvn.transform( new (C) AddLNode(a,b) );
2069 push_pair(c); 2069 push_pair(c);
2070 break; 2070 break;
2071 case Bytecodes::_lsub: 2071 case Bytecodes::_lsub:
2072 b = pop_pair(); 2072 b = pop_pair();
2073 a = pop_pair(); 2073 a = pop_pair();
2074 c = _gvn.transform( new (C, 3) SubLNode(a,b) ); 2074 c = _gvn.transform( new (C) SubLNode(a,b) );
2075 push_pair(c); 2075 push_pair(c);
2076 break; 2076 break;
2077 case Bytecodes::_lcmp: 2077 case Bytecodes::_lcmp:
2078 // Safepoints are now inserted _before_ branches. The long-compare 2078 // Safepoints are now inserted _before_ branches. The long-compare
2079 // bytecode painfully produces a 3-way value (-1,0,+1) which requires a 2079 // bytecode painfully produces a 3-way value (-1,0,+1) which requires a
2100 maybe_add_safepoint(iter().next_get_dest()); 2100 maybe_add_safepoint(iter().next_get_dest());
2101 } 2101 }
2102 } 2102 }
2103 b = pop_pair(); 2103 b = pop_pair();
2104 a = pop_pair(); 2104 a = pop_pair();
2105 c = _gvn.transform( new (C, 3) CmpL3Node( a, b )); 2105 c = _gvn.transform( new (C) CmpL3Node( a, b ));
2106 push(c); 2106 push(c);
2107 break; 2107 break;
2108 2108
2109 case Bytecodes::_lneg: 2109 case Bytecodes::_lneg:
2110 a = pop_pair(); 2110 a = pop_pair();
2111 b = _gvn.transform( new (C, 3) SubLNode(longcon(0),a)); 2111 b = _gvn.transform( new (C) SubLNode(longcon(0),a));
2112 push_pair(b); 2112 push_pair(b);
2113 break; 2113 break;
2114 case Bytecodes::_l2i: 2114 case Bytecodes::_l2i:
2115 a = pop_pair(); 2115 a = pop_pair();
2116 push( _gvn.transform( new (C, 2) ConvL2INode(a))); 2116 push( _gvn.transform( new (C) ConvL2INode(a)));
2117 break; 2117 break;
2118 case Bytecodes::_i2l: 2118 case Bytecodes::_i2l:
2119 a = pop(); 2119 a = pop();
2120 b = _gvn.transform( new (C, 2) ConvI2LNode(a)); 2120 b = _gvn.transform( new (C) ConvI2LNode(a));
2121 push_pair(b); 2121 push_pair(b);
2122 break; 2122 break;
2123 case Bytecodes::_i2b: 2123 case Bytecodes::_i2b:
2124 // Sign extend 2124 // Sign extend
2125 a = pop(); 2125 a = pop();
2126 a = _gvn.transform( new (C, 3) LShiftINode(a,_gvn.intcon(24)) ); 2126 a = _gvn.transform( new (C) LShiftINode(a,_gvn.intcon(24)) );
2127 a = _gvn.transform( new (C, 3) RShiftINode(a,_gvn.intcon(24)) ); 2127 a = _gvn.transform( new (C) RShiftINode(a,_gvn.intcon(24)) );
2128 push( a ); 2128 push( a );
2129 break; 2129 break;
2130 case Bytecodes::_i2s: 2130 case Bytecodes::_i2s:
2131 a = pop(); 2131 a = pop();
2132 a = _gvn.transform( new (C, 3) LShiftINode(a,_gvn.intcon(16)) ); 2132 a = _gvn.transform( new (C) LShiftINode(a,_gvn.intcon(16)) );
2133 a = _gvn.transform( new (C, 3) RShiftINode(a,_gvn.intcon(16)) ); 2133 a = _gvn.transform( new (C) RShiftINode(a,_gvn.intcon(16)) );
2134 push( a ); 2134 push( a );
2135 break; 2135 break;
2136 case Bytecodes::_i2c: 2136 case Bytecodes::_i2c:
2137 a = pop(); 2137 a = pop();
2138 push( _gvn.transform( new (C, 3) AndINode(a,_gvn.intcon(0xFFFF)) ) ); 2138 push( _gvn.transform( new (C) AndINode(a,_gvn.intcon(0xFFFF)) ) );
2139 break; 2139 break;
2140 2140
2141 case Bytecodes::_i2f: 2141 case Bytecodes::_i2f:
2142 a = pop(); 2142 a = pop();
2143 b = _gvn.transform( new (C, 2) ConvI2FNode(a) ) ; 2143 b = _gvn.transform( new (C) ConvI2FNode(a) ) ;
2144 c = precision_rounding(b); 2144 c = precision_rounding(b);
2145 push (b); 2145 push (b);
2146 break; 2146 break;
2147 2147
2148 case Bytecodes::_i2d: 2148 case Bytecodes::_i2d:
2149 a = pop(); 2149 a = pop();
2150 b = _gvn.transform( new (C, 2) ConvI2DNode(a)); 2150 b = _gvn.transform( new (C) ConvI2DNode(a));
2151 push_pair(b); 2151 push_pair(b);
2152 break; 2152 break;
2153 2153
2154 case Bytecodes::_iinc: // Increment local 2154 case Bytecodes::_iinc: // Increment local
2155 i = iter().get_index(); // Get local index 2155 i = iter().get_index(); // Get local index
2156 set_local( i, _gvn.transform( new (C, 3) AddINode( _gvn.intcon(iter().get_iinc_con()), local(i) ) ) ); 2156 set_local( i, _gvn.transform( new (C) AddINode( _gvn.intcon(iter().get_iinc_con()), local(i) ) ) );
2157 break; 2157 break;
2158 2158
2159 // Exit points of synchronized methods must have an unlock node 2159 // Exit points of synchronized methods must have an unlock node
2160 case Bytecodes::_return: 2160 case Bytecodes::_return:
2161 return_current(NULL); 2161 return_current(NULL);
2223 handle_if_null: 2223 handle_if_null:
2224 // If this is a backwards branch in the bytecodes, add Safepoint 2224 // If this is a backwards branch in the bytecodes, add Safepoint
2225 maybe_add_safepoint(iter().get_dest()); 2225 maybe_add_safepoint(iter().get_dest());
2226 a = null(); 2226 a = null();
2227 b = pop(); 2227 b = pop();
2228 c = _gvn.transform( new (C, 3) CmpPNode(b, a) ); 2228 c = _gvn.transform( new (C) CmpPNode(b, a) );
2229 do_ifnull(btest, c); 2229 do_ifnull(btest, c);
2230 break; 2230 break;
2231 2231
2232 case Bytecodes::_if_acmpeq: btest = BoolTest::eq; goto handle_if_acmp; 2232 case Bytecodes::_if_acmpeq: btest = BoolTest::eq; goto handle_if_acmp;
2233 case Bytecodes::_if_acmpne: btest = BoolTest::ne; goto handle_if_acmp; 2233 case Bytecodes::_if_acmpne: btest = BoolTest::ne; goto handle_if_acmp;
2234 handle_if_acmp: 2234 handle_if_acmp:
2235 // If this is a backwards branch in the bytecodes, add Safepoint 2235 // If this is a backwards branch in the bytecodes, add Safepoint
2236 maybe_add_safepoint(iter().get_dest()); 2236 maybe_add_safepoint(iter().get_dest());
2237 a = pop(); 2237 a = pop();
2238 b = pop(); 2238 b = pop();
2239 c = _gvn.transform( new (C, 3) CmpPNode(b, a) ); 2239 c = _gvn.transform( new (C) CmpPNode(b, a) );
2240 do_if(btest, c); 2240 do_if(btest, c);
2241 break; 2241 break;
2242 2242
2243 case Bytecodes::_ifeq: btest = BoolTest::eq; goto handle_ifxx; 2243 case Bytecodes::_ifeq: btest = BoolTest::eq; goto handle_ifxx;
2244 case Bytecodes::_ifne: btest = BoolTest::ne; goto handle_ifxx; 2244 case Bytecodes::_ifne: btest = BoolTest::ne; goto handle_ifxx;
2249 handle_ifxx: 2249 handle_ifxx:
2250 // If this is a backwards branch in the bytecodes, add Safepoint 2250 // If this is a backwards branch in the bytecodes, add Safepoint
2251 maybe_add_safepoint(iter().get_dest()); 2251 maybe_add_safepoint(iter().get_dest());
2252 a = _gvn.intcon(0); 2252 a = _gvn.intcon(0);
2253 b = pop(); 2253 b = pop();
2254 c = _gvn.transform( new (C, 3) CmpINode(b, a) ); 2254 c = _gvn.transform( new (C) CmpINode(b, a) );
2255 do_if(btest, c); 2255 do_if(btest, c);
2256 break; 2256 break;
2257 2257
2258 case Bytecodes::_if_icmpeq: btest = BoolTest::eq; goto handle_if_icmp; 2258 case Bytecodes::_if_icmpeq: btest = BoolTest::eq; goto handle_if_icmp;
2259 case Bytecodes::_if_icmpne: btest = BoolTest::ne; goto handle_if_icmp; 2259 case Bytecodes::_if_icmpne: btest = BoolTest::ne; goto handle_if_icmp;
2264 handle_if_icmp: 2264 handle_if_icmp:
2265 // If this is a backwards branch in the bytecodes, add Safepoint 2265 // If this is a backwards branch in the bytecodes, add Safepoint
2266 maybe_add_safepoint(iter().get_dest()); 2266 maybe_add_safepoint(iter().get_dest());
2267 a = pop(); 2267 a = pop();
2268 b = pop(); 2268 b = pop();
2269 c = _gvn.transform( new (C, 3) CmpINode( b, a ) ); 2269 c = _gvn.transform( new (C) CmpINode( b, a ) );
2270 do_if(btest, c); 2270 do_if(btest, c);
2271 break; 2271 break;
2272 2272
2273 case Bytecodes::_tableswitch: 2273 case Bytecodes::_tableswitch:
2274 do_tableswitch(); 2274 do_tableswitch();