changeset 2947:6576fc644297

patched method handle adapter code to deal with failures in TCK
author "Andrew Dinn <adinn@redhat.com>"
date Fri, 04 May 2012 15:46:04 +0100
parents 5582e72f1897
children 85de6921e39e
files src/cpu/zero/vm/cppInterpreter_zero.cpp
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Tue May 01 16:13:47 2012 +0100
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Fri May 04 15:46:04 2012 +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:");