23 */ |
23 */ |
24 |
24 |
25 #ifndef SHARE_VM_OPTO_CALLGENERATOR_HPP |
25 #ifndef SHARE_VM_OPTO_CALLGENERATOR_HPP |
26 #define SHARE_VM_OPTO_CALLGENERATOR_HPP |
26 #define SHARE_VM_OPTO_CALLGENERATOR_HPP |
27 |
27 |
|
28 #include "compiler/compileBroker.hpp" |
28 #include "opto/callnode.hpp" |
29 #include "opto/callnode.hpp" |
29 #include "opto/compile.hpp" |
30 #include "opto/compile.hpp" |
30 #include "opto/type.hpp" |
31 #include "opto/type.hpp" |
31 #include "runtime/deoptimization.hpp" |
32 #include "runtime/deoptimization.hpp" |
32 |
33 |
109 // How to generate vanilla out-of-line call sites: |
110 // How to generate vanilla out-of-line call sites: |
110 static CallGenerator* for_direct_call(ciMethod* m, bool separate_io_projs = false); // static, special |
111 static CallGenerator* for_direct_call(ciMethod* m, bool separate_io_projs = false); // static, special |
111 static CallGenerator* for_virtual_call(ciMethod* m, int vtable_index); // virtual, interface |
112 static CallGenerator* for_virtual_call(ciMethod* m, int vtable_index); // virtual, interface |
112 static CallGenerator* for_dynamic_call(ciMethod* m); // invokedynamic |
113 static CallGenerator* for_dynamic_call(ciMethod* m); // invokedynamic |
113 |
114 |
114 static CallGenerator* for_method_handle_call(Node* method_handle, JVMState* jvms, ciMethod* caller, ciMethod* callee, ciCallProfile profile); |
115 static CallGenerator* for_method_handle_call( JVMState* jvms, ciMethod* caller, ciMethod* callee); |
115 static CallGenerator* for_invokedynamic_call( JVMState* jvms, ciMethod* caller, ciMethod* callee, ciCallProfile profile); |
116 static CallGenerator* for_method_handle_inline(JVMState* jvms, ciMethod* caller, ciMethod* callee); |
116 |
|
117 static CallGenerator* for_method_handle_inline(Node* method_handle, JVMState* jvms, ciMethod* caller, ciMethod* callee, ciCallProfile profile); |
|
118 static CallGenerator* for_invokedynamic_inline(ciCallSite* call_site, JVMState* jvms, ciMethod* caller, ciMethod* callee, ciCallProfile profile); |
|
119 |
117 |
120 // How to generate a replace a direct call with an inline version |
118 // How to generate a replace a direct call with an inline version |
121 static CallGenerator* for_late_inline(ciMethod* m, CallGenerator* inline_cg); |
119 static CallGenerator* for_late_inline(ciMethod* m, CallGenerator* inline_cg); |
122 |
120 |
123 // How to make a call but defer the decision whether to inline or not. |
121 // How to make a call but defer the decision whether to inline or not. |
143 Deoptimization::DeoptAction action); |
141 Deoptimization::DeoptAction action); |
144 |
142 |
145 // Registry for intrinsics: |
143 // Registry for intrinsics: |
146 static CallGenerator* for_intrinsic(ciMethod* m); |
144 static CallGenerator* for_intrinsic(ciMethod* m); |
147 static void register_intrinsic(ciMethod* m, CallGenerator* cg); |
145 static void register_intrinsic(ciMethod* m, CallGenerator* cg); |
|
146 |
|
147 static void print_inlining(ciMethod* callee, int inline_level, int bci, const char* msg) { |
|
148 if (PrintInlining) |
|
149 CompileTask::print_inlining(callee, inline_level, bci, msg); |
|
150 } |
148 }; |
151 }; |
149 |
152 |
|
153 |
|
154 //------------------------InlineCallGenerator---------------------------------- |
150 class InlineCallGenerator : public CallGenerator { |
155 class InlineCallGenerator : public CallGenerator { |
|
156 protected: |
|
157 InlineCallGenerator(ciMethod* method) : CallGenerator(method) {} |
|
158 |
|
159 public: |
151 virtual bool is_inline() const { return true; } |
160 virtual bool is_inline() const { return true; } |
152 |
|
153 protected: |
|
154 InlineCallGenerator(ciMethod* method) : CallGenerator(method) { } |
|
155 }; |
161 }; |
156 |
162 |
157 |
163 |
158 //---------------------------WarmCallInfo-------------------------------------- |
164 //---------------------------WarmCallInfo-------------------------------------- |
159 // A struct to collect information about a given call site. |
165 // A struct to collect information about a given call site. |