< prev index next >

src/hotspot/cpu/arm/sharedRuntime_arm.cpp

Print this page




1558 
1559 #ifndef __SOFTFP__
1560   __ str_double(D0, Address(SP, RegisterSaver::D0_offset * wordSize));
1561 #endif // !__SOFTFP__
1562 
1563 #ifdef ASSERT
1564   // Reload Rkind from the UnrollBlock and check that it was not overwritten (Rkind is not callee-saved)
1565   { Label L;
1566     __ ldr_s32(Rtemp, Address(Rublock, Deoptimization::UnrollBlock::unpack_kind_offset_in_bytes()));
1567     __ cmp_32(Rkind, Rtemp);
1568     __ b(L, eq);
1569     __ stop("Rkind was overwritten");
1570     __ bind(L);
1571   }
1572 #endif
1573 
1574   // Call unpack_frames with proper arguments
1575   __ mov(R0, Rthread);
1576   __ mov(R1, Rkind);
1577 
1578   pc_offset = __ set_last_Java_frame(SP, FP, false, Rtemp);
1579   assert(((__ pc()) - start) == __ offset(), "warning: start differs from code_begin");
1580   __ call(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames));
1581   if (pc_offset == -1) {
1582     pc_offset = __ offset();
1583   }
1584   oop_maps->add_gc_map(pc_offset, new OopMap(frame_size_in_words * VMRegImpl::slots_per_word, 0));
1585   __ reset_last_Java_frame(Rtemp); // Rtemp free since scratched by far call
1586 
1587   // Collect return values, pop self-frame and jump to interpreter
1588   __ ldr(R0, Address(SP, RegisterSaver::R0_offset * wordSize));
1589   __ ldr(R1, Address(SP, RegisterSaver::R1_offset * wordSize));
1590   // Interpreter floats controlled by __SOFTFP__, but compiler
1591   // float return value registers controlled by __ABI_HARD__
1592   // This matters for vfp-sflt builds.
1593 #ifndef __SOFTFP__
1594   // Interpreter hard float
1595 #ifdef __ABI_HARD__
1596   // Compiler float return value in FP registers
1597   __ ldr_double(D0, Address(SP, RegisterSaver::D0_offset * wordSize));
1598 #else
1599   // Compiler float return value in integer registers,
1600   // copy to D0 for interpreter (S0 <-- R0)


1725   __ mov(FP, SP);
1726   __ sub(Rtemp, Rtemp, 2*wordSize);
1727 
1728   __ sub(SP, SP, Rtemp);
1729 
1730   __ str(Rsender, Address(FP, frame::interpreter_frame_sender_sp_offset * wordSize));
1731   __ mov(LR, 0);
1732   __ str(LR, Address(FP, frame::interpreter_frame_last_sp_offset * wordSize));
1733   __ subs(R8, R8, 1);                               // decrement counter
1734   __ mov(Rsender, SP);
1735   __ b(loop, ne);
1736 
1737   // Re-push self-frame
1738   __ ldr(LR, Address(R2));
1739   __ raw_push(FP, LR);
1740   __ mov(FP, SP);
1741 
1742   // Call unpack_frames with proper arguments
1743   __ mov(R0, Rthread);
1744   __ mov(R1, Deoptimization::Unpack_uncommon_trap);
1745   __ set_last_Java_frame(SP, FP, false, Rtemp);
1746   __ call(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames));
1747   //  oop_maps->add_gc_map(__ pc() - start, new OopMap(frame_size_in_words, 0));
1748   __ reset_last_Java_frame(Rtemp);
1749 
1750   __ mov(SP, FP);
1751   __ pop(RegisterSet(FP) | RegisterSet(PC));
1752 
1753   masm->flush();
1754   _uncommon_trap_blob = UncommonTrapBlob::create(&buffer, NULL, 2 /* LR+FP */);
1755 }
1756 
1757 #endif // COMPILER2
1758 
1759 //------------------------------generate_handler_blob------
1760 //
1761 // Generate a special Compile2Runtime blob that saves all registers,
1762 // setup oopmap, and calls safepoint code to stop the compiled code for
1763 // a safepoint.
1764 //
1765 SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
1766   assert(StubRoutines::forward_exception_entry() != NULL, "must be generated before");




