< prev index next >

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Print this page

1820 
1821         profile_obj_type(tmp1, R28_mdx, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args, tmp2, tmp1);
1822 
1823         int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
1824         addi(R28_mdx, R28_mdx, to_add);
1825         off_to_args += to_add;
1826       }
1827 
1828       if (MethodData::profile_return()) {
1829         ld(tmp1, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args, R28_mdx);
1830         addi(tmp1, tmp1, -TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
1831       }
1832 
1833       bind(done);
1834 
1835       if (MethodData::profile_return()) {
1836         // We're right after the type profile for the last
1837         // argument. tmp1 is the number of cells left in the
1838         // CallTypeData/VirtualCallTypeData to reach its end. Non null
1839         // if there's a return to profile.
1840         assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(),
1841                "can't move past ret type");
1842         sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size));
1843         add(R28_mdx, tmp1, R28_mdx);
1844       }
1845     } else {
1846       assert(MethodData::profile_return(), "either profile call args or call ret");
1847       update_mdp_by_constant(in_bytes(TypeEntriesAtCall::return_only_size()));
1848     }
1849 
1850     // Mdp points right after the end of the
1851     // CallTypeData/VirtualCallTypeData, right after the cells for the
1852     // return value type if there's one.
1853     align(32, 12);
1854     bind(profile_continue);
1855   }
1856 }
1857 
1858 void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1, Register tmp2) {
1859   assert_different_registers(ret, tmp1, tmp2);
1860   if (ProfileInterpreter && MethodData::profile_return()) {
1861     Label profile_continue;
1862 
1863     test_method_data_pointer(profile_continue);
1864 
1865     if (MethodData::profile_return_jsr292_only()) {
1866       // If we don't profile all invoke bytecodes we must make sure
1867       // it's a bytecode we indeed profile. We can't go back to the
1868       // beginning of the ProfileData we intend to update to check its
1869       // type because we're right after it and we don't known its
1870       // length.
1871       lbz(tmp1, 0, R14_bcp);
1872       lbz(tmp2, in_bytes(Method::intrinsic_id_offset()), R19_method);
1873       cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
1874       cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
1875       cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
1876       cmpwi(CCR1, tmp2, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
1877       cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
1878       bne(CCR0, profile_continue);
1879     }
1880 
1881     profile_obj_type(ret, R28_mdx, -in_bytes(ReturnTypeEntry::size()), tmp1, tmp2);
1882 
1883     align(32, 12);
1884     bind(profile_continue);
1885   }
1886 }
1887 
1888 void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2,
1889                                                         Register tmp3, Register tmp4) {
1890   if (ProfileInterpreter && MethodData::profile_parameters()) {
1891     Label profile_continue, done;
1892 
1893     test_method_data_pointer(profile_continue);
1894 
1895     // Load the offset of the area within the MDO used for
1896     // parameters. If it's negative we're not profiling any parameters.
1897     lwz(tmp1, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset()), R28_mdx);
1898     cmpwi(CCR0, tmp1, 0);
1899     blt(CCR0, profile_continue);
1900 
1901     // Compute a pointer to the area for parameters from the offset

1820 
1821         profile_obj_type(tmp1, R28_mdx, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args, tmp2, tmp1);
1822 
1823         int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
1824         addi(R28_mdx, R28_mdx, to_add);
1825         off_to_args += to_add;
1826       }
1827 
1828       if (MethodData::profile_return()) {
1829         ld(tmp1, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args, R28_mdx);
1830         addi(tmp1, tmp1, -TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
1831       }
1832 
1833       bind(done);
1834 
1835       if (MethodData::profile_return()) {
1836         // We're right after the type profile for the last
1837         // argument. tmp1 is the number of cells left in the
1838         // CallTypeData/VirtualCallTypeData to reach its end. Non null
1839         // if there's a return to profile.
1840         assert(SingleTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(),
1841                "can't move past ret type");
1842         sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size));
1843         add(R28_mdx, tmp1, R28_mdx);
1844       }
1845     } else {
1846       assert(MethodData::profile_return(), "either profile call args or call ret");
1847       update_mdp_by_constant(in_bytes(TypeEntriesAtCall::return_only_size()));
1848     }
1849 
1850     // Mdp points right after the end of the
1851     // CallTypeData/VirtualCallTypeData, right after the cells for the
1852     // return value type if there's one.
1853     align(32, 12);
1854     bind(profile_continue);
1855   }
1856 }
1857 
1858 void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1, Register tmp2) {
1859   assert_different_registers(ret, tmp1, tmp2);
1860   if (ProfileInterpreter && MethodData::profile_return()) {
1861     Label profile_continue;
1862 
1863     test_method_data_pointer(profile_continue);
1864 
1865     if (MethodData::profile_return_jsr292_only()) {
1866       // If we don't profile all invoke bytecodes we must make sure
1867       // it's a bytecode we indeed profile. We can't go back to the
1868       // beginning of the ProfileData we intend to update to check its
1869       // type because we're right after it and we don't known its
1870       // length.
1871       lbz(tmp1, 0, R14_bcp);
1872       lbz(tmp2, in_bytes(Method::intrinsic_id_offset()), R19_method);
1873       cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic);
1874       cmpwi(CCR1, tmp1, Bytecodes::_invokehandle);
1875       cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
1876       cmpwi(CCR1, tmp2, static_cast<int>(vmIntrinsics::_compiledLambdaForm));
1877       cror(CCR0, Assembler::equal, CCR1, Assembler::equal);
1878       bne(CCR0, profile_continue);
1879     }
1880 
1881     profile_obj_type(ret, R28_mdx, -in_bytes(SingleTypeEntry::size()), tmp1, tmp2);
1882 
1883     align(32, 12);
1884     bind(profile_continue);
1885   }
1886 }
1887 
1888 void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2,
1889                                                         Register tmp3, Register tmp4) {
1890   if (ProfileInterpreter && MethodData::profile_parameters()) {
1891     Label profile_continue, done;
1892 
1893     test_method_data_pointer(profile_continue);
1894 
1895     // Load the offset of the area within the MDO used for
1896     // parameters. If it's negative we're not profiling any parameters.
1897     lwz(tmp1, in_bytes(MethodData::parameters_type_data_di_offset()) - in_bytes(MethodData::data_offset()), R28_mdx);
1898     cmpwi(CCR0, tmp1, 0);
1899     blt(CCR0, profile_continue);
1900 
1901     // Compute a pointer to the area for parameters from the offset
< prev index next >