< prev index next >

src/hotspot/share/opto/callnode.cpp

Print this page

   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "compiler/compileLog.hpp"
  27 #include "ci/bcEscapeAnalyzer.hpp"

  28 #include "compiler/oopMap.hpp"
  29 #include "gc/shared/barrierSet.hpp"
  30 #include "gc/shared/c2/barrierSetC2.hpp"
  31 #include "interpreter/interpreter.hpp"
  32 #include "opto/callGenerator.hpp"
  33 #include "opto/callnode.hpp"
  34 #include "opto/castnode.hpp"
  35 #include "opto/convertnode.hpp"
  36 #include "opto/escape.hpp"
  37 #include "opto/locknode.hpp"
  38 #include "opto/machnode.hpp"
  39 #include "opto/matcher.hpp"
  40 #include "opto/parse.hpp"
  41 #include "opto/regalloc.hpp"
  42 #include "opto/regmask.hpp"
  43 #include "opto/rootnode.hpp"
  44 #include "opto/runtime.hpp"
  45 #include "runtime/sharedRuntime.hpp"
  46 #include "utilities/powerOfTwo.hpp"
  47 #include "code/vmreg.hpp"

1066   CallStaticJavaNode &call = (CallStaticJavaNode&)n;
1067   return CallJavaNode::cmp(call);
1068 }
1069 
1070 Node* CallStaticJavaNode::Ideal(PhaseGVN* phase, bool can_reshape) {
1071   CallGenerator* cg = generator();
1072   if (can_reshape && cg != NULL) {
1073     assert(IncrementalInlineMH, "required");
1074     assert(cg->call_node() == this, "mismatch");
1075     assert(cg->is_mh_late_inline(), "not virtual");
1076 
1077     // Check whether this MH handle call becomes a candidate for inlining.
1078     ciMethod* callee = cg->method();
1079     vmIntrinsics::ID iid = callee->intrinsic_id();
1080     if (iid == vmIntrinsics::_invokeBasic) {
1081       if (in(TypeFunc::Parms)->Opcode() == Op_ConP) {
1082         phase->C->prepend_late_inline(cg);
1083         set_generator(NULL);
1084       }
1085     } else if (iid == vmIntrinsics::_linkToNative) {
1086       if (in(TypeFunc::Parms + callee->arg_size() - 1)->Opcode() == Op_ConP /* NEP */
1087           && in(TypeFunc::Parms + 1)->Opcode() == Op_ConL /* address */) {


1088         phase->C->prepend_late_inline(cg);
1089         set_generator(NULL);
1090       }
1091     } else {
1092       assert(callee->has_member_arg(), "wrong type of call?");
1093       if (in(TypeFunc::Parms + callee->arg_size() - 1)->Opcode() == Op_ConP) {
1094         phase->C->prepend_late_inline(cg);
1095         set_generator(NULL);
1096       }
1097     }
1098   }
1099   return CallNode::Ideal(phase, can_reshape);
1100 }
1101 
1102 //----------------------------uncommon_trap_request----------------------------
1103 // If this is an uncommon trap, return the request code, else zero.
1104 int CallStaticJavaNode::uncommon_trap_request() const {
1105   if (_name != NULL && !strcmp(_name, "uncommon_trap")) {
1106     return extract_uncommon_trap_request(this);
1107   }

   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "compiler/compileLog.hpp"
  27 #include "ci/bcEscapeAnalyzer.hpp"
  28 #include "ci/ciNativeEntryPoint.hpp"
  29 #include "compiler/oopMap.hpp"
  30 #include "gc/shared/barrierSet.hpp"
  31 #include "gc/shared/c2/barrierSetC2.hpp"
  32 #include "interpreter/interpreter.hpp"
  33 #include "opto/callGenerator.hpp"
  34 #include "opto/callnode.hpp"
  35 #include "opto/castnode.hpp"
  36 #include "opto/convertnode.hpp"
  37 #include "opto/escape.hpp"
  38 #include "opto/locknode.hpp"
  39 #include "opto/machnode.hpp"
  40 #include "opto/matcher.hpp"
  41 #include "opto/parse.hpp"
  42 #include "opto/regalloc.hpp"
  43 #include "opto/regmask.hpp"
  44 #include "opto/rootnode.hpp"
  45 #include "opto/runtime.hpp"
  46 #include "runtime/sharedRuntime.hpp"
  47 #include "utilities/powerOfTwo.hpp"
  48 #include "code/vmreg.hpp"

1067   CallStaticJavaNode &call = (CallStaticJavaNode&)n;
1068   return CallJavaNode::cmp(call);
1069 }
1070 
1071 Node* CallStaticJavaNode::Ideal(PhaseGVN* phase, bool can_reshape) {
1072   CallGenerator* cg = generator();
1073   if (can_reshape && cg != NULL) {
1074     assert(IncrementalInlineMH, "required");
1075     assert(cg->call_node() == this, "mismatch");
1076     assert(cg->is_mh_late_inline(), "not virtual");
1077 
1078     // Check whether this MH handle call becomes a candidate for inlining.
1079     ciMethod* callee = cg->method();
1080     vmIntrinsics::ID iid = callee->intrinsic_id();
1081     if (iid == vmIntrinsics::_invokeBasic) {
1082       if (in(TypeFunc::Parms)->Opcode() == Op_ConP) {
1083         phase->C->prepend_late_inline(cg);
1084         set_generator(NULL);
1085       }
1086     } else if (iid == vmIntrinsics::_linkToNative) {
1087       Node* nep_node = in(TypeFunc::Parms + callee->arg_size() - 1);
1088       if (nep_node->Opcode() == Op_ConP /* NEP */
1089           && in(TypeFunc::Parms + 0)->Opcode() == Op_ConL /* address */
1090           && !nep_node->bottom_type()->is_oopptr()->const_oop()->as_native_entry_point()->need_transition()) {
1091         phase->C->prepend_late_inline(cg);
1092         set_generator(NULL);
1093       }
1094     } else {
1095       assert(callee->has_member_arg(), "wrong type of call?");
1096       if (in(TypeFunc::Parms + callee->arg_size() - 1)->Opcode() == Op_ConP) {
1097         phase->C->prepend_late_inline(cg);
1098         set_generator(NULL);
1099       }
1100     }
1101   }
1102   return CallNode::Ideal(phase, can_reshape);
1103 }
1104 
1105 //----------------------------uncommon_trap_request----------------------------
1106 // If this is an uncommon trap, return the request code, else zero.
1107 int CallStaticJavaNode::uncommon_trap_request() const {
1108   if (_name != NULL && !strcmp(_name, "uncommon_trap")) {
1109     return extract_uncommon_trap_request(this);
1110   }
< prev index next >