JDK-7167406 : (Zero) Fix for InvokeDynamic needed
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs24
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-05-09
  • Updated: 2013-07-18
  • Resolved: 2012-05-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs23.2Fixed
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
EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/7f410b6ea66c
29-06-2012

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

EVALUATION Moved to MR
09-05-2012

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

EVALUATION See description
09-05-2012

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:");
09-05-2012