mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 06:14:49 +02:00
6655638: dynamic languages need method handles
Initial implementation, with known omissions (x86/64, sparc, compiler optim., c-oops, C++ interp.) Reviewed-by: kvn, twisti, never
This commit is contained in:
parent
318da3f68c
commit
ce0c084720
63 changed files with 5815 additions and 70 deletions
|
@ -211,11 +211,33 @@ class SharedRuntime: AllStatic {
|
|||
*/
|
||||
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 @@ class SharedRuntime: AllStatic {
|
|||
* 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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue