comparison src/share/vm/opto/callGenerator.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 a3ecd773a7b9
comparison
equal deleted inserted replaced
6803:06f52c4d0e18 6804:e626685e9f6c
132 132
133 if (kit.C->log() != NULL) { 133 if (kit.C->log() != NULL) {
134 kit.C->log()->elem("direct_call bci='%d'", jvms->bci()); 134 kit.C->log()->elem("direct_call bci='%d'", jvms->bci());
135 } 135 }
136 136
137 CallStaticJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallStaticJavaNode(tf(), target, method(), kit.bci()); 137 CallStaticJavaNode *call = new (kit.C) CallStaticJavaNode(tf(), target, method(), kit.bci());
138 _call_node = call; // Save the call node in case we need it later 138 _call_node = call; // Save the call node in case we need it later
139 if (!is_static) { 139 if (!is_static) {
140 // Make an explicit receiver null_check as part of this call. 140 // Make an explicit receiver null_check as part of this call.
141 // Since we share a map with the caller, his JVMS gets adjusted. 141 // Since we share a map with the caller, his JVMS gets adjusted.
142 kit.null_check_receiver(method()); 142 kit.null_check_receiver(method());
219 assert(!method()->is_private(), "virtual call should not be to private"); 219 assert(!method()->is_private(), "virtual call should not be to private");
220 assert(_vtable_index == Method::invalid_vtable_index || !UseInlineCaches, 220 assert(_vtable_index == Method::invalid_vtable_index || !UseInlineCaches,
221 "no vtable calls if +UseInlineCaches "); 221 "no vtable calls if +UseInlineCaches ");
222 address target = SharedRuntime::get_resolve_virtual_call_stub(); 222 address target = SharedRuntime::get_resolve_virtual_call_stub();
223 // Normal inline cache used for call 223 // Normal inline cache used for call
224 CallDynamicJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci()); 224 CallDynamicJavaNode *call = new (kit.C) CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci());
225 kit.set_arguments_for_java_call(call); 225 kit.set_arguments_for_java_call(call);
226 kit.set_edges_for_java_call(call); 226 kit.set_edges_for_java_call(call);
227 Node* ret = kit.set_results_for_java_call(call); 227 Node* ret = kit.set_results_for_java_call(call);
228 kit.push_node(method()->return_type()->basic_type(), ret); 228 kit.push_node(method()->return_type()->basic_type(), ret);
229 229
298 298
299 // Make a clone of the JVMState that appropriate to use for driving a parse 299 // Make a clone of the JVMState that appropriate to use for driving a parse
300 Compile* C = Compile::current(); 300 Compile* C = Compile::current();
301 JVMState* jvms = call->jvms()->clone_shallow(C); 301 JVMState* jvms = call->jvms()->clone_shallow(C);
302 uint size = call->req(); 302 uint size = call->req();
303 SafePointNode* map = new (C, size) SafePointNode(size, jvms); 303 SafePointNode* map = new (C) SafePointNode(size, jvms);
304 for (uint i1 = 0; i1 < size; i1++) { 304 for (uint i1 = 0; i1 < size; i1++) {
305 map->init_req(i1, call->in(i1)); 305 map->init_req(i1, call->in(i1));
306 } 306 }
307 307
308 // Make sure the state is a MergeMem for parsing. 308 // Make sure the state is a MergeMem for parsing.
549 return kit.transfer_exceptions_into_jvms(); 549 return kit.transfer_exceptions_into_jvms();
550 } 550 }
551 551
552 // Finish the diamond. 552 // Finish the diamond.
553 kit.C->set_has_split_ifs(true); // Has chance for split-if optimization 553 kit.C->set_has_split_ifs(true); // Has chance for split-if optimization
554 RegionNode* region = new (kit.C, 3) RegionNode(3); 554 RegionNode* region = new (kit.C) RegionNode(3);
555 region->init_req(1, kit.control()); 555 region->init_req(1, kit.control());
556 region->init_req(2, slow_map->control()); 556 region->init_req(2, slow_map->control());
557 kit.set_control(gvn.transform(region)); 557 kit.set_control(gvn.transform(region));
558 Node* iophi = PhiNode::make(region, kit.i_o(), Type::ABIO); 558 Node* iophi = PhiNode::make(region, kit.i_o(), Type::ABIO);
559 iophi->set_req(2, slow_map->i_o()); 559 iophi->set_req(2, slow_map->i_o());
634 if (!target->is_static()) { 634 if (!target->is_static()) {
635 Node* arg = kit.argument(0); 635 Node* arg = kit.argument(0);
636 const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr(); 636 const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr();
637 const Type* sig_type = TypeOopPtr::make_from_klass(signature->accessing_klass()); 637 const Type* sig_type = TypeOopPtr::make_from_klass(signature->accessing_klass());
638 if (arg_type != NULL && !arg_type->higher_equal(sig_type)) { 638 if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
639 Node* cast_obj = gvn.transform(new (C, 2) CheckCastPPNode(kit.control(), arg, sig_type)); 639 Node* cast_obj = gvn.transform(new (C) CheckCastPPNode(kit.control(), arg, sig_type));
640 kit.set_argument(0, cast_obj); 640 kit.set_argument(0, cast_obj);
641 } 641 }
642 } 642 }
643 // Cast reference arguments to its type. 643 // Cast reference arguments to its type.
644 for (int i = 0; i < signature->count(); i++) { 644 for (int i = 0; i < signature->count(); i++) {
646 if (t->is_klass()) { 646 if (t->is_klass()) {
647 Node* arg = kit.argument(receiver_skip + i); 647 Node* arg = kit.argument(receiver_skip + i);
648 const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr(); 648 const TypeOopPtr* arg_type = arg->bottom_type()->isa_oopptr();
649 const Type* sig_type = TypeOopPtr::make_from_klass(t->as_klass()); 649 const Type* sig_type = TypeOopPtr::make_from_klass(t->as_klass());
650 if (arg_type != NULL && !arg_type->higher_equal(sig_type)) { 650 if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
651 Node* cast_obj = gvn.transform(new (C, 2) CheckCastPPNode(kit.control(), arg, sig_type)); 651 Node* cast_obj = gvn.transform(new (C) CheckCastPPNode(kit.control(), arg, sig_type));
652 kit.set_argument(receiver_skip + i, cast_obj); 652 kit.set_argument(receiver_skip + i, cast_obj);
653 } 653 }
654 } 654 }
655 } 655 }
656 const int vtable_index = Method::invalid_vtable_index; 656 const int vtable_index = Method::invalid_vtable_index;