Mercurial > hg > graal-jvmci-8
comparison src/share/vm/interpreter/interpreter.cpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | a03f3fd16b22 1d7922586cf6 |
children | e522a00b91aa 8c5333c80cfd |
comparison
equal
deleted
inserted
replaced
5891:fd8832ae511d | 6275:957c266d8bc5 |
---|---|
35 #include "oops/methodDataOop.hpp" | 35 #include "oops/methodDataOop.hpp" |
36 #include "oops/methodOop.hpp" | 36 #include "oops/methodOop.hpp" |
37 #include "oops/oop.inline.hpp" | 37 #include "oops/oop.inline.hpp" |
38 #include "prims/forte.hpp" | 38 #include "prims/forte.hpp" |
39 #include "prims/jvmtiExport.hpp" | 39 #include "prims/jvmtiExport.hpp" |
40 #include "prims/methodHandles.hpp" | |
40 #include "runtime/handles.inline.hpp" | 41 #include "runtime/handles.inline.hpp" |
41 #include "runtime/sharedRuntime.hpp" | 42 #include "runtime/sharedRuntime.hpp" |
42 #include "runtime/stubRoutines.hpp" | 43 #include "runtime/stubRoutines.hpp" |
43 #include "runtime/timer.hpp" | 44 #include "runtime/timer.hpp" |
44 | 45 |
178 | 179 |
179 AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { | 180 AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { |
180 // Abstract method? | 181 // Abstract method? |
181 if (m->is_abstract()) return abstract; | 182 if (m->is_abstract()) return abstract; |
182 | 183 |
183 // Invoker for method handles? | 184 // Method handle primitive? |
184 if (m->is_method_handle_invoke()) return method_handle; | 185 if (m->is_method_handle_intrinsic()) { |
186 vmIntrinsics::ID id = m->intrinsic_id(); | |
187 assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic"); | |
188 MethodKind kind = (MethodKind)( method_handle_invoke_FIRST + | |
189 ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) ); | |
190 assert(kind <= method_handle_invoke_LAST, "parallel enum ranges"); | |
191 return kind; | |
192 } | |
185 | 193 |
186 // Native method? | 194 // Native method? |
187 // Note: This test must come _before_ the test for intrinsic | 195 // Note: This test must come _before_ the test for intrinsic |
188 // methods. See also comments below. | 196 // methods. See also comments below. |
189 if (m->is_native()) { | 197 if (m->is_native()) { |
190 assert(!m->is_method_handle_invoke(), "overlapping bits here, watch out"); | 198 assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out"); |
191 return m->is_synchronized() ? native_synchronized : native; | 199 return m->is_synchronized() ? native_synchronized : native; |
192 } | 200 } |
193 | 201 |
194 // Synchronized? | 202 // Synchronized? |
195 if (m->is_synchronized()) { | 203 if (m->is_synchronized()) { |
219 case vmIntrinsics::_dtan : return java_lang_math_tan ; | 227 case vmIntrinsics::_dtan : return java_lang_math_tan ; |
220 case vmIntrinsics::_dabs : return java_lang_math_abs ; | 228 case vmIntrinsics::_dabs : return java_lang_math_abs ; |
221 case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ; | 229 case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ; |
222 case vmIntrinsics::_dlog : return java_lang_math_log ; | 230 case vmIntrinsics::_dlog : return java_lang_math_log ; |
223 case vmIntrinsics::_dlog10: return java_lang_math_log10; | 231 case vmIntrinsics::_dlog10: return java_lang_math_log10; |
232 case vmIntrinsics::_dpow : return java_lang_math_pow ; | |
233 case vmIntrinsics::_dexp : return java_lang_math_exp ; | |
224 | 234 |
225 case vmIntrinsics::_Reference_get: | 235 case vmIntrinsics::_Reference_get: |
226 return java_lang_ref_reference_get; | 236 return java_lang_ref_reference_get; |
227 } | 237 } |
228 | 238 |
232 return accessor; | 242 return accessor; |
233 } | 243 } |
234 | 244 |
235 // Note: for now: zero locals for all non-empty methods | 245 // Note: for now: zero locals for all non-empty methods |
236 return zerolocals; | 246 return zerolocals; |
247 } | |
248 | |
249 | |
250 void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) { | |
251 assert(kind >= method_handle_invoke_FIRST && | |
252 kind <= method_handle_invoke_LAST, "late initialization only for MH entry points"); | |
253 assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry"); | |
254 _entry_table[kind] = entry; | |
237 } | 255 } |
238 | 256 |
239 | 257 |
240 // Return true if the interpreter can prove that the given bytecode has | 258 // Return true if the interpreter can prove that the given bytecode has |
241 // not yet been executed (in Java semantics, not in actual operation). | 259 // not yet been executed (in Java semantics, not in actual operation). |
266 case native : tty->print("native" ); break; | 284 case native : tty->print("native" ); break; |
267 case native_synchronized : tty->print("native_synchronized" ); break; | 285 case native_synchronized : tty->print("native_synchronized" ); break; |
268 case empty : tty->print("empty" ); break; | 286 case empty : tty->print("empty" ); break; |
269 case accessor : tty->print("accessor" ); break; | 287 case accessor : tty->print("accessor" ); break; |
270 case abstract : tty->print("abstract" ); break; | 288 case abstract : tty->print("abstract" ); break; |
271 case method_handle : tty->print("method_handle" ); break; | |
272 case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; | 289 case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; |
273 case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; | 290 case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; |
274 case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; | 291 case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; |
275 case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; | 292 case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; |
276 case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; | 293 case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; |
277 case java_lang_math_log : tty->print("java_lang_math_log" ); break; | 294 case java_lang_math_log : tty->print("java_lang_math_log" ); break; |
278 case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; | 295 case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; |
279 default : ShouldNotReachHere(); | 296 default: |
297 if (kind >= method_handle_invoke_FIRST && | |
298 kind <= method_handle_invoke_LAST) { | |
299 const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind)); | |
300 if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact' | |
301 tty->print("method_handle_%s", kind_name); | |
302 break; | |
303 } | |
304 ShouldNotReachHere(); | |
305 break; | |
280 } | 306 } |
281 } | 307 } |
282 #endif // PRODUCT | 308 #endif // PRODUCT |
283 | 309 |
284 | 310 |