hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp
changeset 46369 3bf4544bec14
parent 44406 a46a6c4d1dd9
parent 46338 e84b501fa52e
child 46620 750c6edff33b
--- a/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp	Thu Apr 06 04:50:34 2017 +0000
+++ b/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp	Thu Apr 06 22:58:55 2017 +0200
@@ -270,12 +270,6 @@
   return entry;
 }
 
-address TemplateInterpreterGenerator::generate_continuation_for(TosState state) {
-  // Not used.
-  STOP("generate_continuation_for");
-  return NULL;
-}
-
 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, size_t index_size) {
   address entry = __ pc();
 
@@ -310,6 +304,9 @@
   __ convert_retval_to_tos(state);
 #endif // !AARCH64
 
+ __ check_and_handle_popframe();
+ __ check_and_handle_earlyret();
+
   __ dispatch_next(state, step);
 
   return entry;
@@ -1401,7 +1398,13 @@
 #ifdef AARCH64
   // setup RmaxStack
   __ ldrh(RmaxStack, Address(RconstMethod, ConstMethod::max_stack_offset()));
-  __ add(RmaxStack, RmaxStack, MAX2(1, Method::extra_stack_entries())); // reserve slots for exception handler and JSR292 appendix argument
+  // We have to add extra reserved slots to max_stack. There are 3 users of the extra slots,
+  // none of which are at the same time, so we just need to make sure there is enough room
+  // for the biggest user:
+  //   -reserved slot for exception handler
+  //   -reserved slots for JSR292. Method::extra_stack_entries() is the size.
+  //   -3 reserved slots so get_method_counters() can save some registers before call_VM().
+  __ add(RmaxStack, RmaxStack, MAX2(3, Method::extra_stack_entries()));
 #endif // AARCH64
 
   // see if we've got enough room on the stack for locals plus overhead.