3034 __ sub(G0, 1, L1); |
3034 __ sub(G0, 1, L1); |
3035 __ st(L1, G2_thread, in_bytes(JavaThread::pending_deoptimization_offset())); |
3035 __ st(L1, G2_thread, in_bytes(JavaThread::pending_deoptimization_offset())); |
3036 |
3036 |
3037 __ mov((int32_t)Deoptimization::Unpack_reexecute, L0deopt_mode); |
3037 __ mov((int32_t)Deoptimization::Unpack_reexecute, L0deopt_mode); |
3038 __ mov(G2_thread, O0); |
3038 __ mov(G2_thread, O0); |
|
3039 __ mov(L0deopt_mode, O2); |
3039 __ call(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)); |
3040 __ call(CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap)); |
3040 __ delayed()->nop(); |
3041 __ delayed()->nop(); |
3041 oop_maps->add_gc_map( __ offset()-start, map->deep_copy()); |
3042 oop_maps->add_gc_map( __ offset()-start, map->deep_copy()); |
3042 __ get_thread(); |
3043 __ get_thread(); |
3043 __ add(O7, 8, O7); |
3044 __ add(O7, 8, O7); |
3119 __ set_last_Java_frame(SP, noreg); |
3120 __ set_last_Java_frame(SP, noreg); |
3120 |
3121 |
3121 // do the call by hand so we can get the oopmap |
3122 // do the call by hand so we can get the oopmap |
3122 |
3123 |
3123 __ mov(G2_thread, L7_thread_cache); |
3124 __ mov(G2_thread, L7_thread_cache); |
|
3125 __ mov(L0deopt_mode, O1); |
3124 __ call(CAST_FROM_FN_PTR(address, Deoptimization::fetch_unroll_info), relocInfo::runtime_call_type); |
3126 __ call(CAST_FROM_FN_PTR(address, Deoptimization::fetch_unroll_info), relocInfo::runtime_call_type); |
3125 __ delayed()->mov(G2_thread, O0); |
3127 __ delayed()->mov(G2_thread, O0); |
3126 |
3128 |
3127 // Set an oopmap for the call site this describes all our saved volatile registers |
3129 // Set an oopmap for the call site this describes all our saved volatile registers |
3128 |
3130 |
3144 |
3146 |
3145 __ mov(O0, O2UnrollBlock->after_save()); |
3147 __ mov(O0, O2UnrollBlock->after_save()); |
3146 |
3148 |
3147 RegisterSaver::restore_result_registers(masm); |
3149 RegisterSaver::restore_result_registers(masm); |
3148 |
3150 |
|
3151 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::unpack_kind_offset_in_bytes(), G4deopt_mode); |
3149 Label noException; |
3152 Label noException; |
3150 __ cmp_and_br_short(G4deopt_mode, Deoptimization::Unpack_exception, Assembler::notEqual, Assembler::pt, noException); |
3153 __ cmp_and_br_short(G4deopt_mode, Deoptimization::Unpack_exception, Assembler::notEqual, Assembler::pt, noException); |
3151 |
3154 |
3152 // Move the pending exception from exception_oop to Oexception so |
3155 // Move the pending exception from exception_oop to Oexception so |
3153 // the pending exception will be picked up the interpreter. |
3156 // the pending exception will be picked up the interpreter. |
3267 // and call Deoptimization::uncommon_trap to pack the compiled frame into |
3270 // and call Deoptimization::uncommon_trap to pack the compiled frame into |
3268 // vframe array and return the UnrollBlock information |
3271 // vframe array and return the UnrollBlock information |
3269 __ save_frame(0); |
3272 __ save_frame(0); |
3270 __ set_last_Java_frame(SP, noreg); |
3273 __ set_last_Java_frame(SP, noreg); |
3271 __ mov(I0, O2klass_index); |
3274 __ mov(I0, O2klass_index); |
3272 __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap), G2_thread, O2klass_index); |
3275 __ mov(Deoptimization::Unpack_uncommon_trap, O3); // exec mode |
|
3276 __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::uncommon_trap), G2_thread, O2klass_index, O3); |
3273 __ reset_last_Java_frame(); |
3277 __ reset_last_Java_frame(); |
3274 __ mov(O0, O2UnrollBlock->after_save()); |
3278 __ mov(O0, O2UnrollBlock->after_save()); |
3275 __ restore(); |
3279 __ restore(); |
3276 |
3280 |
3277 // deallocate the deoptimized frame taking care to preserve the return values |
3281 // deallocate the deoptimized frame taking care to preserve the return values |
3278 __ mov(O2UnrollBlock, O2UnrollBlock->after_save()); |
3282 __ mov(O2UnrollBlock, O2UnrollBlock->after_save()); |
3279 __ restore(); |
3283 __ restore(); |
|
3284 |
|
3285 #ifdef ASSERT |
|
3286 { Label L; |
|
3287 __ ld(O2UnrollBlock, Deoptimization::UnrollBlock::unpack_kind_offset_in_bytes(), O1); |
|
3288 __ cmp_and_br_short(O1, Deoptimization::Unpack_uncommon_trap, Assembler::equal, Assembler::pt, L); |
|
3289 __ stop("SharedRuntime::generate_deopt_blob: expected Unpack_uncommon_trap"); |
|
3290 __ bind(L); |
|
3291 } |
|
3292 #endif |
3280 |
3293 |
3281 // Allocate new interpreter frame(s) and possible c2i adapter frame |
3294 // Allocate new interpreter frame(s) and possible c2i adapter frame |
3282 |
3295 |
3283 make_new_frames(masm, false); |
3296 make_new_frames(masm, false); |
3284 |
3297 |