Mercurial > hg > truffle
diff src/share/vm/runtime/sharedRuntime.cpp @ 1793:d257356e35f0
6939224: MethodHandle.invokeGeneric needs to perform the correct set of conversions
Reviewed-by: never
author | jrose |
---|---|
date | Mon, 13 Sep 2010 23:24:30 -0700 |
parents | 3e8fbc61cee8 |
children | 3dc12ef8735e |
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.cpp Mon Sep 13 16:45:00 2010 -0700 +++ b/src/share/vm/runtime/sharedRuntime.cpp Mon Sep 13 23:24:30 2010 -0700 @@ -1633,8 +1633,13 @@ char* SharedRuntime::generate_wrong_method_type_message(JavaThread* thread, oopDesc* required, oopDesc* actual) { + if (TraceMethodHandles) { + tty->print_cr("WrongMethodType thread="PTR_FORMAT" req="PTR_FORMAT" act="PTR_FORMAT"", + thread, required, actual); + } assert(EnableMethodHandles, ""); oop singleKlass = wrong_method_type_is_for_single_argument(thread, required); + char* message = NULL; if (singleKlass != NULL) { const char* objName = "argument or return value"; if (actual != NULL) { @@ -1647,7 +1652,7 @@ Klass* targetKlass = Klass::cast(required->is_klass() ? (klassOop)required : java_lang_Class::as_klassOop(required)); - return generate_class_cast_message(objName, targetKlass->external_name()); + message = generate_class_cast_message(objName, targetKlass->external_name()); } else { // %%% need to get the MethodType string, without messing around too much // Get a signature from the invoke instruction @@ -1679,9 +1684,13 @@ if (mhName[0] == '$') mhName = actual_method->signature()->as_C_string(); } - return generate_class_cast_message(mhName, targetType, - " cannot be called as "); + message = generate_class_cast_message(mhName, targetType, + " cannot be called as "); } + if (TraceMethodHandles) { + tty->print_cr("WrongMethodType => message=%s", message); + } + return message; } oop SharedRuntime::wrong_method_type_is_for_single_argument(JavaThread* thr,