2466 __ relocate(rspec); |
2466 __ relocate(rspec); |
2467 //__ lui(oop_handle_reg, Assembler::split_high((int)JNIHandles::make_local( |
2467 //__ lui(oop_handle_reg, Assembler::split_high((int)JNIHandles::make_local( |
2468 // Klass::cast(method->method_holder())->java_mirror()))); |
2468 // Klass::cast(method->method_holder())->java_mirror()))); |
2469 //__ addiu(oop_handle_reg, oop_handle_reg, Assembler::split_low((int) |
2469 //__ addiu(oop_handle_reg, oop_handle_reg, Assembler::split_low((int) |
2470 // JNIHandles::make_local(Klass::cast(method->method_holder())->java_mirror()))); |
2470 // JNIHandles::make_local(Klass::cast(method->method_holder())->java_mirror()))); |
2471 __ li48(oop_handle_reg, (long)JNIHandles::make_local((method->method_holder())->java_mirror())); |
2471 __ patchable_set48(oop_handle_reg, (long)JNIHandles::make_local((method->method_holder())->java_mirror())); |
2472 // __ verify_oop(oop_handle_reg); |
2472 // __ verify_oop(oop_handle_reg); |
2473 // Now handlize the static class mirror it's known not-null. |
2473 // Now handlize the static class mirror it's known not-null. |
2474 __ sd( oop_handle_reg, SP, klass_offset); |
2474 __ sd( oop_handle_reg, SP, klass_offset); |
2475 map->set_oop(VMRegImpl::stack2reg(klass_slot_offset)); |
2475 map->set_oop(VMRegImpl::stack2reg(klass_slot_offset)); |
2476 |
2476 |
2493 //__ set_last_Java_frame(thread, esp, noreg, (address)the_pc); |
2493 //__ set_last_Java_frame(thread, esp, noreg, (address)the_pc); |
2494 __ set_last_Java_frame(SP, noreg, NULL); |
2494 __ set_last_Java_frame(SP, noreg, NULL); |
2495 __ relocate(relocInfo::internal_pc_type); |
2495 __ relocate(relocInfo::internal_pc_type); |
2496 { |
2496 { |
2497 intptr_t save_pc = (intptr_t)the_pc ; |
2497 intptr_t save_pc = (intptr_t)the_pc ; |
2498 __ li48(AT, save_pc); |
2498 __ patchable_set48(AT, save_pc); |
2499 } |
2499 } |
2500 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
2500 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
2501 |
2501 |
2502 |
2502 |
2503 // We have all of the arguments setup at this point. We must not touch any register |
2503 // We have all of the arguments setup at this point. We must not touch any register |
2507 int metadata_index = __ oop_recorder()->find_index(method()); |
2507 int metadata_index = __ oop_recorder()->find_index(method()); |
2508 RelocationHolder rspec = metadata_Relocation::spec(metadata_index); |
2508 RelocationHolder rspec = metadata_Relocation::spec(metadata_index); |
2509 __ relocate(rspec); |
2509 __ relocate(rspec); |
2510 //__ lui(T6, Assembler::split_high((int)JNIHandles::make_local(method()))); |
2510 //__ lui(T6, Assembler::split_high((int)JNIHandles::make_local(method()))); |
2511 //__ addiu(T6, T6, Assembler::split_low((int)JNIHandles::make_local(method()))); |
2511 //__ addiu(T6, T6, Assembler::split_low((int)JNIHandles::make_local(method()))); |
2512 __ li48(AT, (long)(method())); |
2512 __ patchable_set48(AT, (long)(method())); |
2513 |
2513 |
2514 __ call_VM_leaf( |
2514 __ call_VM_leaf( |
2515 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), |
2515 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_entry), |
2516 thread, AT); |
2516 thread, AT); |
2517 |
2517 |
2770 int metadata_index = __ oop_recorder()->find_index( (method())); |
2770 int metadata_index = __ oop_recorder()->find_index( (method())); |
2771 RelocationHolder rspec = metadata_Relocation::spec(metadata_index); |
2771 RelocationHolder rspec = metadata_Relocation::spec(metadata_index); |
2772 __ relocate(rspec); |
2772 __ relocate(rspec); |
2773 //__ lui(T6, Assembler::split_high((int)JNIHandles::make_local(method()))); |
2773 //__ lui(T6, Assembler::split_high((int)JNIHandles::make_local(method()))); |
2774 //__ addiu(T6, T6, Assembler::split_low((int)JNIHandles::make_local(method()))); |
2774 //__ addiu(T6, T6, Assembler::split_low((int)JNIHandles::make_local(method()))); |
2775 __ li48(AT, (long)(method())); |
2775 __ patchable_set48(AT, (long)(method())); |
2776 |
2776 |
2777 __ call_VM_leaf( |
2777 __ call_VM_leaf( |
2778 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), |
2778 CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), |
2779 thread, AT); |
2779 thread, AT); |
2780 restore_native_result(masm, ret_type, stack_slots); |
2780 restore_native_result(masm, ret_type, stack_slots); |
3827 // this call, no GC can happen. Call should capture return values. |
3827 // this call, no GC can happen. Call should capture return values. |
3828 |
3828 |
3829 __ relocate(relocInfo::internal_pc_type); |
3829 __ relocate(relocInfo::internal_pc_type); |
3830 { |
3830 { |
3831 intptr_t save_pc = (intptr_t)__ pc() + NativeMovConstReg::instruction_size + NativeCall::return_address_offset + 4; |
3831 intptr_t save_pc = (intptr_t)__ pc() + NativeMovConstReg::instruction_size + NativeCall::return_address_offset + 4; |
3832 __ li48(AT, save_pc); |
3832 __ patchable_set48(AT, save_pc); |
3833 } |
3833 } |
3834 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
3834 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
3835 |
3835 |
3836 __ call((address)Deoptimization::fetch_unroll_info); |
3836 __ call((address)Deoptimization::fetch_unroll_info); |
3837 //__ call(CAST_FROM_FN_PTR(address, Deoptimization::fetch_unroll_info), relocInfo::runtime_call_type); |
3837 //__ call(CAST_FROM_FN_PTR(address, Deoptimization::fetch_unroll_info), relocInfo::runtime_call_type); |
3992 __ andr(SP, SP, AT); // Fix stack alignment as required by ABI |
3992 __ andr(SP, SP, AT); // Fix stack alignment as required by ABI |
3993 |
3993 |
3994 __ relocate(relocInfo::internal_pc_type); |
3994 __ relocate(relocInfo::internal_pc_type); |
3995 { |
3995 { |
3996 intptr_t save_pc = (intptr_t)__ pc() + NativeMovConstReg::instruction_size + NativeCall::return_address_offset + 4; |
3996 intptr_t save_pc = (intptr_t)__ pc() + NativeMovConstReg::instruction_size + NativeCall::return_address_offset + 4; |
3997 __ li48(AT, save_pc); |
3997 __ patchable_set48(AT, save_pc); |
3998 } |
3998 } |
3999 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
3999 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
4000 |
4000 |
4001 //__ call(Deoptimization::unpack_frames); |
4001 //__ call(Deoptimization::unpack_frames); |
4002 __ call(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), relocInfo::runtime_call_type); |
4002 __ call(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), relocInfo::runtime_call_type); |
4092 __ set_last_Java_frame(NOREG, FP, NULL); |
4092 __ set_last_Java_frame(NOREG, FP, NULL); |
4093 __ relocate(relocInfo::internal_pc_type); |
4093 __ relocate(relocInfo::internal_pc_type); |
4094 assert(NativeCall::return_address_offset == 24, "in sharedRuntime return_address_offset"); |
4094 assert(NativeCall::return_address_offset == 24, "in sharedRuntime return_address_offset"); |
4095 { |
4095 { |
4096 long save_pc = (long)__ pc() + 28 + NativeCall::return_address_offset; |
4096 long save_pc = (long)__ pc() + 28 + NativeCall::return_address_offset; |
4097 __ li48(AT, (long)save_pc); |
4097 __ patchable_set48(AT, (long)save_pc); |
4098 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
4098 __ sd(AT, thread, in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
4099 } |
4099 } |
4100 // Call C code. Need thread but NOT official VM entry |
4100 // Call C code. Need thread but NOT official VM entry |
4101 // crud. We cannot block on this call, no GC can happen. Call should |
4101 // crud. We cannot block on this call, no GC can happen. Call should |
4102 // capture callee-saved registers as well as return values. |
4102 // capture callee-saved registers as well as return values. |
4103 __ move(A0, thread); |
4103 __ move(A0, thread); |
4104 // argument already in T0 |
4104 // argument already in T0 |
4105 __ move(A1, T0); |
4105 __ move(A1, T0); |
4106 __ li48(T9, (long)Deoptimization::uncommon_trap); |
4106 __ set64(T9, (long)Deoptimization::uncommon_trap); |
4107 __ jalr(T9); |
4107 __ jalr(T9); |
4108 __ delayed()->nop(); |
4108 __ delayed()->nop(); |
4109 |
4109 |
4110 // Set an oopmap for the call site |
4110 // Set an oopmap for the call site |
4111 OopMapSet *oop_maps = new OopMapSet(); |
4111 OopMapSet *oop_maps = new OopMapSet(); |
4214 __ andr(SP, SP, AT); // Fix stack alignment as required by ABI |
4214 __ andr(SP, SP, AT); // Fix stack alignment as required by ABI |
4215 |
4215 |
4216 __ relocate(relocInfo::internal_pc_type); |
4216 __ relocate(relocInfo::internal_pc_type); |
4217 { |
4217 { |
4218 long save_pc = (long)__ pc() + 28 + NativeCall::return_address_offset; |
4218 long save_pc = (long)__ pc() + 28 + NativeCall::return_address_offset; |
4219 __ li48(AT, (long)save_pc); |
4219 __ patchable_set48(AT, (long)save_pc); |
4220 } |
4220 } |
4221 __ sd(AT, thread,in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
4221 __ sd(AT, thread,in_bytes(JavaThread::frame_anchor_offset() + JavaFrameAnchor::last_Java_pc_offset())); |
4222 |
4222 |
4223 // Call C code. Need thread but NOT official VM entry |
4223 // Call C code. Need thread but NOT official VM entry |
4224 // crud. We cannot block on this call, no GC can happen. Call should |
4224 // crud. We cannot block on this call, no GC can happen. Call should |
4225 // restore return values to their stack-slots with the new SP. |
4225 // restore return values to their stack-slots with the new SP. |
4226 __ move(A0, thread); |
4226 __ move(A0, thread); |
4227 __ move(A1, Deoptimization::Unpack_uncommon_trap); |
4227 __ move(A1, Deoptimization::Unpack_uncommon_trap); |
4228 __ li48(T9, (long)Deoptimization::unpack_frames); |
4228 __ set64(T9, (long)Deoptimization::unpack_frames); |
4229 __ jalr(T9); |
4229 __ jalr(T9); |
4230 __ delayed()->nop(); |
4230 __ delayed()->nop(); |
4231 // Set an oopmap for the call site |
4231 // Set an oopmap for the call site |
4232 //oop_maps->add_gc_map( __ offset(), true, new OopMap( framesize, 0 ) ); |
4232 //oop_maps->add_gc_map( __ offset(), true, new OopMap( framesize, 0 ) ); |
4233 oop_maps->add_gc_map( __ offset(), new OopMap( framesize, 0 ) );//Fu |
4233 oop_maps->add_gc_map( __ offset(), new OopMap( framesize, 0 ) );//Fu |
4406 __ andr(SP, SP, AT); |
4406 __ andr(SP, SP, AT); |
4407 __ relocate(relocInfo::internal_pc_type); |
4407 __ relocate(relocInfo::internal_pc_type); |
4408 { |
4408 { |
4409 intptr_t save_pc = (intptr_t)__ pc() + NativeMovConstReg::instruction_size + NativeCall::return_address_offset + 1 * BytesPerInstWord; |
4409 intptr_t save_pc = (intptr_t)__ pc() + NativeMovConstReg::instruction_size + NativeCall::return_address_offset + 1 * BytesPerInstWord; |
4410 //tty->print_cr(" %s :%d, name:%s, pc: %lx, save_pc: %lx, frame_size_words: %lx", __func__, __LINE__, name, __ pc(), save_pc, frame_size_words); //aoqi_test |
4410 //tty->print_cr(" %s :%d, name:%s, pc: %lx, save_pc: %lx, frame_size_words: %lx", __func__, __LINE__, name, __ pc(), save_pc, frame_size_words); //aoqi_test |
4411 __ li48(AT, save_pc); |
4411 __ patchable_set48(AT, save_pc); |
4412 } |
4412 } |
4413 __ sd(AT, thread, in_bytes(JavaThread::last_Java_pc_offset())); |
4413 __ sd(AT, thread, in_bytes(JavaThread::last_Java_pc_offset())); |
4414 |
4414 |
4415 __ call(destination); |
4415 __ call(destination); |
4416 __ delayed()->nop(); |
4416 __ delayed()->nop(); |