Mercurial > hg > graal-compiler
comparison src/share/vm/interpreter/interpreter.cpp @ 710:e5b0439ef4ae
6655638: dynamic languages need method handles
Summary: initial implementation, with known omissions (x86/64, sparc, compiler optim., c-oops, C++ interp.)
Reviewed-by: kvn, twisti, never
author | jrose |
---|---|
date | Wed, 08 Apr 2009 10:56:49 -0700 |
parents | a61af66fc99e |
children | 9987d9d5eb0e |
comparison
equal
deleted
inserted
replaced
709:1d037ecd7960 | 710:e5b0439ef4ae |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
166 | 166 |
167 AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { | 167 AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { |
168 // Abstract method? | 168 // Abstract method? |
169 if (m->is_abstract()) return abstract; | 169 if (m->is_abstract()) return abstract; |
170 | 170 |
171 // Invoker for method handles? | |
172 if (m->is_method_handle_invoke()) return method_handle; | |
173 | |
171 // Native method? | 174 // Native method? |
172 // Note: This test must come _before_ the test for intrinsic | 175 // Note: This test must come _before_ the test for intrinsic |
173 // methods. See also comments below. | 176 // methods. See also comments below. |
174 if (m->is_native()) { | 177 if (m->is_native()) { |
178 assert(!m->is_method_handle_invoke(), "overlapping bits here, watch out"); | |
175 return m->is_synchronized() ? native_synchronized : native; | 179 return m->is_synchronized() ? native_synchronized : native; |
176 } | 180 } |
177 | 181 |
178 // Synchronized? | 182 // Synchronized? |
179 if (m->is_synchronized()) { | 183 if (m->is_synchronized()) { |
247 case native : tty->print("native" ); break; | 251 case native : tty->print("native" ); break; |
248 case native_synchronized : tty->print("native_synchronized" ); break; | 252 case native_synchronized : tty->print("native_synchronized" ); break; |
249 case empty : tty->print("empty" ); break; | 253 case empty : tty->print("empty" ); break; |
250 case accessor : tty->print("accessor" ); break; | 254 case accessor : tty->print("accessor" ); break; |
251 case abstract : tty->print("abstract" ); break; | 255 case abstract : tty->print("abstract" ); break; |
256 case method_handle : tty->print("method_handle" ); break; | |
252 case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; | 257 case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; |
253 case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; | 258 case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; |
254 case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; | 259 case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; |
255 case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; | 260 case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; |
256 case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; | 261 case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; |