comparison src/cpu/x86/vm/sharedRuntime_x86_32.cpp @ 13384:fca8f4799229

8028308: nsk regression, assert(obj->is_oop()) failed: not an oop Summary: rbp not restored when stack overflow is thrown from deopt/uncommon trap blobs Reviewed-by: kvn, iveresov
author roland
date Wed, 20 Nov 2013 12:46:08 +0100
parents e961c11b85fe
children 02f27ecb4f3a de6a9e811145 1174c8abbdb6
comparison
equal deleted inserted replaced
13383:938e1e64e28f 13384:fca8f4799229
2999 // Pop deoptimized frame 2999 // Pop deoptimized frame
3000 __ addptr(rsp, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes())); 3000 __ addptr(rsp, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes()));
3001 3001
3002 // sp should be pointing at the return address to the caller (3) 3002 // sp should be pointing at the return address to the caller (3)
3003 3003
3004 // Pick up the initial fp we should save
3005 // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
3006 __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3007
3004 // Stack bang to make sure there's enough room for these interpreter frames. 3008 // Stack bang to make sure there's enough room for these interpreter frames.
3005 if (UseStackBanging) { 3009 if (UseStackBanging) {
3006 __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes())); 3010 __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
3007 __ bang_stack_size(rbx, rcx); 3011 __ bang_stack_size(rbx, rcx);
3008 } 3012 }
3017 3021
3018 Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes()); 3022 Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
3019 3023
3020 __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes())); 3024 __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
3021 __ movl(counter, rbx); 3025 __ movl(counter, rbx);
3022
3023 // Pick up the initial fp we should save
3024 __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3025 3026
3026 // Now adjust the caller's stack to make up for the extra locals 3027 // Now adjust the caller's stack to make up for the extra locals
3027 // but record the original sp so that we can save it in the skeletal interpreter 3028 // but record the original sp so that we can save it in the skeletal interpreter
3028 // frame and the stack walking of interpreter_sender will get the unextended sp 3029 // frame and the stack walking of interpreter_sender will get the unextended sp
3029 // value and not the "real" sp value. 3030 // value and not the "real" sp value.
3218 __ movl2ptr(rcx, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes())); 3219 __ movl2ptr(rcx, Address(rdi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes()));
3219 __ addptr(rsp, rcx); 3220 __ addptr(rsp, rcx);
3220 3221
3221 // sp should be pointing at the return address to the caller (3) 3222 // sp should be pointing at the return address to the caller (3)
3222 3223
3224 // Pick up the initial fp we should save
3225 // restore rbp before stack bang because if stack overflow is thrown it needs to be pushed (and preserved)
3226 __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3227
3223 // Stack bang to make sure there's enough room for these interpreter frames. 3228 // Stack bang to make sure there's enough room for these interpreter frames.
3224 if (UseStackBanging) { 3229 if (UseStackBanging) {
3225 __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes())); 3230 __ movl(rbx, Address(rdi ,Deoptimization::UnrollBlock::total_frame_sizes_offset_in_bytes()));
3226 __ bang_stack_size(rbx, rcx); 3231 __ bang_stack_size(rbx, rcx);
3227 } 3232 }
3237 3242
3238 Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes()); 3243 Address counter(rdi, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes());
3239 3244
3240 __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes())); 3245 __ movl(rbx, Address(rdi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()));
3241 __ movl(counter, rbx); 3246 __ movl(counter, rbx);
3242
3243 // Pick up the initial fp we should save
3244 __ movptr(rbp, Address(rdi, Deoptimization::UnrollBlock::initial_info_offset_in_bytes()));
3245 3247
3246 // Now adjust the caller's stack to make up for the extra locals 3248 // Now adjust the caller's stack to make up for the extra locals
3247 // but record the original sp so that we can save it in the skeletal interpreter 3249 // but record the original sp so that we can save it in the skeletal interpreter
3248 // frame and the stack walking of interpreter_sender will get the unextended sp 3250 // frame and the stack walking of interpreter_sender will get the unextended sp
3249 // value and not the "real" sp value. 3251 // value and not the "real" sp value.