< prev index next >

src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp

Print this page

1727   // Pop the native method's interpreter frame.
1728   __ pop_interpreter_frame(Z_R14 /*return_pc*/, Z_ARG2/*tmp1*/, Z_ARG3/*tmp2*/);
1729 
1730   // Return to caller.
1731   __ z_br(Z_R14);
1732 
1733   if (inc_counter) {
1734     // Handle overflow of counter and compile method.
1735     __ bind(invocation_counter_overflow);
1736     generate_counter_overflow(continue_after_compile);
1737   }
1738 
1739   BLOCK_COMMENT("} native_entry");
1740 
1741   return entry_point;
1742 }
1743 
1744 //
1745 // Generic interpreted method entry to template interpreter.
1746 //
1747 address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
1748   address entry_point = __ pc();
1749 
1750   bool inc_counter = UseCompiler || CountCompiledCalls;
1751 
1752   // Interpreter entry for ordinary Java methods.
1753   //
1754   // Registers alive
1755   //   Z_SP       - stack pointer
1756   //   Z_thread   - JavaThread*
1757   //   Z_method   - callee's method (method to be invoked)
1758   //   Z_esp      - operand (or expression) stack pointer of caller. one slot above last arg.
1759   //   Z_R10      - sender sp (before modifications, e.g. by c2i adapter
1760   //                           and as well by generate_fixed_frame below)
1761   //   Z_R14      - return address to caller (call_stub or c2i_adapter)
1762   //
1763   // Registers updated
1764   //   Z_SP       - stack pointer
1765   //   Z_fp       - callee's framepointer
1766   //   Z_esp      - callee's operand stack pointer
1767   //                points to the slot above the value on top

1848   __ z_mvi(do_not_unlock_if_synchronized, false);
1849 
1850   // Check for synchronized methods.
1851   // Must happen AFTER invocation_counter check and stack overflow check,
1852   // so method is not locked if overflows.
1853   if (synchronized) {
1854     // Allocate monitor and lock method.
1855     lock_method();
1856   } else {
1857 #ifdef ASSERT
1858     { Label L;
1859       __ get_method(Z_R1_scratch);
1860       __ testbit_ushort(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
1861       __ z_bfalse(L);
1862       reentry = __ stop_chain_static(reentry, "method needs synchronization");
1863       __ bind(L);
1864     }
1865 #endif // ASSERT
1866   }
1867 






1868   // start execution
1869 
1870 #ifdef ASSERT
1871   __ verify_esp(Z_esp, Z_R1_scratch);
1872 #endif
1873 
1874   // jvmti support
1875   __ notify_method_entry();
1876 
1877   // Start executing instructions.
1878   __ dispatch_next(vtos);
1879   // Dispatch_next does not return.
1880   DEBUG_ONLY(__ should_not_reach_here());
1881 
1882   // Invocation counter overflow.
1883   if (inc_counter) {
1884     // Handle invocation counter overflow.
1885     __ bind(invocation_counter_overflow);
1886     generate_counter_overflow(Lcontinue);
1887   }

1727   // Pop the native method's interpreter frame.
1728   __ pop_interpreter_frame(Z_R14 /*return_pc*/, Z_ARG2/*tmp1*/, Z_ARG3/*tmp2*/);
1729 
1730   // Return to caller.
1731   __ z_br(Z_R14);
1732 
1733   if (inc_counter) {
1734     // Handle overflow of counter and compile method.
1735     __ bind(invocation_counter_overflow);
1736     generate_counter_overflow(continue_after_compile);
1737   }
1738 
1739   BLOCK_COMMENT("} native_entry");
1740 
1741   return entry_point;
1742 }
1743 
1744 //
1745 // Generic interpreted method entry to template interpreter.
1746 //
1747 address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized, bool object_init) {
1748   address entry_point = __ pc();
1749 
1750   bool inc_counter = UseCompiler || CountCompiledCalls;
1751 
1752   // Interpreter entry for ordinary Java methods.
1753   //
1754   // Registers alive
1755   //   Z_SP       - stack pointer
1756   //   Z_thread   - JavaThread*
1757   //   Z_method   - callee's method (method to be invoked)
1758   //   Z_esp      - operand (or expression) stack pointer of caller. one slot above last arg.
1759   //   Z_R10      - sender sp (before modifications, e.g. by c2i adapter
1760   //                           and as well by generate_fixed_frame below)
1761   //   Z_R14      - return address to caller (call_stub or c2i_adapter)
1762   //
1763   // Registers updated
1764   //   Z_SP       - stack pointer
1765   //   Z_fp       - callee's framepointer
1766   //   Z_esp      - callee's operand stack pointer
1767   //                points to the slot above the value on top

1848   __ z_mvi(do_not_unlock_if_synchronized, false);
1849 
1850   // Check for synchronized methods.
1851   // Must happen AFTER invocation_counter check and stack overflow check,
1852   // so method is not locked if overflows.
1853   if (synchronized) {
1854     // Allocate monitor and lock method.
1855     lock_method();
1856   } else {
1857 #ifdef ASSERT
1858     { Label L;
1859       __ get_method(Z_R1_scratch);
1860       __ testbit_ushort(method2_(Z_R1_scratch, access_flags), JVM_ACC_SYNCHRONIZED_BIT);
1861       __ z_bfalse(L);
1862       reentry = __ stop_chain_static(reentry, "method needs synchronization");
1863       __ bind(L);
1864     }
1865 #endif // ASSERT
1866   }
1867 
1868   // If object_init == true, we should insert a StoreStore barrier here to
1869   // prevent strict fields initial default values from being observable.
1870   // However, s390 is a TSO platform, so if `this` escapes, strict fields
1871   // initialized values are guaranteed to be the ones observed, so the
1872   // barrier can be elided.
1873 
1874   // start execution
1875 
1876 #ifdef ASSERT
1877   __ verify_esp(Z_esp, Z_R1_scratch);
1878 #endif
1879 
1880   // jvmti support
1881   __ notify_method_entry();
1882 
1883   // Start executing instructions.
1884   __ dispatch_next(vtos);
1885   // Dispatch_next does not return.
1886   DEBUG_ONLY(__ should_not_reach_here());
1887 
1888   // Invocation counter overflow.
1889   if (inc_counter) {
1890     // Handle invocation counter overflow.
1891     __ bind(invocation_counter_overflow);
1892     generate_counter_overflow(Lcontinue);
1893   }
< prev index next >