# HG changeset patch # User dholmes # Date 1336537725 14400 # Node ID 0a3b759f810905e753feb4623704eec0cc6910e8 # Parent fb31de03f64984252c33dea9fcda2588d44b8e5e 7167406: (Zero) Fix for InvokeDynamic needed Reviewed-by: chrisphi, dholmes Contributed-by: Andrew Dinn diff -r fb31de03f649 -r 0a3b759f8109 hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Mon Mar 19 10:09:24 2012 +0100 +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Wed May 09 00:28:45 2012 -0400 @@ -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:");