< prev index next >

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Print this page

1846   // serves as dummy and the bl will be patched later.
1847   __ bl(__ pc());
1848   oop_maps->add_gc_map(__ pc() - start, map);
1849   __ post_call_nop();
1850 
1851   __ b(L_exit);
1852 
1853   // --- Thawing path
1854 
1855   __ bind(L_thaw);
1856   __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(StubRoutines::cont_thaw()));
1857   __ mtctr(R0);
1858   __ bctrl();
1859   oop_maps->add_gc_map(__ pc() - start, map->deep_copy());
1860   ContinuationEntry::_return_pc_offset = __ pc() - start;
1861   __ post_call_nop();
1862 
1863   // --- Normal exit (resolve/thawing)
1864 
1865   __ bind(L_exit);

1866   continuation_enter_cleanup(masm);
1867 
1868   // Pop frame and return
1869   DEBUG_ONLY(__ ld_ptr(R0, 0, R1_SP));
1870   __ addi(R1_SP, R1_SP, framesize_words*wordSize);
1871   DEBUG_ONLY(__ cmpd(CCR0, R0, R1_SP));
1872   __ asm_assert_eq(FILE_AND_LINE ": inconsistent frame size");
1873   __ ld(R0, _abi0(lr), R1_SP); // Return pc
1874   __ mtlr(R0);
1875   __ blr();
1876 
1877   // --- Exception handling path
1878 
1879   exception_offset = __ pc() - start;
1880 
1881   continuation_enter_cleanup(masm);
1882   Register ex_pc  = R17_tos;   // nonvolatile register
1883   Register ex_oop = R15_esp;   // nonvolatile register
1884   __ ld(ex_pc, _abi0(callers_sp), R1_SP); // Load caller's return pc
1885   __ ld(ex_pc, _abi0(lr), ex_pc);

2716 }
2717 
2718 // This function returns the adjust size (in number of words) to a c2i adapter
2719 // activation for use during deoptimization.
2720 int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals) {
2721   return align_up((callee_locals - callee_parameters) * Interpreter::stackElementWords, frame::frame_alignment_in_words);
2722 }
2723 
2724 uint SharedRuntime::in_preserve_stack_slots() {
2725   return frame::jit_in_preserve_size / VMRegImpl::stack_slot_size;
2726 }
2727 
2728 uint SharedRuntime::out_preserve_stack_slots() {
2729 #if defined(COMPILER1) || defined(COMPILER2)
2730   return frame::jit_out_preserve_size / VMRegImpl::stack_slot_size;
2731 #else
2732   return 0;
2733 #endif
2734 }
2735 





2736 #if defined(COMPILER1) || defined(COMPILER2)
2737 // Frame generation for deopt and uncommon trap blobs.
2738 static void push_skeleton_frame(MacroAssembler* masm, bool deopt,
2739                                 /* Read */
2740                                 Register unroll_block_reg,
2741                                 /* Update */
2742                                 Register frame_sizes_reg,
2743                                 Register number_of_frames_reg,
2744                                 Register pcs_reg,
2745                                 /* Invalidate */
2746                                 Register frame_size_reg,
2747                                 Register pc_reg) {
2748 
2749   __ ld(pc_reg, 0, pcs_reg);
2750   __ ld(frame_size_reg, 0, frame_sizes_reg);
2751   __ std(pc_reg, _abi0(lr), R1_SP);
2752   __ push_frame(frame_size_reg, R0/*tmp*/);
2753   __ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP);
2754   __ addi(number_of_frames_reg, number_of_frames_reg, -1);
2755   __ addi(frame_sizes_reg, frame_sizes_reg, wordSize);

1846   // serves as dummy and the bl will be patched later.
1847   __ bl(__ pc());
1848   oop_maps->add_gc_map(__ pc() - start, map);
1849   __ post_call_nop();
1850 
1851   __ b(L_exit);
1852 
1853   // --- Thawing path
1854 
1855   __ bind(L_thaw);
1856   __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(StubRoutines::cont_thaw()));
1857   __ mtctr(R0);
1858   __ bctrl();
1859   oop_maps->add_gc_map(__ pc() - start, map->deep_copy());
1860   ContinuationEntry::_return_pc_offset = __ pc() - start;
1861   __ post_call_nop();
1862 
1863   // --- Normal exit (resolve/thawing)
1864 
1865   __ bind(L_exit);
1866   ContinuationEntry::_cleanup_offset = __ pc() - start;
1867   continuation_enter_cleanup(masm);
1868 
1869   // Pop frame and return
1870   DEBUG_ONLY(__ ld_ptr(R0, 0, R1_SP));
1871   __ addi(R1_SP, R1_SP, framesize_words*wordSize);
1872   DEBUG_ONLY(__ cmpd(CCR0, R0, R1_SP));
1873   __ asm_assert_eq(FILE_AND_LINE ": inconsistent frame size");
1874   __ ld(R0, _abi0(lr), R1_SP); // Return pc
1875   __ mtlr(R0);
1876   __ blr();
1877 
1878   // --- Exception handling path
1879 
1880   exception_offset = __ pc() - start;
1881 
1882   continuation_enter_cleanup(masm);
1883   Register ex_pc  = R17_tos;   // nonvolatile register
1884   Register ex_oop = R15_esp;   // nonvolatile register
1885   __ ld(ex_pc, _abi0(callers_sp), R1_SP); // Load caller's return pc
1886   __ ld(ex_pc, _abi0(lr), ex_pc);

2717 }
2718 
2719 // This function returns the adjust size (in number of words) to a c2i adapter
2720 // activation for use during deoptimization.
2721 int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals) {
2722   return align_up((callee_locals - callee_parameters) * Interpreter::stackElementWords, frame::frame_alignment_in_words);
2723 }
2724 
2725 uint SharedRuntime::in_preserve_stack_slots() {
2726   return frame::jit_in_preserve_size / VMRegImpl::stack_slot_size;
2727 }
2728 
2729 uint SharedRuntime::out_preserve_stack_slots() {
2730 #if defined(COMPILER1) || defined(COMPILER2)
2731   return frame::jit_out_preserve_size / VMRegImpl::stack_slot_size;
2732 #else
2733   return 0;
2734 #endif
2735 }
2736 
2737 VMReg SharedRuntime::thread_register() {
2738   Unimplemented();
2739   return nullptr;
2740 }
2741 
2742 #if defined(COMPILER1) || defined(COMPILER2)
2743 // Frame generation for deopt and uncommon trap blobs.
2744 static void push_skeleton_frame(MacroAssembler* masm, bool deopt,
2745                                 /* Read */
2746                                 Register unroll_block_reg,
2747                                 /* Update */
2748                                 Register frame_sizes_reg,
2749                                 Register number_of_frames_reg,
2750                                 Register pcs_reg,
2751                                 /* Invalidate */
2752                                 Register frame_size_reg,
2753                                 Register pc_reg) {
2754 
2755   __ ld(pc_reg, 0, pcs_reg);
2756   __ ld(frame_size_reg, 0, frame_sizes_reg);
2757   __ std(pc_reg, _abi0(lr), R1_SP);
2758   __ push_frame(frame_size_reg, R0/*tmp*/);
2759   __ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP);
2760   __ addi(number_of_frames_reg, number_of_frames_reg, -1);
2761   __ addi(frame_sizes_reg, frame_sizes_reg, wordSize);
< prev index next >