Mercurial > hg > graal-jvmci-8
diff src/share/vm/runtime/sharedRuntime.hpp @ 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 | c89f86385056 |
children | 45463a04ca27 |
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.hpp Wed Apr 08 00:12:59 2009 -0700 +++ b/src/share/vm/runtime/sharedRuntime.hpp Wed Apr 08 10:56:49 2009 -0700 @@ -212,10 +212,32 @@ static char* generate_class_cast_message(JavaThread* thr, const char* name); /** + * Fill in the message for a WrongMethodTypeException + * + * @param thr the current thread + * @param mtype (optional) expected method type (or argument class) + * @param mhandle (optional) actual method handle (or argument) + * @return the dynamically allocated exception message + * + * BCP for the frame on top of the stack must refer to an + * 'invokevirtual' op for a method handle, or an 'invokedyamic' op. + * The caller (or one of its callers) must use a ResourceMark + * in order to correctly free the result. + */ + static char* generate_wrong_method_type_message(JavaThread* thr, + oopDesc* mtype = NULL, + oopDesc* mhandle = NULL); + + /** Return non-null if the mtype is a klass or Class, not a MethodType. */ + static oop wrong_method_type_is_for_single_argument(JavaThread* thr, + oopDesc* mtype); + + /** * Fill in the "X cannot be cast to a Y" message for ClassCastException * * @param name the name of the class of the object attempted to be cast * @param klass the name of the target klass attempt + * @param gripe the specific kind of problem being reported * @return the dynamically allocated exception message (must be freed * by the caller using a resource mark) * @@ -224,7 +246,8 @@ * The caller (or one of it's callers) must use a ResourceMark * in order to correctly free the result. */ - static char* generate_class_cast_message(const char* name, const char* klass); + static char* generate_class_cast_message(const char* name, const char* klass, + const char* gripe = " cannot be cast to "); // Resolves a call site- may patch in the destination of the call into the // compiled code.