src/cpu/x86/vm/sharedRuntime_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/cpu/x86/vm

src/cpu/x86/vm/sharedRuntime_x86_32.cpp

Print this page
rev 6086 : 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:


2990   // Pop all the frames we must move/replace.
2991   //
2992   // Frame picture (youngest to oldest)
2993   // 1: self-frame (no frame link)
2994   // 2: deopting frame  (no frame link)
2995   // 3: caller of deopting frame (could be compiled/interpreted).
2996   //
2997   // Note: by leaving the return address of self-frame on the stack
2998   // and using the size of frame 2 to adjust the stack
2999   // when we are done the return to frame 3 will still be on the stack.
3000 
3001   // Pop deoptimized frame
3002   __ addptr(rsp, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes()));
3003 
3004   // sp should be pointing at the return address to the caller (3)
3005 
3006   // Pick up the initial fp we should save
3007   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
3008   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3009 
3010   // Stack bang to make sure there's enough room for these interpreter frames.



3011   if (UseStackBanging) {
3012     __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
3013     __ bang_stack_size(rbx, rcx);
3014   }

3015 
3016   // Load array of frame pcs into ECX
3017   __ movptr(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
3018 
3019   __ pop(rsi); // trash the old pc
3020 
3021   // Load array of frame sizes into ESI
3022   __ movptr(rsi,Address(rdi,Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes()));
3023 
3024   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
3025 
3026   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
3027   __ movl(counter, rbx);
3028 
3029   // Now adjust the caller's stack to make up for the extra locals
3030   // but record the original sp so that we can save it in the skeletal interpreter
3031   // frame and the stack walking of interpreter_sender will get the unextended sp
3032   // value and not the "real" sp value.
3033 
3034   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());


3210   // Pop all the frames we must move/replace.
3211   //
3212   // Frame picture (youngest to oldest)
3213   // 1: self-frame (no frame link)
3214   // 2: deopting frame  (no frame link)
3215   // 3: caller of deopting frame (could be compiled/interpreted).
3216 
3217   // Pop self-frame.  We have no frame, and must rely only on EAX and ESP.
3218   __ addptr(rsp,(framesize-1)*wordSize);     // Epilog!
3219 
3220   // Pop deoptimized frame
3221   __ movl2ptr(rcx, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes()));
3222   __ addptr(rsp, rcx);
3223 
3224   // sp should be pointing at the return address to the caller (3)
3225 
3226   // Pick up the initial fp we should save
3227   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
3228   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3229 
3230   // Stack bang to make sure there's enough room for these interpreter frames.



3231   if (UseStackBanging) {
3232     __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
3233     __ bang_stack_size(rbx, rcx);
3234   }
3235 
3236 
3237   // Load array of frame pcs into ECX
3238   __ movl(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
3239 
3240   __ pop(rsi); // trash the pc
3241 
3242   // Load array of frame sizes into ESI
3243   __ movptr(rsi,Address(rdi,Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes()));
3244 
3245   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
3246 
3247   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
3248   __ movl(counter, rbx);
3249 
3250   // Now adjust the caller's stack to make up for the extra locals
3251   // but record the original sp so that we can save it in the skeletal interpreter
3252   // frame and the stack walking of interpreter_sender will get the unextended sp
3253   // value and not the "real" sp value.
3254 
3255   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());




2990   // Pop all the frames we must move/replace.
2991   //
2992   // Frame picture (youngest to oldest)
2993   // 1: self-frame (no frame link)
2994   // 2: deopting frame  (no frame link)
2995   // 3: caller of deopting frame (could be compiled/interpreted).
2996   //
2997   // Note: by leaving the return address of self-frame on the stack
2998   // and using the size of frame 2 to adjust the stack
2999   // when we are done the return to frame 3 will still be on the stack.
3000 
3001   // Pop deoptimized frame
3002   __ addptr(rsp, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes()));
3003 
3004   // sp should be pointing at the return address to the caller (3)
3005 
3006   // Pick up the initial fp we should save
3007   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
3008   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3009 
3010 #ifdef ASSERT
3011   // Compilers generate code that bang the stack by as much as the
3012   // interpreter would need. So this stack banging should never
3013   // trigger a fault. Verify that it does not on non product builds.
3014   if (UseStackBanging) {
3015     __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
3016     __ bang_stack_size(rbx, rcx);
3017   }
3018 #endif
3019 
3020   // Load array of frame pcs into ECX
3021   __ movptr(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
3022 
3023   __ pop(rsi); // trash the old pc
3024 
3025   // Load array of frame sizes into ESI
3026   __ movptr(rsi,Address(rdi,Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes()));
3027 
3028   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
3029 
3030   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
3031   __ movl(counter, rbx);
3032 
3033   // Now adjust the caller's stack to make up for the extra locals
3034   // but record the original sp so that we can save it in the skeletal interpreter
3035   // frame and the stack walking of interpreter_sender will get the unextended sp
3036   // value and not the "real" sp value.
3037 
3038   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());


3214   // Pop all the frames we must move/replace.
3215   //
3216   // Frame picture (youngest to oldest)
3217   // 1: self-frame (no frame link)
3218   // 2: deopting frame  (no frame link)
3219   // 3: caller of deopting frame (could be compiled/interpreted).
3220 
3221   // Pop self-frame.  We have no frame, and must rely only on EAX and ESP.
3222   __ addptr(rsp,(framesize-1)*wordSize);     // Epilog!
3223 
3224   // Pop deoptimized frame
3225   __ movl2ptr(rcx, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes()));
3226   __ addptr(rsp, rcx);
3227 
3228   // sp should be pointing at the return address to the caller (3)
3229 
3230   // Pick up the initial fp we should save
3231   // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
3232   __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3233 
3234 #ifdef ASSERT
3235   // Compilers generate code that bang the stack by as much as the
3236   // interpreter would need. So this stack banging should never
3237   // trigger a fault. Verify that it does not on non product builds.
3238   if (UseStackBanging) {
3239     __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
3240     __ bang_stack_size(rbx, rcx);
3241   }
3242 #endif
3243 
3244   // Load array of frame pcs into ECX
3245   __ movl(rcx,Address(rdi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()));
3246 
3247   __ pop(rsi); // trash the pc
3248 
3249   // Load array of frame sizes into ESI
3250   __ movptr(rsi,Address(rdi,Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes()));
3251 
3252   Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
3253 
3254   __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
3255   __ movl(counter, rbx);
3256 
3257   // Now adjust the caller's stack to make up for the extra locals
3258   // but record the original sp so that we can save it in the skeletal interpreter
3259   // frame and the stack walking of interpreter_sender will get the unextended sp
3260   // value and not the "real" sp value.
3261 
3262   Address sp_temp(rdi, Deoptimization::UnrollBlock::sender_sp_temp_offset_in_bytes());


src/cpu/x86/vm/sharedRuntime_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File