--- old/src/share/vm/asm/assembler.cpp 2013-10-31 15:52:27.458808536 -0700 +++ new/src/share/vm/asm/assembler.cpp 2013-10-31 15:52:27.370853644 -0700 @@ -122,7 +122,7 @@ void AbstractAssembler::generate_stack_overflow_check( int frame_size_in_bytes) { if (UseStackBanging) { // Each code entry causes one stack bang n pages down the stack where n - // is configurable by StackBangPages. The setting depends on the maximum + // is configurable by StackShadowPages. The setting depends on the maximum // depth of VM call stack or native before going back into java code, // since only java code can raise a stack overflow exception using the // stack banging mechanism. The VM and native code does not detect stack --- old/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2013-10-31 15:52:27.458808536 -0700 +++ new/src/cpu/sparc/vm/macroAssembler_sparc.cpp 2013-10-31 15:52:27.370853644 -0700 @@ -3526,8 +3526,10 @@ delayed()->sub(Rtsp, Roffset, Rtsp); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // Skip the first one because that was already touched in the above + // loop - the post decrement of temp means it's now a page below the + // last touch + for (int i = 1; i <= StackShadowPages; i++) { set((-i*offset)+STACK_BIAS, Rscratch); st(G0, Rtsp, Rscratch); } --- old/src/cpu/x86/vm/macroAssembler_x86.cpp 2013-10-31 15:52:27.458808536 -0700 +++ new/src/cpu/x86/vm/macroAssembler_x86.cpp 2013-10-31 15:52:27.370853644 -0700 @@ -1381,8 +1381,10 @@ jcc(Assembler::greater, loop); // Bang down shadow pages too. - // The -1 because we already subtracted 1 page. - for (int i = 0; i< StackShadowPages-1; i++) { + // Skip the first one because that was already touched in the above + // loop - the post decrement of temp means it's now a page below the + // last touch + for (int i = 1; i <= StackShadowPages; i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. movptr(Address(tmp, (-i*os::vm_page_size())), size );