comparison src/share/vm/opto/callGenerator.cpp @ 7194:beebba0acc11

7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop() Reviewed-by: kvn, jrose
author twisti
date Mon, 26 Nov 2012 17:25:11 -0800
parents a3ecd773a7b9
children ad5dd04754ee
comparison
equal deleted inserted replaced
7193:ee32440febeb 7194:beebba0acc11
137 CallStaticJavaNode *call = new (kit.C) 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_before_call(method());
143 if (kit.stopped()) { 143 if (kit.stopped()) {
144 // And dump it back to the caller, decorated with any exceptions: 144 // And dump it back to the caller, decorated with any exceptions:
145 return kit.transfer_exceptions_into_jvms(); 145 return kit.transfer_exceptions_into_jvms();
146 } 146 }
147 // Mark the call node as virtual, sort of: 147 // Mark the call node as virtual, sort of:
205 ((ImplicitNullCheckThreshold > 0) && caller_md && 205 ((ImplicitNullCheckThreshold > 0) && caller_md &&
206 (caller_md->trap_count(Deoptimization::Reason_null_check) 206 (caller_md->trap_count(Deoptimization::Reason_null_check)
207 >= (uint)ImplicitNullCheckThreshold))) { 207 >= (uint)ImplicitNullCheckThreshold))) {
208 // Make an explicit receiver null_check as part of this call. 208 // Make an explicit receiver null_check as part of this call.
209 // Since we share a map with the caller, his JVMS gets adjusted. 209 // Since we share a map with the caller, his JVMS gets adjusted.
210 receiver = kit.null_check_receiver(method()); 210 receiver = kit.null_check_receiver_before_call(method());
211 if (kit.stopped()) { 211 if (kit.stopped()) {
212 // And dump it back to the caller, decorated with any exceptions: 212 // And dump it back to the caller, decorated with any exceptions:
213 return kit.transfer_exceptions_into_jvms(); 213 return kit.transfer_exceptions_into_jvms();
214 } 214 }
215 } 215 }
489 if (log != NULL) { 489 if (log != NULL) {
490 log->elem("predicted_call bci='%d' klass='%d'", 490 log->elem("predicted_call bci='%d' klass='%d'",
491 jvms->bci(), log->identify(_predicted_receiver)); 491 jvms->bci(), log->identify(_predicted_receiver));
492 } 492 }
493 493
494 receiver = kit.null_check_receiver(method()); 494 receiver = kit.null_check_receiver_before_call(method());
495 if (kit.stopped()) { 495 if (kit.stopped()) {
496 return kit.transfer_exceptions_into_jvms(); 496 return kit.transfer_exceptions_into_jvms();
497 } 497 }
498 498
499 Node* exact_receiver = receiver; // will get updated in place... 499 Node* exact_receiver = receiver; // will get updated in place...
595 Compile* C = kit.C; 595 Compile* C = kit.C;
596 vmIntrinsics::ID iid = callee->intrinsic_id(); 596 vmIntrinsics::ID iid = callee->intrinsic_id();
597 switch (iid) { 597 switch (iid) {
598 case vmIntrinsics::_invokeBasic: 598 case vmIntrinsics::_invokeBasic:
599 { 599 {
600 // get MethodHandle receiver 600 // Get MethodHandle receiver:
601 Node* receiver = kit.argument(0); 601 Node* receiver = kit.argument(0);
602 if (receiver->Opcode() == Op_ConP) { 602 if (receiver->Opcode() == Op_ConP) {
603 const TypeOopPtr* oop_ptr = receiver->bottom_type()->is_oopptr(); 603 const TypeOopPtr* oop_ptr = receiver->bottom_type()->is_oopptr();
604 ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget(); 604 ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget();
605 guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove 605 guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove
616 case vmIntrinsics::_linkToVirtual: 616 case vmIntrinsics::_linkToVirtual:
617 case vmIntrinsics::_linkToStatic: 617 case vmIntrinsics::_linkToStatic:
618 case vmIntrinsics::_linkToSpecial: 618 case vmIntrinsics::_linkToSpecial:
619 case vmIntrinsics::_linkToInterface: 619 case vmIntrinsics::_linkToInterface:
620 { 620 {
621 // pop MemberName argument 621 // Get MemberName argument:
622 Node* member_name = kit.argument(callee->arg_size() - 1); 622 Node* member_name = kit.argument(callee->arg_size() - 1);
623 if (member_name->Opcode() == Op_ConP) { 623 if (member_name->Opcode() == Op_ConP) {
624 const TypeOopPtr* oop_ptr = member_name->bottom_type()->is_oopptr(); 624 const TypeOopPtr* oop_ptr = member_name->bottom_type()->is_oopptr();
625 ciMethod* target = oop_ptr->const_oop()->as_member_name()->get_vmtarget(); 625 ciMethod* target = oop_ptr->const_oop()->as_member_name()->get_vmtarget();
626 626