1589 #ifdef ASSERT
1590 {
1591 Label L;
1592 ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
1593 cbz(rscratch1, L);
1594 stop("InterpreterMacroAssembler::call_VM_leaf_base:"
1595 " last_sp != NULL");
1596 bind(L);
1597 }
1598 #endif /* ASSERT */
1599 // super call
1600 MacroAssembler::call_VM_base(oop_result, noreg, last_java_sp,
1601 entry_point, number_of_arguments,
1602 check_exceptions);
1603 // interpreter specific
1604 restore_bcp();
1605 restore_locals();
1606 }
1607
1608 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
1609 Label update, next, none;
1610
1611 verify_oop(obj);
1612
1613 cbnz(obj, update);
1614 orptr(mdo_addr, TypeEntries::null_seen);
1615 b(next);
1616
1617 bind(update);
1618 load_klass(obj, obj);
1619
1620 ldr(rscratch1, mdo_addr);
1621 eor(obj, obj, rscratch1);
1622 tst(obj, TypeEntries::type_klass_mask);
1623 br(Assembler::EQ, next); // klass seen before, nothing to
1624 // do. The unknown bit may have been
1625 // set already but no need to check.
1626
1627 tbnz(obj, exact_log2(TypeEntries::type_unknown), next);
1628 // already unknown. Nothing to do anymore.
1749 br(Assembler::EQ, do_profile);
1750 cmp(rscratch1, Bytecodes::_invokehandle);
1751 br(Assembler::EQ, do_profile);
1752 get_method(tmp);
1753 ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
1754 cmp(rscratch1, vmIntrinsics::_compiledLambdaForm);
1755 br(Assembler::NE, profile_continue);
1756
1757 bind(do_profile);
1758 }
1759
1760 Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
1761 mov(tmp, ret);
1762 profile_obj_type(tmp, mdo_ret_addr);
1763
1764 bind(profile_continue);
1765 }
1766 }
1767
1768 void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register tmp1, Register tmp2) {
1769 if (ProfileInterpreter && MethodData::profile_parameters()) {
1770 Label profile_continue, done;
1771
1772 test_method_data_pointer(mdp, profile_continue);
1773
1774 // Load the offset of the area within the MDO used for
1775 // parameters. If it's negative we're not profiling any parameters
1776 ldr(tmp1, Address(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset())));
1777 tbnz(tmp1, 63, profile_continue); // i.e. sign bit set
1778
1779 // Compute a pointer to the area for parameters from the offset
1780 // and move the pointer to the slot for the last
1781 // parameters. Collect profiling from last parameter down.
1782 // mdo start + parameters offset + array length - 1
1783 add(mdp, mdp, tmp1);
1784 ldr(tmp1, Address(mdp, ArrayData::array_len_offset()));
1785 sub(tmp1, tmp1, TypeStackSlotEntries::per_arg_count());
1786
1787 Label loop;
1788 bind(loop);
1789
1790 int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0));
1791 int type_base = in_bytes(ParametersTypeData::type_offset(0));
1792 int per_arg_scale = exact_log2(DataLayout::cell_size);
1793 add(rscratch1, mdp, off_base);
1794 add(rscratch2, mdp, type_base);
1795
1796 Address arg_off(rscratch1, tmp1, Address::lsl(per_arg_scale));
1797 Address arg_type(rscratch2, tmp1, Address::lsl(per_arg_scale));
|
1589 #ifdef ASSERT
1590 {
1591 Label L;
1592 ldr(rscratch1, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
1593 cbz(rscratch1, L);
1594 stop("InterpreterMacroAssembler::call_VM_leaf_base:"
1595 " last_sp != NULL");
1596 bind(L);
1597 }
1598 #endif /* ASSERT */
1599 // super call
1600 MacroAssembler::call_VM_base(oop_result, noreg, last_java_sp,
1601 entry_point, number_of_arguments,
1602 check_exceptions);
1603 // interpreter specific
1604 restore_bcp();
1605 restore_locals();
1606 }
1607
1608 void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) {
1609 assert_different_registers(obj, rscratch1);
1610 Label update, next, none;
1611
1612 verify_oop(obj);
1613
1614 cbnz(obj, update);
1615 orptr(mdo_addr, TypeEntries::null_seen);
1616 b(next);
1617
1618 bind(update);
1619 load_klass(obj, obj);
1620
1621 ldr(rscratch1, mdo_addr);
1622 eor(obj, obj, rscratch1);
1623 tst(obj, TypeEntries::type_klass_mask);
1624 br(Assembler::EQ, next); // klass seen before, nothing to
1625 // do. The unknown bit may have been
1626 // set already but no need to check.
1627
1628 tbnz(obj, exact_log2(TypeEntries::type_unknown), next);
1629 // already unknown. Nothing to do anymore.
1750 br(Assembler::EQ, do_profile);
1751 cmp(rscratch1, Bytecodes::_invokehandle);
1752 br(Assembler::EQ, do_profile);
1753 get_method(tmp);
1754 ldrh(rscratch1, Address(tmp, Method::intrinsic_id_offset_in_bytes()));
1755 cmp(rscratch1, vmIntrinsics::_compiledLambdaForm);
1756 br(Assembler::NE, profile_continue);
1757
1758 bind(do_profile);
1759 }
1760
1761 Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
1762 mov(tmp, ret);
1763 profile_obj_type(tmp, mdo_ret_addr);
1764
1765 bind(profile_continue);
1766 }
1767 }
1768
1769 void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register tmp1, Register tmp2) {
1770 assert_different_registers(rscratch1, rscratch2, mdp, tmp1, tmp2);
1771 if (ProfileInterpreter && MethodData::profile_parameters()) {
1772 Label profile_continue, done;
1773
1774 test_method_data_pointer(mdp, profile_continue);
1775
1776 // Load the offset of the area within the MDO used for
1777 // parameters. If it's negative we're not profiling any parameters
1778 ldrw(tmp1, Address(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset())));
1779 tbnz(tmp1, 31, profile_continue); // i.e. sign bit set
1780
1781 // Compute a pointer to the area for parameters from the offset
1782 // and move the pointer to the slot for the last
1783 // parameters. Collect profiling from last parameter down.
1784 // mdo start + parameters offset + array length - 1
1785 add(mdp, mdp, tmp1);
1786 ldr(tmp1, Address(mdp, ArrayData::array_len_offset()));
1787 sub(tmp1, tmp1, TypeStackSlotEntries::per_arg_count());
1788
1789 Label loop;
1790 bind(loop);
1791
1792 int off_base = in_bytes(ParametersTypeData::stack_slot_offset(0));
1793 int type_base = in_bytes(ParametersTypeData::type_offset(0));
1794 int per_arg_scale = exact_log2(DataLayout::cell_size);
1795 add(rscratch1, mdp, off_base);
1796 add(rscratch2, mdp, type_base);
1797
1798 Address arg_off(rscratch1, tmp1, Address::lsl(per_arg_scale));
1799 Address arg_type(rscratch2, tmp1, Address::lsl(per_arg_scale));
|