hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
changeset 24018 77b156916bab
parent 22244 0fdd928b5b64
child 24669 14439491d407
--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp	Mon Apr 14 09:04:36 2014 +0000
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp	Tue Apr 01 09:36:49 2014 +0200
@@ -190,6 +190,13 @@
   return _masm->pc();
 }
 
+// To bang the stack of this compiled method we use the stack size
+// that the interpreter would need in case of a deoptimization. This
+// removes the need to bang the stack in the deoptimization blob which
+// in turn simplifies stack overflow handling.
+int LIR_Assembler::bang_size_in_bytes() const {
+  return MAX2(initial_frame_size_in_bytes(), _compilation->interpreter_frame_size());
+}
 
 void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) {
   for (int i = 0; i < info_list->length(); i++) {
@@ -797,7 +804,7 @@
 
 
 void LIR_Assembler::build_frame() {
-  _masm->build_frame(initial_frame_size_in_bytes());
+  _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());
 }