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 #ifndef SHARE_VM_OPTO_CALLGENERATOR_HPP
26 #define SHARE_VM_OPTO_CALLGENERATOR_HPP
27
28 #include "compiler/compileBroker.hpp"
29 #include "opto/callnode.hpp"
30 #include "opto/compile.hpp"
31 #include "opto/type.hpp"
32 #include "runtime/deoptimization.hpp"
33
34 class Parse;
35
36 //---------------------------CallGenerator-------------------------------------
37 // The subclasses of this class handle generation of ideal nodes for
38 // call sites and method entry points.
39
40 class CallGenerator : public ResourceObj {
41 public:
42 enum {
43 xxxunusedxxx
44 };
45
46 private:
47 ciMethod* _method; // The method being called.
48
49 protected:
50 CallGenerator(ciMethod* method) : _method(method) {}
51
52 public:
53 // Accessors
54 ciMethod* method() const { return _method; }
55
97 // Edges after jvms->argoff() carry all (pre-popped) argument values.
98 //
99 // Update the map with state and return values (if any) and return it.
100 // The return values (0, 1, or 2) must be pushed on the map's stack,
101 // and the sp of the jvms incremented accordingly.
102 //
103 // The jvms is returned on success. Alternatively, a copy of the
104 // given jvms, suitably updated, may be returned, in which case the
105 // caller should discard the original jvms.
106 //
107 // The non-Parm edges of the returned map will contain updated global state,
108 // and one or two edges before jvms->sp() will carry any return values.
109 // Other map edges may contain locals or monitors, and should not
110 // be changed in meaning.
111 //
112 // If the call traps, the returned map must have a control edge of top.
113 // If the call can throw, the returned map must report has_exceptions().
114 //
115 // If the result is NULL, it means that this CallGenerator was unable
116 // to handle the given call, and another CallGenerator should be consulted.
117 virtual JVMState* generate(JVMState* jvms, Parse* parent_parser) = 0;
118
119 // How to generate a call site that is inlined:
120 static CallGenerator* for_inline(ciMethod* m, float expected_uses = -1);
121 // How to generate code for an on-stack replacement handler.
122 static CallGenerator* for_osr(ciMethod* m, int osr_bci);
123
124 // How to generate vanilla out-of-line call sites:
125 static CallGenerator* for_direct_call(ciMethod* m, bool separate_io_projs = false); // static, special
126 static CallGenerator* for_virtual_call(ciMethod* m, int vtable_index); // virtual, interface
127 static CallGenerator* for_dynamic_call(ciMethod* m); // invokedynamic
128
129 static CallGenerator* for_method_handle_call( JVMState* jvms, ciMethod* caller, ciMethod* callee, bool delayed_forbidden);
130 static CallGenerator* for_method_handle_inline(JVMState* jvms, ciMethod* caller, ciMethod* callee, bool& input_not_const);
131
132 // How to generate a replace a direct call with an inline version
133 static CallGenerator* for_late_inline(ciMethod* m, CallGenerator* inline_cg);
134 static CallGenerator* for_mh_late_inline(ciMethod* caller, ciMethod* callee, bool input_not_const);
135 static CallGenerator* for_string_late_inline(ciMethod* m, CallGenerator* inline_cg);
136 static CallGenerator* for_boxing_late_inline(ciMethod* m, CallGenerator* inline_cg);
137
|
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 #ifndef SHARE_VM_OPTO_CALLGENERATOR_HPP
26 #define SHARE_VM_OPTO_CALLGENERATOR_HPP
27
28 #include "compiler/compileBroker.hpp"
29 #include "opto/callnode.hpp"
30 #include "opto/compile.hpp"
31 #include "opto/type.hpp"
32 #include "runtime/deoptimization.hpp"
33
34 //---------------------------CallGenerator-------------------------------------
35 // The subclasses of this class handle generation of ideal nodes for
36 // call sites and method entry points.
37
38 class CallGenerator : public ResourceObj {
39 public:
40 enum {
41 xxxunusedxxx
42 };
43
44 private:
45 ciMethod* _method; // The method being called.
46
47 protected:
48 CallGenerator(ciMethod* method) : _method(method) {}
49
50 public:
51 // Accessors
52 ciMethod* method() const { return _method; }
53
95 // Edges after jvms->argoff() carry all (pre-popped) argument values.
96 //
97 // Update the map with state and return values (if any) and return it.
98 // The return values (0, 1, or 2) must be pushed on the map's stack,
99 // and the sp of the jvms incremented accordingly.
100 //
101 // The jvms is returned on success. Alternatively, a copy of the
102 // given jvms, suitably updated, may be returned, in which case the
103 // caller should discard the original jvms.
104 //
105 // The non-Parm edges of the returned map will contain updated global state,
106 // and one or two edges before jvms->sp() will carry any return values.
107 // Other map edges may contain locals or monitors, and should not
108 // be changed in meaning.
109 //
110 // If the call traps, the returned map must have a control edge of top.
111 // If the call can throw, the returned map must report has_exceptions().
112 //
113 // If the result is NULL, it means that this CallGenerator was unable
114 // to handle the given call, and another CallGenerator should be consulted.
115 virtual JVMState* generate(JVMState* jvms) = 0;
116
117 // How to generate a call site that is inlined:
118 static CallGenerator* for_inline(ciMethod* m, float expected_uses = -1);
119 // How to generate code for an on-stack replacement handler.
120 static CallGenerator* for_osr(ciMethod* m, int osr_bci);
121
122 // How to generate vanilla out-of-line call sites:
123 static CallGenerator* for_direct_call(ciMethod* m, bool separate_io_projs = false); // static, special
124 static CallGenerator* for_virtual_call(ciMethod* m, int vtable_index); // virtual, interface
125 static CallGenerator* for_dynamic_call(ciMethod* m); // invokedynamic
126
127 static CallGenerator* for_method_handle_call( JVMState* jvms, ciMethod* caller, ciMethod* callee, bool delayed_forbidden);
128 static CallGenerator* for_method_handle_inline(JVMState* jvms, ciMethod* caller, ciMethod* callee, bool& input_not_const);
129
130 // How to generate a replace a direct call with an inline version
131 static CallGenerator* for_late_inline(ciMethod* m, CallGenerator* inline_cg);
132 static CallGenerator* for_mh_late_inline(ciMethod* caller, ciMethod* callee, bool input_not_const);
133 static CallGenerator* for_string_late_inline(ciMethod* m, CallGenerator* inline_cg);
134 static CallGenerator* for_boxing_late_inline(ciMethod* m, CallGenerator* inline_cg);
135
|