United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7167406 (Zero) Fix for InvokeDynamic needed
JDK-7167406 : (Zero) Fix for InvokeDynamic needed

Details
Type:
Bug
Submit Date:
2012-05-09
Status:
Closed
Updated Date:
2013-07-18
Project Name:
JDK
Resolved Date:
2012-05-26
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs24
Fixed Versions:
hs24 (b12)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
On 9/05/2012 1:08 AM, Andrew Dinn wrote:
> Enclosed below are details of a patch to the hsx/hotspot-main tree. The
> patch fixes some errors which manifested in the Zero ARM code when
> running the TCK tests which exercise method handles. This patch has
> already been applied to the iced tea 7-2.1 hotspot hg repository and
> found to correct the errors when retested on ARM. However, since the
> changes actually apply to Zero code (none of which is not ARM-specific)
> I think it really ought to be included in the hotspot tree.
> 
> I would be grateful if someone would agree to sponsor this patch for
> inclusion into the relevant hotspot repo(s).
> 
> regards,
> 
> Andrew Dinn
> -----------
> Principal Software Engineer
> Red Hat UK Ltd
> Registered in UK and Wales under Company Registration No. 3798903
> Directors: Michael Cunningham (USA), Mark Hegarty (Ireland), Matt Parson
> (USA), Charlie Peters (USA)
>

                                    

Comments
SUGGESTED FIX

--- old/src/cpu/zero/vm/cppInterpreter_zero.cpp	2012-05-04
17:40:57.837805644 +0100
+++ new/src/cpu/zero/vm/cppInterpreter_zero.cpp	2012-05-04
17:40:57.756806657 +0100
@@ -1026,6 +1026,16 @@
         java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
       oop arg = VMSLOTS_OBJECT(arg_slot);
       jvalue arg_value;
+      if (arg == NULL) {
+	// queue a nullpointer exception for the caller
+	stack->set_sp(calculate_unwind_sp(stack, method_handle));
+	CALL_VM_NOCHECK_NOFIX(
+	  throw_exception(
+	    thread, vmSymbols::java_lang_NullPointerException()));
+	// NB all oops trashed!
+	assert(HAS_PENDING_EXCEPTION, "should do");
+	return;
+      }
       BasicType arg_type = java_lang_boxing_object::get_value(arg,
&arg_value);
       if (arg_type == T_LONG || arg_type == T_DOUBLE) {
         intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle);
@@ -1112,6 +1122,15 @@
       case T_SHORT:
         return;
       }
+      // INT results sometimes need narrowing
+    case T_BOOLEAN:
+    case T_CHAR:
+    case T_BYTE:
+    case T_SHORT:
+      switch (src_rtype) {
+      case T_INT:
+        return;
+      }
     }

     tty->print_cr("unhandled conversion:");
                                     
2012-05-09
EVALUATION

See description
                                     
2012-05-09
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/7f410b6ea66c
                                     
2012-05-09
EVALUATION

Moved to MR
                                     
2012-05-09
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/7f410b6ea66c
                                     
2012-05-23
EVALUATION

http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/7f410b6ea66c
                                     
2012-06-29



Hardware and Software, Engineered to Work Together