Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/compile.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 | 7eca5de9e0b6 |
children | c3e799c37717 |
comparison
equal
deleted
inserted
replaced
6803:06f52c4d0e18 | 6804:e626685e9f6c |
---|---|
652 CallGenerator* cg = NULL; | 652 CallGenerator* cg = NULL; |
653 if (is_osr_compilation()) { | 653 if (is_osr_compilation()) { |
654 const TypeTuple *domain = StartOSRNode::osr_domain(); | 654 const TypeTuple *domain = StartOSRNode::osr_domain(); |
655 const TypeTuple *range = TypeTuple::make_range(method()->signature()); | 655 const TypeTuple *range = TypeTuple::make_range(method()->signature()); |
656 init_tf(TypeFunc::make(domain, range)); | 656 init_tf(TypeFunc::make(domain, range)); |
657 StartNode* s = new (this, 2) StartOSRNode(root(), domain); | 657 StartNode* s = new (this) StartOSRNode(root(), domain); |
658 initial_gvn()->set_type_bottom(s); | 658 initial_gvn()->set_type_bottom(s); |
659 init_start(s); | 659 init_start(s); |
660 cg = CallGenerator::for_osr(method(), entry_bci()); | 660 cg = CallGenerator::for_osr(method(), entry_bci()); |
661 } else { | 661 } else { |
662 // Normal case. | 662 // Normal case. |
663 init_tf(TypeFunc::make(method())); | 663 init_tf(TypeFunc::make(method())); |
664 StartNode* s = new (this, 2) StartNode(root(), tf()->domain()); | 664 StartNode* s = new (this) StartNode(root(), tf()->domain()); |
665 initial_gvn()->set_type_bottom(s); | 665 initial_gvn()->set_type_bottom(s); |
666 init_start(s); | 666 init_start(s); |
667 if (method()->intrinsic_id() == vmIntrinsics::_Reference_get && UseG1GC) { | 667 if (method()->intrinsic_id() == vmIntrinsics::_Reference_get && UseG1GC) { |
668 // With java.lang.ref.reference.get() we must go through the | 668 // With java.lang.ref.reference.get() we must go through the |
669 // intrinsic when G1 is enabled - even when get() is the root | 669 // intrinsic when G1 is enabled - even when get() is the root |
945 _immutable_memory = NULL; // filled in at first inquiry | 945 _immutable_memory = NULL; // filled in at first inquiry |
946 | 946 |
947 // Globally visible Nodes | 947 // Globally visible Nodes |
948 // First set TOP to NULL to give safe behavior during creation of RootNode | 948 // First set TOP to NULL to give safe behavior during creation of RootNode |
949 set_cached_top_node(NULL); | 949 set_cached_top_node(NULL); |
950 set_root(new (this, 3) RootNode()); | 950 set_root(new (this) RootNode()); |
951 // Now that you have a Root to point to, create the real TOP | 951 // Now that you have a Root to point to, create the real TOP |
952 set_cached_top_node( new (this, 1) ConNode(Type::TOP) ); | 952 set_cached_top_node( new (this) ConNode(Type::TOP) ); |
953 set_recent_alloc(NULL, NULL); | 953 set_recent_alloc(NULL, NULL); |
954 | 954 |
955 // Create Debug Information Recorder to record scopes, oopmaps, etc. | 955 // Create Debug Information Recorder to record scopes, oopmaps, etc. |
956 env()->set_oop_recorder(new OopRecorder(env()->arena())); | 956 env()->set_oop_recorder(new OopRecorder(env()->arena())); |
957 env()->set_debug_info(new DebugInformationRecorder(env()->oop_recorder())); | 957 env()->set_debug_info(new DebugInformationRecorder(env()->oop_recorder())); |
2343 } | 2343 } |
2344 } | 2344 } |
2345 if (nn != NULL) { | 2345 if (nn != NULL) { |
2346 // Decode a narrow oop to match address | 2346 // Decode a narrow oop to match address |
2347 // [R12 + narrow_oop_reg<<3 + offset] | 2347 // [R12 + narrow_oop_reg<<3 + offset] |
2348 nn = new (C, 2) DecodeNNode(nn, t); | 2348 nn = new (C) DecodeNNode(nn, t); |
2349 n->set_req(AddPNode::Base, nn); | 2349 n->set_req(AddPNode::Base, nn); |
2350 n->set_req(AddPNode::Address, nn); | 2350 n->set_req(AddPNode::Address, nn); |
2351 if (addp->outcnt() == 0) { | 2351 if (addp->outcnt() == 0) { |
2352 addp->disconnect_inputs(NULL); | 2352 addp->disconnect_inputs(NULL); |
2353 } | 2353 } |
2461 } else if (t->isa_oopptr()) { | 2461 } else if (t->isa_oopptr()) { |
2462 new_in2 = ConNode::make(C, t->make_narrowoop()); | 2462 new_in2 = ConNode::make(C, t->make_narrowoop()); |
2463 } | 2463 } |
2464 } | 2464 } |
2465 if (new_in2 != NULL) { | 2465 if (new_in2 != NULL) { |
2466 Node* cmpN = new (C, 3) CmpNNode(in1->in(1), new_in2); | 2466 Node* cmpN = new (C) CmpNNode(in1->in(1), new_in2); |
2467 n->subsume_by( cmpN ); | 2467 n->subsume_by( cmpN ); |
2468 if (in1->outcnt() == 0) { | 2468 if (in1->outcnt() == 0) { |
2469 in1->disconnect_inputs(NULL); | 2469 in1->disconnect_inputs(NULL); |
2470 } | 2470 } |
2471 if (in2->outcnt() == 0) { | 2471 if (in2->outcnt() == 0) { |
2557 DivModINode* divmod = DivModINode::make(C, n); | 2557 DivModINode* divmod = DivModINode::make(C, n); |
2558 d->subsume_by(divmod->div_proj()); | 2558 d->subsume_by(divmod->div_proj()); |
2559 n->subsume_by(divmod->mod_proj()); | 2559 n->subsume_by(divmod->mod_proj()); |
2560 } else { | 2560 } else { |
2561 // replace a%b with a-((a/b)*b) | 2561 // replace a%b with a-((a/b)*b) |
2562 Node* mult = new (C, 3) MulINode(d, d->in(2)); | 2562 Node* mult = new (C) MulINode(d, d->in(2)); |
2563 Node* sub = new (C, 3) SubINode(d->in(1), mult); | 2563 Node* sub = new (C) SubINode(d->in(1), mult); |
2564 n->subsume_by( sub ); | 2564 n->subsume_by( sub ); |
2565 } | 2565 } |
2566 } | 2566 } |
2567 } | 2567 } |
2568 break; | 2568 break; |
2578 DivModLNode* divmod = DivModLNode::make(C, n); | 2578 DivModLNode* divmod = DivModLNode::make(C, n); |
2579 d->subsume_by(divmod->div_proj()); | 2579 d->subsume_by(divmod->div_proj()); |
2580 n->subsume_by(divmod->mod_proj()); | 2580 n->subsume_by(divmod->mod_proj()); |
2581 } else { | 2581 } else { |
2582 // replace a%b with a-((a/b)*b) | 2582 // replace a%b with a-((a/b)*b) |
2583 Node* mult = new (C, 3) MulLNode(d, d->in(2)); | 2583 Node* mult = new (C) MulLNode(d, d->in(2)); |
2584 Node* sub = new (C, 3) SubLNode(d->in(1), mult); | 2584 Node* sub = new (C) SubLNode(d->in(1), mult); |
2585 n->subsume_by( sub ); | 2585 n->subsume_by( sub ); |
2586 } | 2586 } |
2587 } | 2587 } |
2588 } | 2588 } |
2589 break; | 2589 break; |
2630 n->set_req(2, ConNode::make(C, TypeInt::make(shift & mask))); | 2630 n->set_req(2, ConNode::make(C, TypeInt::make(shift & mask))); |
2631 } | 2631 } |
2632 } else { | 2632 } else { |
2633 if (t == NULL || t->_lo < 0 || t->_hi > (int)mask) { | 2633 if (t == NULL || t->_lo < 0 || t->_hi > (int)mask) { |
2634 Compile* C = Compile::current(); | 2634 Compile* C = Compile::current(); |
2635 Node* shift = new (C, 3) AndINode(in2, ConNode::make(C, TypeInt::make(mask))); | 2635 Node* shift = new (C) AndINode(in2, ConNode::make(C, TypeInt::make(mask))); |
2636 n->set_req(2, shift); | 2636 n->set_req(2, shift); |
2637 } | 2637 } |
2638 } | 2638 } |
2639 if (in2->outcnt() == 0) { // Remove dead node | 2639 if (in2->outcnt() == 0) { // Remove dead node |
2640 in2->disconnect_inputs(NULL); | 2640 in2->disconnect_inputs(NULL); |