changeset 12971:3a04e444da6d

Merge
author iveresov
date Wed, 23 Oct 2013 16:25:48 -0700
parents 1c90f0072f0d (diff) 97d400662426 (current diff)
children 59e8ad757e19
files
diffstat 7 files changed, 37 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp	Wed Oct 23 19:22:28 2013 +0000
+++ b/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp	Wed Oct 23 16:25:48 2013 -0700
@@ -53,6 +53,8 @@
       opr = as_long_opr(reg);
     } else if (type == T_OBJECT || type == T_ARRAY) {
       opr = as_oop_opr(reg);
+    } else if (type == T_METADATA) {
+      opr = as_metadata_opr(reg);
     } else {
       opr = as_opr(reg);
     }
--- a/src/cpu/x86/vm/c1_FrameMap_x86.cpp	Wed Oct 23 19:22:28 2013 +0000
+++ b/src/cpu/x86/vm/c1_FrameMap_x86.cpp	Wed Oct 23 16:25:48 2013 -0700
@@ -52,6 +52,8 @@
 #endif // _LP64
     } else if (type == T_OBJECT || type == T_ARRAY) {
       opr = as_oop_opr(reg);
+    } else if (type == T_METADATA) {
+      opr = as_metadata_opr(reg);
     } else {
       opr = as_opr(reg);
     }
--- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Oct 23 19:22:28 2013 +0000
+++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Oct 23 16:25:48 2013 -0700
@@ -432,15 +432,16 @@
   int offset = code_offset();
 
   // Fetch the exception from TLS and clear out exception related thread state
-  __ get_thread(rsi);
-  __ movptr(rax, Address(rsi, JavaThread::exception_oop_offset()));
-  __ movptr(Address(rsi, JavaThread::exception_oop_offset()), (intptr_t)NULL_WORD);
-  __ movptr(Address(rsi, JavaThread::exception_pc_offset()), (intptr_t)NULL_WORD);
+  Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread);
+  NOT_LP64(__ get_thread(rsi));
+  __ movptr(rax, Address(thread, JavaThread::exception_oop_offset()));
+  __ movptr(Address(thread, JavaThread::exception_oop_offset()), (intptr_t)NULL_WORD);
+  __ movptr(Address(thread, JavaThread::exception_pc_offset()), (intptr_t)NULL_WORD);
 
   __ bind(_unwind_handler_entry);
   __ verify_not_null_oop(rax);
   if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
-    __ mov(rsi, rax);  // Preserve the exception
+    __ mov(rbx, rax);  // Preserve the exception (rbx is always callee-saved)
   }
 
   // Preform needed unlocking
@@ -448,19 +449,24 @@
   if (method()->is_synchronized()) {
     monitor_address(0, FrameMap::rax_opr);
     stub = new MonitorExitStub(FrameMap::rax_opr, true, 0);
-    __ unlock_object(rdi, rbx, rax, *stub->entry());
+    __ unlock_object(rdi, rsi, rax, *stub->entry());
     __ bind(*stub->continuation());
   }
 
   if (compilation()->env()->dtrace_method_probes()) {
+#ifdef _LP64
+    __ mov(rdi, r15_thread);
+    __ mov_metadata(rsi, method()->constant_encoding());
+#else
     __ get_thread(rax);
     __ movptr(Address(rsp, 0), rax);
     __ mov_metadata(Address(rsp, sizeof(void*)), method()->constant_encoding());
+#endif
     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit)));
   }
 
   if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
-    __ mov(rax, rsi);  // Restore the exception
+    __ mov(rax, rbx);  // Restore the exception
   }
 
   // remove the activation and dispatch to the unwind handler
--- a/src/share/vm/c1/c1_LIR.cpp	Wed Oct 23 19:22:28 2013 +0000
+++ b/src/share/vm/c1/c1_LIR.cpp	Wed Oct 23 16:25:48 2013 -0700
@@ -183,10 +183,10 @@
     case T_LONG:
     case T_OBJECT:
     case T_ADDRESS:
-    case T_METADATA:
     case T_VOID:
       return ::type2char(t);
