changeset 10921:3b56bf6b0bcb

8155258: VarHandle implementation improvements Summary: Relax return type check for call to linked method handle invocation Reviewed-by: shade, vlivanov
author psandoz
date Thu, 05 May 2016 11:39:23 -0700
parents 9123de996cb5
children 7e27d7c1c58a
files src/share/vm/opto/doCall.cpp
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/doCall.cpp	Tue May 03 09:09:20 2016 +0100
+++ b/src/share/vm/opto/doCall.cpp	Thu May 05 11:39:23 2016 -0700
@@ -415,8 +415,12 @@
   if (symbolic_info->arg_size() != (resolved_method->arg_size() + has_appendix)) {
     return false; // Total size of arguments on stack mismatch.
   }
-  if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) {
-    return false; // Return value size or type mismatch encountered.
+  if (!symbolic_info->return_type()->is_void()) {
+    // Only check the return type if the symbolic method is not void
+    // i.e. the return value of the resolved method can be dropped
+    if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) {
+      return false; // Return value size or type mismatch encountered.
+    }
   }
 
   switch (symbolic_info->intrinsic_id()) {