comparison src/cpu/sparc/vm/sharedRuntime_sparc.cpp @ 17980:0bf37f737702

8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9 Summary: make compiled code bang the stack by the worst case size of the interpreter frame at deoptimization points. Reviewed-by: twisti, kvn
author roland
date Tue, 01 Apr 2014 09:36:49 +0200
parents 2100bf712e2a
children 52b4284cb496 318cc6fdae90
comparison
equal deleted inserted replaced
17978:ad51f24671c2 17980:0bf37f737702
3353 Register O2UnrollBlock = O2; 3353 Register O2UnrollBlock = O2;
3354 Register O3array = O3; 3354 Register O3array = O3;
3355 Register O4array_size = O4; 3355 Register O4array_size = O4;
3356 Label loop; 3356 Label loop;
3357 3357
3358 // Before we make new frames, check to see if stack is available. 3358 #ifdef ASSERT
3359 // Do this after the caller's return address is on top of stack 3359 // Compilers generate code that bang the stack by as much as the
3360 // interpreter would need. So this stack banging should never
3361 // trigger a fault. Verify that it does not on non product builds.
3360 if (UseStackBanging) { 3362 if (UseStackBanging) {
3361 // Get total frame size for interpreted frames 3363 // Get total frame size for interpreted frames
3362 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes(), O4); 3364 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes(), O4);
3363 __ bang_stack_size(O4, O3, G3_scratch); 3365 __ bang_stack_size(O4, O3, G3_scratch);
3364 } 3366 }
3367 #endif
3365 3368
3366 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes(), O4array_size); 3369 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes(), O4array_size);
3367 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes(), G3pcs); 3370 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes(), G3pcs);
3368 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes(), O3array); 3371 __ ld_ptr(O2UnrollBlock, Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes(), O3array);
3369 3372
3407 void SharedRuntime::generate_deopt_blob() { 3410 void SharedRuntime::generate_deopt_blob() {
3408 // allocate space for the code 3411 // allocate space for the code
3409 ResourceMark rm; 3412 ResourceMark rm;
3410 // setup code generation tools 3413 // setup code generation tools
3411 int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code 3414 int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code
3415 #ifdef ASSERT
3412 if (UseStackBanging) { 3416 if (UseStackBanging) {
3413 pad += StackShadowPages*16 + 32; 3417 pad += StackShadowPages*16 + 32;
3414 } 3418 }
3419 #endif
3415 #ifdef _LP64 3420 #ifdef _LP64
3416 CodeBuffer buffer("deopt_blob", 2100+pad, 512); 3421 CodeBuffer buffer("deopt_blob", 2100+pad, 512);
3417 #else 3422 #else
3418 // Measured 8/7/03 at 1212 in 32bit debug build (no VerifyThread) 3423 // Measured 8/7/03 at 1212 in 32bit debug build (no VerifyThread)
3419 // Measured 8/7/03 at 1396 in 32bit debug build (VerifyThread) 3424 // Measured 8/7/03 at 1396 in 32bit debug build (VerifyThread)
3630 void SharedRuntime::generate_uncommon_trap_blob() { 3635 void SharedRuntime::generate_uncommon_trap_blob() {
3631 // allocate space for the code 3636 // allocate space for the code
3632 ResourceMark rm; 3637 ResourceMark rm;
3633 // setup code generation tools 3638 // setup code generation tools
3634 int pad = VerifyThread ? 512 : 0; 3639 int pad = VerifyThread ? 512 : 0;
3640 #ifdef ASSERT
3635 if (UseStackBanging) { 3641 if (UseStackBanging) {
3636 pad += StackShadowPages*16 + 32; 3642 pad += StackShadowPages*16 + 32;
3637 } 3643 }
3644 #endif
3638 #ifdef _LP64 3645 #ifdef _LP64
3639 CodeBuffer buffer("uncommon_trap_blob", 2700+pad, 512); 3646 CodeBuffer buffer("uncommon_trap_blob", 2700+pad, 512);
3640 #else 3647 #else
3641 // Measured 8/7/03 at 660 in 32bit debug build (no VerifyThread) 3648 // Measured 8/7/03 at 660 in 32bit debug build (no VerifyThread)
3642 // Measured 8/7/03 at 1028 in 32bit debug build (VerifyThread) 3649 // Measured 8/7/03 at 1028 in 32bit debug build (VerifyThread)