-
+    case T_METADATA:
+      return 'M';
     case T_ILLEGAL:
       return '?';
 
--- a/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Oct 23 19:22:28 2013 +0000
+++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Oct 23 16:25:48 2013 -0700
@@ -1175,7 +1175,7 @@
   if (compilation()->env()->dtrace_method_probes()) {
     BasicTypeList signature;
     signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT));    // thread
-    signature.append(T_OBJECT); // Method*
+    signature.append(T_METADATA); // Method*
     LIR_OprList* args = new LIR_OprList();
     args->append(getThreadPointer());
     LIR_Opr meth = new_register(T_METADATA);
@@ -2720,7 +2720,7 @@
   if (compilation()->env()->dtrace_method_probes()) {
     BasicTypeList signature;
     signature.append(LP64_ONLY(T_LONG) NOT_LP64(T_INT));    // thread
-    signature.append(T_OBJECT); // Method*
+    signature.append(T_METADATA); // Method*
     LIR_OprList* args = new LIR_OprList();
     args->append(getThreadPointer());
     LIR_Opr meth = new_register(T_METADATA);
@@ -3331,7 +3331,7 @@
   BasicTypeList* signature = new BasicTypeList(x->number_of_arguments());
 
   if (x->pass_thread()) {
-    signature->append(T_ADDRESS);
+    signature->append(LP64_ONLY(T_LONG) NOT_LP64(T_INT));    // thread
     args->append(getThreadPointer());
   }
 
--- a/src/share/vm/c1/c1_LinearScan.cpp	Wed Oct 23 19:22:28 2013 +0000
+++ b/src/share/vm/c1/c1_LinearScan.cpp	Wed Oct 23 16:25:48 2013 -0700
@@ -75,9 +75,9 @@
 
 // Map BasicType to spill size in 32-bit words, matching VMReg's notion of words
 #ifdef _LP64
-static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 0, 1, -1};
+static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 0, 2,  1, 2, 1, -1};
 #else
-static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, -1};
+static int type2spill_size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, -1, 1, 1, -1};
 #endif
 
 
--- a/src/share/vm/classfile/systemDictionary.cpp	Wed Oct 23 19:22:28 2013 +0000
+++ b/src/share/vm/classfile/systemDictionary.cpp	Wed Oct 23 16:25:48 2013 -0700
@@ -2360,6 +2360,11 @@
   objArrayHandle appendix_box = oopFactory::new_objArray(SystemDictionary::Object_klass(), 1, CHECK_(empty));
   assert(appendix_box->obj_at(0) == NULL, "");
 
+  // This should not happen.  JDK code should take care of that.
+  if (accessing_klass.is_null() || method_type.is_null()) {
+    THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad invokehandle", empty);
+  }
+
   // call java.lang.invoke.MethodHandleNatives::linkMethod(... String, MethodType) -> MemberName
   JavaCallArguments args;
   args.push_oop(accessing_klass()->java_mirror());
@@ -2485,6 +2490,9 @@
   Handle type;
   if (signature->utf8_length() > 0 && signature->byte_at(0) == '(') {
     type = find_method_handle_type(signature, caller, CHECK_(empty));
+  } else if (caller.is_null()) {
+    // This should not happen.  JDK code should take care of that.
+    THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad MH constant", empty);
   } else {
     ResourceMark rm(THREAD);
     SignatureStream ss(signature, false);
@@ -2548,6 +2556,11 @@
   Handle method_name = java_lang_String::create_from_symbol(name, CHECK_(empty));
   Handle method_type = find_method_handle_type(type, caller, CHECK_(empty));
 
+  // This should not happen.  JDK code should take care of that.
+  if (caller.is_null() || method_type.is_null()) {
+    THROW_MSG_(vmSymbols::java_lang_InternalError(), "bad invokedynamic", empty);
+  }
+
   objArrayHandle appendix_box = oopFactory::new_objArray(SystemDictionary::Object_klass(), 1, CHECK_(empty));
   assert(appendix_box->obj_at(0) == NULL, "");