1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
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 *
133 static MethodKind method_kind(methodHandle m);
134 static address entry_for_kind(MethodKind k) { assert(0 <= k && k < number_of_method_entries, "illegal kind"); return _entry_table[k]; }
135 static address entry_for_method(methodHandle m) { return entry_for_kind(method_kind(m)); }
136
137 static address entry_for_cds_method(methodHandle m) {
138 MethodKind k = method_kind(m);
139 assert(0 <= k && k < number_of_method_entries, "illegal kind");
140 return _cds_entry_table[k];
141 }
142
143 // used by class data sharing
144 static void update_cds_entry_table(MethodKind kind) NOT_CDS_RETURN;
145
146 static address get_trampoline_code_buffer(AbstractInterpreter::MethodKind kind) NOT_CDS_RETURN_(0);
147
148 // used for bootstrapping method handles:
149 static void set_entry_for_kind(MethodKind k, address e);
150
151 static void print_method_kind(MethodKind kind) PRODUCT_RETURN;
152
153 static bool can_be_compiled(methodHandle m);
154
155 // Runtime support
156
157 // length = invoke bytecode length (to advance to next bytecode)
158 static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; }
159 static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; }
160
161 static address rethrow_exception_entry() { return _rethrow_exception_entry; }
162
163 // Activation size in words for a method that is just being called.
164 // Parameters haven't been pushed so count them too.
165 static int size_top_interpreter_activation(Method* method);
166
167 // Deoptimization support
168 // Compute the entry address for continuation after
169 static address deopt_continue_after_entry(Method* method,
170 address bcp,
171 int callee_parameters,
172 bool is_top_frame);
173 // Compute the entry address for reexecution
|
1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
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 *
133 static MethodKind method_kind(methodHandle m);
134 static address entry_for_kind(MethodKind k) { assert(0 <= k && k < number_of_method_entries, "illegal kind"); return _entry_table[k]; }
135 static address entry_for_method(methodHandle m) { return entry_for_kind(method_kind(m)); }
136
137 static address entry_for_cds_method(methodHandle m) {
138 MethodKind k = method_kind(m);
139 assert(0 <= k && k < number_of_method_entries, "illegal kind");
140 return _cds_entry_table[k];
141 }
142
143 // used by class data sharing
144 static void update_cds_entry_table(MethodKind kind) NOT_CDS_RETURN;
145
146 static address get_trampoline_code_buffer(AbstractInterpreter::MethodKind kind) NOT_CDS_RETURN_(0);
147
148 // used for bootstrapping method handles:
149 static void set_entry_for_kind(MethodKind k, address e);
150
151 static void print_method_kind(MethodKind kind) PRODUCT_RETURN;
152
153 // These should never be compiled since the interpreter will prefer
154 // the compiled version to the intrinsic version.
155 static bool can_be_compiled(const methodHandle& m) {
156 switch (m->intrinsic_id()) {
157 case vmIntrinsics::_dsin : // fall thru
158 case vmIntrinsics::_dcos : // fall thru
159 case vmIntrinsics::_dtan : // fall thru
160 case vmIntrinsics::_dabs : // fall thru
161 case vmIntrinsics::_dsqrt : // fall thru
162 case vmIntrinsics::_dlog : // fall thru
163 case vmIntrinsics::_dlog10: // fall thru
164 case vmIntrinsics::_dpow : // fall thru
165 case vmIntrinsics::_dexp : // fall thru
166 case vmIntrinsics::_fmaD : // fall thru
167 case vmIntrinsics::_fmaF : // fall thru
168 return false;
169 default:
170 return true;
171 }
172 }
173
174 // Runtime support
175
176 // length = invoke bytecode length (to advance to next bytecode)
177 static address deopt_entry(TosState state, int length) { ShouldNotReachHere(); return NULL; }
178 static address return_entry(TosState state, int length, Bytecodes::Code code) { ShouldNotReachHere(); return NULL; }
179
180 static address rethrow_exception_entry() { return _rethrow_exception_entry; }
181
182 // Activation size in words for a method that is just being called.
183 // Parameters haven't been pushed so count them too.
184 static int size_top_interpreter_activation(Method* method);
185
186 // Deoptimization support
187 // Compute the entry address for continuation after
188 static address deopt_continue_after_entry(Method* method,
189 address bcp,
190 int callee_parameters,
191 bool is_top_frame);
192 // Compute the entry address for reexecution
|