1783 // ------------------
1784 // Fill in exception table entries.
1785 FillExceptionTables(inct_cnt, call_returns, inct_starts, blk_labels);
1786
1787 // Only java methods have exception handlers and deopt handlers
1788 // class HandlerImpl is platform-specific and defined in the *.ad files.
1789 if (C->method()) {
1790 if (C->failing()) {
1791 return; // CodeBuffer::expand failed
1792 }
1793 // Emit the deopt handler code.
1794 _code_offsets.set_value(CodeOffsets::Deopt, HandlerImpl::emit_deopt_handler(masm));
1795 }
1796
1797 // One last check for failed CodeBuffer::expand:
1798 if ((masm->code()->blob() == nullptr) || (!CompileBroker::should_compile_new_jobs())) {
1799 C->record_failure("CodeCache is full");
1800 return;
1801 }
1802
1803 #if defined(SUPPORT_ABSTRACT_ASSEMBLY) || defined(SUPPORT_ASSEMBLY) || defined(SUPPORT_OPTO_ASSEMBLY)
1804 if (C->print_assembly()) {
1805 tty->cr();
1806 tty->print_cr("============================= C2-compiled nmethod ==============================");
1807 }
1808 #endif
1809
1810 #if defined(SUPPORT_OPTO_ASSEMBLY)
1811 // Dump the assembly code, including basic-block numbers
1812 if (C->print_assembly()) {
1813 ttyLocker ttyl; // keep the following output all in one block
1814 if (!VMThread::should_terminate()) { // test this under the tty lock
1815 // print_metadata and dump_asm may safepoint which makes us loose the ttylock.
1816 // We call them first and write to a stringStream, then we retake the lock to
1817 // make sure the end tag is coherent, and that xmlStream->pop_tag is done thread safe.
1818 ResourceMark rm;
1819 stringStream method_metadata_str;
1820 if (C->method() != nullptr) {
1821 C->method()->print_metadata(&method_metadata_str);
1822 }
|
1783 // ------------------
1784 // Fill in exception table entries.
1785 FillExceptionTables(inct_cnt, call_returns, inct_starts, blk_labels);
1786
1787 // Only java methods have exception handlers and deopt handlers
1788 // class HandlerImpl is platform-specific and defined in the *.ad files.
1789 if (C->method()) {
1790 if (C->failing()) {
1791 return; // CodeBuffer::expand failed
1792 }
1793 // Emit the deopt handler code.
1794 _code_offsets.set_value(CodeOffsets::Deopt, HandlerImpl::emit_deopt_handler(masm));
1795 }
1796
1797 // One last check for failed CodeBuffer::expand:
1798 if ((masm->code()->blob() == nullptr) || (!CompileBroker::should_compile_new_jobs())) {
1799 C->record_failure("CodeCache is full");
1800 return;
1801 }
1802
1803 // FIXME: Count any trail in code section as non-real instructions.
1804 // masm->register_skipped(checked_cast<int>(masm->code()->insts_capacity() - masm->code()->insts_size()));
1805
1806 #if defined(SUPPORT_ABSTRACT_ASSEMBLY) || defined(SUPPORT_ASSEMBLY) || defined(SUPPORT_OPTO_ASSEMBLY)
1807 if (C->print_assembly()) {
1808 tty->cr();
1809 tty->print_cr("============================= C2-compiled nmethod ==============================");
1810 }
1811 #endif
1812
1813 #if defined(SUPPORT_OPTO_ASSEMBLY)
1814 // Dump the assembly code, including basic-block numbers
1815 if (C->print_assembly()) {
1816 ttyLocker ttyl; // keep the following output all in one block
1817 if (!VMThread::should_terminate()) { // test this under the tty lock
1818 // print_metadata and dump_asm may safepoint which makes us loose the ttylock.
1819 // We call them first and write to a stringStream, then we retake the lock to
1820 // make sure the end tag is coherent, and that xmlStream->pop_tag is done thread safe.
1821 ResourceMark rm;
1822 stringStream method_metadata_str;
1823 if (C->method() != nullptr) {
1824 C->method()->print_metadata(&method_metadata_str);
1825 }
|