1558 
1559 #ifndef __SOFTFP__
1560   __ str_double(D0, Address(SP, RegisterSaver::D0_offset * wordSize));
1561 #endif // !__SOFTFP__
1562 
1563 #ifdef ASSERT
1564   // Reload Rkind from the UnrollBlock and check that it was not overwritten (Rkind is not callee-saved)
1565   { Label L;
1566     __ ldr_s32(Rtemp, Address(Rublock, Deoptimization::UnrollBlock::unpack_kind_offset_in_bytes()));
1567     __ cmp_32(Rkind, Rtemp);
1568     __ b(L, eq);
1569     __ stop("Rkind was overwritten");
1570     __ bind(L);
1571   }
1572 #endif
1573 
1574   // Call unpack_frames with proper arguments
1575   __ mov(R0, Rthread);
1576   __ mov(R1, Rkind);
1577 
1578   pc_offset = __ set_last_Java_frame(SP, FP, true, Rtemp);
1579   assert(((__ pc()) - start) == __ offset(), "warning: start differs from code_begin");
1580   __ call_VM_leaf(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames));
1581   if (pc_offset == -1) {
1582     pc_offset = __ offset();
1583   }
1584   oop_maps->add_gc_map(pc_offset, new OopMap(frame_size_in_words * VMRegImpl::slots_per_word, 0));
1585   __ reset_last_Java_frame(Rtemp); // Rtemp free since scratched by far call
1586 
1587   // Collect return values, pop self-frame and jump to interpreter
1588   __ ldr(R0, Address(SP, RegisterSaver::R0_offset * wordSize));
1589   __ ldr(R1, Address(SP, RegisterSaver::R1_offset * wordSize));
1590   // Interpreter floats controlled by __SOFTFP__, but compiler
1591   // float return value registers controlled by __ABI_HARD__
1592   // This matters for vfp-sflt builds.
1593 #ifndef __SOFTFP__
1594   // Interpreter hard float
1595 #ifdef __ABI_HARD__
1596   // Compiler float return value in FP registers
1597   __ ldr_double(D0, Address(SP, RegisterSaver::D0_offset * wordSize));
1598 #else
1599   // Compiler float return value in integer registers,
1600   // copy to D0 for interpreter (S0 <-- R0)


1725   __ mov(FP, SP);
1726   __ sub(Rtemp, Rtemp, 2*wordSize);
1727 
1728   __ sub(SP, SP, Rtemp);
1729 
1730   __ str(Rsender, Address(FP, frame::interpreter_frame_sender_sp_offset * wordSize));
1731   __ mov(LR, 0);
1732   __ str(LR, Address(FP, frame::interpreter_frame_last_sp_offset * wordSize));
1733   __ subs(R8, R8, 1);                               // decrement counter
1734   __ mov(Rsender, SP);
1735   __ b(loop, ne);
1736 
1737   // Re-push self-frame
1738   __ ldr(LR, Address(R2));
1739   __ raw_push(FP, LR);
1740   __ mov(FP, SP);
1741 
1742   // Call unpack_frames with proper arguments
1743   __ mov(R0, Rthread);
1744   __ mov(R1, Deoptimization::Unpack_uncommon_trap);
1745   __ set_last_Java_frame(SP, FP, true, Rtemp);
1746   __ call_VM_leaf(CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames));
1747   //  oop_maps->add_gc_map(__ pc() - start, new OopMap(frame_size_in_words, 0));
1748   __ reset_last_Java_frame(Rtemp);
1749 
1750   __ mov(SP, FP);
1751   __ pop(RegisterSet(FP) | RegisterSet(PC));
1752 
1753   masm->flush();
1754   _uncommon_trap_blob = UncommonTrapBlob::create(&buffer, NULL, 2 /* LR+FP */);
1755 }
1756 
1757 #endif // COMPILER2
1758 
1759 //------------------------------generate_handler_blob------
1760 //
1761 // Generate a special Compile2Runtime blob that saves all registers,
1762 // setup oopmap, and calls safepoint code to stop the compiled code for
1763 // a safepoint.
1764 //
1765 SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
1766   assert(StubRoutines::forward_exception_entry() != NULL, "must be generated before");


< prev index next >