1753 __ push_ptr();
1754 __ j(L);
1755 fep = __ pc(); // ftos entry point
1756 __ push_f();
1757 __ j(L);
1758 dep = __ pc(); // dtos entry point
1759 __ push_d();
1760 __ j(L);
1761 lep = __ pc(); // ltos entry point
1762 __ push_l();
1763 __ j(L);
1764 bep = cep = sep = iep = __ pc(); // [bcsi]tos entry point
1765 __ push_i();
1766 vep = __ pc(); // vtos entry point
1767 __ bind(L);
1768 generate_and_dispatch(t);
1769 }
1770
1771 //-----------------------------------------------------------------------------
1772
1773 // Non-product code
1774 #ifndef PRODUCT
1775 address TemplateInterpreterGenerator::generate_trace_code(TosState state) {
1776 address entry = __ pc();
1777
1778 __ push_reg(ra);
1779 __ push(state);
1780 __ push_reg(RegSet::range(x10, x17) + RegSet::range(x5, x7) + RegSet::range(x28, x31), sp);
1781 __ mv(c_rarg2, x10); // Pass itos
1782 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::trace_bytecode), c_rarg1, c_rarg2, c_rarg3);
1783 __ pop_reg(RegSet::range(x10, x17) + RegSet::range(x5, x7) + RegSet::range(x28, x31), sp);
1784 __ pop(state);
1785 __ pop_reg(ra);
1786 __ ret(); // return from result handler
1787
1788 return entry;
1789 }
1790
1791 void TemplateInterpreterGenerator::count_bytecode() {
1792 __ mv(x7, (address) &BytecodeCounter::_counter_value);
1793 __ atomic_addw(noreg, 1, x7);
1794 }
1795
1796 void TemplateInterpreterGenerator::histogram_bytecode(Template* t) {
1797 __ mv(x7, (address) &BytecodeHistogram::_counters[t->bytecode()]);
1798 __ atomic_addw(noreg, 1, x7);
1799 }
1800
1801 void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
1802 // Calculate new index for counter:
1803 // _index = (_index >> log2_number_of_codes) |
1804 // (bytecode << log2_number_of_codes);
1805 Register index_addr = t1;
1806 Register index = t0;
1807 __ mv(index_addr, (address) &BytecodePairHistogram::_index);
1808 __ lw(index, index_addr);
1809 __ mv(x7, ((int)t->bytecode()) << BytecodePairHistogram::log2_number_of_codes);
1810 __ srli(index, index, BytecodePairHistogram::log2_number_of_codes);
1811 __ orrw(index, x7, index);
1812 __ sw(index, index_addr);
1813 // Bump bucket contents:
1814 // _counters[_index] ++;
1815 Register counter_addr = t1;
1816 __ mv(x7, (address) &BytecodePairHistogram::_counters);
1817 __ shadd(counter_addr, index, x7, counter_addr, LogBytesPerInt);
1818 __ atomic_addw(noreg, 1, counter_addr);
1819 }
1820
|
1753 __ push_ptr();
1754 __ j(L);
1755 fep = __ pc(); // ftos entry point
1756 __ push_f();
1757 __ j(L);
1758 dep = __ pc(); // dtos entry point
1759 __ push_d();
1760 __ j(L);
1761 lep = __ pc(); // ltos entry point
1762 __ push_l();
1763 __ j(L);
1764 bep = cep = sep = iep = __ pc(); // [bcsi]tos entry point
1765 __ push_i();
1766 vep = __ pc(); // vtos entry point
1767 __ bind(L);
1768 generate_and_dispatch(t);
1769 }
1770
1771 //-----------------------------------------------------------------------------
1772
1773 void TemplateInterpreterGenerator::count_bytecode() {
1774 __ mv(x7, (address) &BytecodeCounter::_counter_value);
1775 __ atomic_addw(noreg, 1, x7);
1776 }
1777
1778 void TemplateInterpreterGenerator::histogram_bytecode(Template* t) {
1779 __ mv(x7, (address) &BytecodeHistogram::_counters[t->bytecode()]);
1780 __ atomic_addw(noreg, 1, x7);
1781 }
1782
1783 // Non-product code
1784 #ifndef PRODUCT
1785 address TemplateInterpreterGenerator::generate_trace_code(TosState state) {
1786 address entry = __ pc();
1787
1788 __ push_reg(ra);
1789 __ push(state);
1790 __ push_reg(RegSet::range(x10, x17) + RegSet::range(x5, x7) + RegSet::range(x28, x31), sp);
1791 __ mv(c_rarg2, x10); // Pass itos
1792 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::trace_bytecode), c_rarg1, c_rarg2, c_rarg3);
1793 __ pop_reg(RegSet::range(x10, x17) + RegSet::range(x5, x7) + RegSet::range(x28, x31), sp);
1794 __ pop(state);
1795 __ pop_reg(ra);
1796 __ ret(); // return from result handler
1797
1798 return entry;
1799 }
1800
1801 void TemplateInterpreterGenerator::histogram_bytecode_pair(Template* t) {
1802 // Calculate new index for counter:
1803 // _index = (_index >> log2_number_of_codes) |
1804 // (bytecode << log2_number_of_codes);
1805 Register index_addr = t1;
1806 Register index = t0;
1807 __ mv(index_addr, (address) &BytecodePairHistogram::_index);
1808 __ lw(index, index_addr);
1809 __ mv(x7, ((int)t->bytecode()) << BytecodePairHistogram::log2_number_of_codes);
1810 __ srli(index, index, BytecodePairHistogram::log2_number_of_codes);
1811 __ orrw(index, x7, index);
1812 __ sw(index, index_addr);
1813 // Bump bucket contents:
1814 // _counters[_index] ++;
1815 Register counter_addr = t1;
1816 __ mv(x7, (address) &BytecodePairHistogram::_counters);
1817 __ shadd(counter_addr, index, x7, counter_addr, LogBytesPerInt);
1818 __ atomic_addw(noreg, 1, counter_addr);
1819 }
1820
|