1777 Address mdo_arg_addr(mdp, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args);
1778 profile_obj_type(tmp, mdo_arg_addr, tmp, /*ltg did compare to 0*/ true);
1779
1780 int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
1781 add2reg(mdp, to_add);
1782 off_to_args += to_add;
1783 }
1784
1785 if (MethodData::profile_return()) {
1786 z_lg(tmp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args, mdp);
1787 add2reg(tmp, -TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
1788 }
1789
1790 bind(done);
1791
1792 if (MethodData::profile_return()) {
1793 // We're right after the type profile for the last
1794 // argument. Tmp is the number of cells left in the
1795 // CallTypeData/VirtualCallTypeData to reach its end. Non null
1796 // if there's a return to profile.
1797 assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type");
1798 z_sllg(tmp, tmp, exact_log2(DataLayout::cell_size));
1799 z_agr(mdp, tmp);
1800 }
1801 z_stg(mdp, _z_ijava_state_neg(mdx), Z_fp);
1802 } else {
1803 assert(MethodData::profile_return(), "either profile call args or call ret");
1804 update_mdp_by_constant(mdp, in_bytes(TypeEntriesAtCall::return_only_size()));
1805 }
1806
1807 // Mdp points right after the end of the
1808 // CallTypeData/VirtualCallTypeData, right after the cells for the
1809 // return value type if there's one.
1810 bind(profile_continue);
1811 }
1812 }
1813
1814 void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret, Register tmp) {
1815 assert_different_registers(mdp, ret, tmp);
1816 if (ProfileInterpreter && MethodData::profile_return()) {
1817 Label profile_continue;
1826 // length.
1827 NearLabel do_profile;
1828 Address bc(Z_bcp);
1829 z_lb(tmp, bc);
1830 compare32_and_branch(tmp, Bytecodes::_invokedynamic, Assembler::bcondEqual, do_profile);
1831 compare32_and_branch(tmp, Bytecodes::_invokehandle, Assembler::bcondEqual, do_profile);
1832 get_method(tmp);
1833 // Supplement to 8139891: _intrinsic_id exceeded 1-byte size limit.
1834 if (Method::intrinsic_id_size_in_bytes() == 1) {
1835 z_cli(in_bytes(Method::intrinsic_id_offset()), tmp, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
1836 } else {
1837 assert(Method::intrinsic_id_size_in_bytes() == 2, "size error: check Method::_intrinsic_id");
1838 z_lh(tmp, in_bytes(Method::intrinsic_id_offset()), Z_R0, tmp);
1839 z_chi(tmp, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
1840 }
1841 z_brne(profile_continue);
1842
1843 bind(do_profile);
1844 }
1845
1846 Address mdo_ret_addr(mdp, -in_bytes(ReturnTypeEntry::size()));
1847 profile_obj_type(ret, mdo_ret_addr, tmp);
1848
1849 bind(profile_continue);
1850 }
1851 }
1852
1853 void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register tmp1, Register tmp2) {
1854 if (ProfileInterpreter && MethodData::profile_parameters()) {
1855 Label profile_continue, done;
1856
1857 test_method_data_pointer(mdp, profile_continue);
1858
1859 // Load the offset of the area within the MDO used for
1860 // parameters. If it's negative we're not profiling any parameters.
1861 Address parm_di_addr(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset()));
1862 load_and_test_int2long(tmp1, parm_di_addr);
1863 z_brl(profile_continue);
1864
1865 // Compute a pointer to the area for parameters from the offset
1866 // and move the pointer to the slot for the last
|
1777 Address mdo_arg_addr(mdp, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args);
1778 profile_obj_type(tmp, mdo_arg_addr, tmp, /*ltg did compare to 0*/ true);
1779
1780 int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
1781 add2reg(mdp, to_add);
1782 off_to_args += to_add;
1783 }
1784
1785 if (MethodData::profile_return()) {
1786 z_lg(tmp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args, mdp);
1787 add2reg(tmp, -TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
1788 }
1789
1790 bind(done);
1791
1792 if (MethodData::profile_return()) {
1793 // We're right after the type profile for the last
1794 // argument. Tmp is the number of cells left in the
1795 // CallTypeData/VirtualCallTypeData to reach its end. Non null
1796 // if there's a return to profile.
1797 assert(SingleTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type");
1798 z_sllg(tmp, tmp, exact_log2(DataLayout::cell_size));
1799 z_agr(mdp, tmp);
1800 }
1801 z_stg(mdp, _z_ijava_state_neg(mdx), Z_fp);
1802 } else {
1803 assert(MethodData::profile_return(), "either profile call args or call ret");
1804 update_mdp_by_constant(mdp, in_bytes(TypeEntriesAtCall::return_only_size()));
1805 }
1806
1807 // Mdp points right after the end of the
1808 // CallTypeData/VirtualCallTypeData, right after the cells for the
1809 // return value type if there's one.
1810 bind(profile_continue);
1811 }
1812 }
1813
1814 void InterpreterMacroAssembler::profile_return_type(Register mdp, Register ret, Register tmp) {
1815 assert_different_registers(mdp, ret, tmp);
1816 if (ProfileInterpreter && MethodData::profile_return()) {
1817 Label profile_continue;
1826 // length.
1827 NearLabel do_profile;
1828 Address bc(Z_bcp);
1829 z_lb(tmp, bc);
1830 compare32_and_branch(tmp, Bytecodes::_invokedynamic, Assembler::bcondEqual, do_profile);
1831 compare32_and_branch(tmp, Bytecodes::_invokehandle, Assembler::bcondEqual, do_profile);
1832 get_method(tmp);
1833 // Supplement to 8139891: _intrinsic_id exceeded 1-byte size limit.
1834 if (Method::intrinsic_id_size_in_bytes() == 1) {
1835 z_cli(in_bytes(Method::intrinsic_id_offset()), tmp, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
1836 } else {
1837 assert(Method::intrinsic_id_size_in_bytes() == 2, "size error: check Method::_intrinsic_id");
1838 z_lh(tmp, in_bytes(Method::intrinsic_id_offset()), Z_R0, tmp);
1839 z_chi(tmp, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
1840 }
1841 z_brne(profile_continue);
1842
1843 bind(do_profile);
1844 }
1845
1846 Address mdo_ret_addr(mdp, -in_bytes(SingleTypeEntry::size()));
1847 profile_obj_type(ret, mdo_ret_addr, tmp);
1848
1849 bind(profile_continue);
1850 }
1851 }
1852
1853 void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register tmp1, Register tmp2) {
1854 if (ProfileInterpreter && MethodData::profile_parameters()) {
1855 Label profile_continue, done;
1856
1857 test_method_data_pointer(mdp, profile_continue);
1858
1859 // Load the offset of the area within the MDO used for
1860 // parameters. If it's negative we're not profiling any parameters.
1861 Address parm_di_addr(mdp, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset()));
1862 load_and_test_int2long(tmp1, parm_di_addr);
1863 z_brl(profile_continue);
1864
1865 // Compute a pointer to the area for parameters from the offset
1866 // and move the pointer to the slot for the last
|