8143817: C1: Platform dependent stack space not preserved for all runtime calls
authormdoerr
Tue, 08 Dec 2015 14:44:00 +0100
changeset 35109 92535200db7d
parent 35108 ccb4e1f2a6cf
child 35111 d72f2f2e084e
8143817: C1: Platform dependent stack space not preserved for all runtime calls Reviewed-by: roland
hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Fri Dec 11 15:03:11 2015 +0300
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp	Tue Dec 08 14:44:00 2015 +0100
@@ -3055,13 +3055,16 @@
   __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type()));
 }
 
-void LIRGenerator::do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x) {
-    assert(x->number_of_arguments() == expected_arguments, "wrong type");
-    LIR_Opr reg = result_register_for(x->type());
-    __ call_runtime_leaf(routine, getThreadTemp(),
-                         reg, new LIR_OprList());
-    LIR_Opr result = rlock_result(x);
-    __ move(reg, result);
+void LIRGenerator::do_RuntimeCall(address routine, Intrinsic* x) {
+  assert(x->number_of_arguments() == 0, "wrong type");
+  // Enforce computation of _reserved_argument_area_size which is required on some platforms.
+  BasicTypeList signature;
+  CallingConvention* cc = frame_map()->c_calling_convention(&signature);
+  LIR_Opr reg = result_register_for(x->type());
+  __ call_runtime_leaf(routine, getThreadTemp(),
+                       reg, new LIR_OprList());
+  LIR_Opr result = rlock_result(x);
+  __ move(reg, result);
 }
 
 #ifdef TRACE_HAVE_INTRINSICS
@@ -3115,16 +3118,16 @@
   case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break;
   case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break;
   case vmIntrinsics::_counterTime:
-    do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), 0, x);
+    do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x);
     break;
 #endif
 
   case vmIntrinsics::_currentTimeMillis:
-    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), 0, x);
+    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), x);
     break;
 
   case vmIntrinsics::_nanoTime:
-    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), 0, x);
+    do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), x);
     break;
 
   case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp	Fri Dec 11 15:03:11 2015 +0300
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp	Tue Dec 08 14:44:00 2015 +0100
@@ -439,7 +439,7 @@
   SwitchRangeArray* create_lookup_ranges(LookupSwitch* x);
   void do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegin* default_sux);
 
-  void do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x);
+  void do_RuntimeCall(address routine, Intrinsic* x);
 #ifdef TRACE_HAVE_INTRINSICS
   void do_ThreadIDIntrinsic(Intrinsic* x);
   void do_ClassIDIntrinsic(Intrinsic* x);