< prev index next >

src/hotspot/cpu/s390/sharedRuntime_s390.cpp

Print this page




1815   unsigned int wrapper_FrameDone;
1816   unsigned int wrapper_CRegsSet;
1817   Label     handle_pending_exception;
1818   Label     ic_miss;
1819 
1820   //---------------------------------------------------------------------
1821   // Unverified entry point (UEP)
1822   //---------------------------------------------------------------------
1823   wrapper_UEPStart = __ offset();
1824 
1825   // check ic: object class <-> cached class
1826   if (!method_is_static) __ nmethod_UEP(ic_miss);
1827   // Fill with nops (alignment of verified entry point).
1828   __ align(CodeEntryAlignment);
1829 
1830   //---------------------------------------------------------------------
1831   // Verified entry point (VEP)
1832   //---------------------------------------------------------------------
1833   wrapper_VEPStart = __ offset();
1834 
1835   if (VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier()) {
1836     Label L_skip_barrier;
1837     Register klass = Z_R1_scratch;
1838     // Notify OOP recorder (don't need the relocation)
1839     AddressLiteral md = __ constant_metadata_address(method->method_holder());
1840     __ load_const_optimized(klass, md.value());
1841     __ clinit_barrier(klass, Z_thread, &L_skip_barrier /*L_fast_path*/);
1842 
1843     __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub());
1844     __ z_br(klass);
1845 
1846     __ bind(L_skip_barrier);
1847   }
1848 
1849   __ save_return_pc();
1850   __ generate_stack_overflow_check(frame_size_in_bytes);  // Check before creating frame.
1851 #ifndef USE_RESIZE_FRAME
1852   __ push_frame(frame_size_in_bytes);                     // Create a new frame for the wrapper.
1853 #else
1854   __ resize_frame(-frame_size_in_bytes, Z_R0_scratch);    // No new frame for the wrapper.
1855                                                           // Just resize the existing one.
1856 #endif
1857 
1858   wrapper_FrameDone = __ offset();
1859 
1860   __ verify_thread();
1861 
1862   // Native nmethod wrappers never take possession of the oop arguments.
1863   // So the caller will gc the arguments.
1864   // The only thing we need an oopMap for is if the call is static.
1865   //
1866   // An OopMap for lock (and class if static), and one for the VM call itself
1867   OopMapSet  *oop_maps        = new OopMapSet();
1868   OopMap     *map             = new OopMap(stack_slots * 2, 0 /* arg_slots*/);


2693     // Check ic: object class <-> cached class
2694     // Compress cached class for comparison. That's more efficient.
2695     if (UseCompressedClassPointers) {
2696       __ z_lg(Z_R11, holder_klass_offset, Z_method);             // Z_R11 is overwritten a few instructions down anyway.
2697       __ compare_klass_ptr(Z_R11, klass_offset, Z_ARG1, false); // Cached class can't be zero.
2698     } else {
2699       __ z_clc(klass_offset, sizeof(void *)-1, Z_ARG1, holder_klass_offset, Z_method);
2700     }
2701     __ z_brne(ic_miss);  // Cache miss: call runtime to handle this.
2702 
2703     // This def MUST MATCH code in gen_c2i_adapter!
2704     const Register code = Z_R11;
2705 
2706     __ z_lg(Z_method, holder_metadata_offset, Z_method);
2707     __ load_and_test_long(Z_R0, method_(code));
2708     __ z_brne(ic_miss);  // Cache miss: call runtime to handle this.
2709 
2710     // Fallthru to VEP. Duplicate LTG, but saved taken branch.
2711   }
2712 
2713   address c2i_entry = __ pc();
2714 
2715   // Class initialization barrier for static methods
2716   if (VM_Version::supports_fast_class_init_checks()) {
2717     Label L_skip_barrier;
2718 
2719     { // Bypass the barrier for non-static methods
2720       __ testbit(Address(Z_method, Method::access_flags_offset()), JVM_ACC_STATIC_BIT);
2721       __ z_bfalse(L_skip_barrier); // non-static
2722     }
2723 
2724     Register klass = Z_R11;
2725     __ load_method_holder(klass, Z_method);
2726     __ clinit_barrier(klass, Z_thread, &L_skip_barrier /*L_fast_path*/);
2727 
2728     __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub());
2729     __ z_br(klass);
2730 
2731     __ bind(L_skip_barrier);
2732   }
2733 
2734   gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);
2735 
2736   return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
2737 }
2738 
2739 // This function returns the adjust size (in number of words) to a c2i adapter
2740 // activation for use during deoptimization.
2741 //
2742 // Actually only compiled frames need to be adjusted, but it
2743 // doesn't harm to adjust entry and interpreter frames, too.
2744 //
2745 int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals) {
2746   assert(callee_locals >= callee_parameters,
2747           "test and remove; got more parms than locals");
2748   // Handle the abi adjustment here instead of doing it in push_skeleton_frames.
2749   return (callee_locals - callee_parameters) * Interpreter::stackElementWords +
2750          frame::z_parent_ijava_frame_abi_size / BytesPerWord;
2751 }
2752 
2753 uint SharedRuntime::out_preserve_stack_slots() {
2754   return frame::z_jit_out_preserve_size/VMRegImpl::stack_slot_size;




1815   unsigned int wrapper_FrameDone;
1816   unsigned int wrapper_CRegsSet;
1817   Label     handle_pending_exception;
1818   Label     ic_miss;
1819 
1820   //---------------------------------------------------------------------
1821   // Unverified entry point (UEP)
1822   //---------------------------------------------------------------------
1823   wrapper_UEPStart = __ offset();
1824 
1825   // check ic: object class <-> cached class
1826   if (!method_is_static) __ nmethod_UEP(ic_miss);
1827   // Fill with nops (alignment of verified entry point).
1828   __ align(CodeEntryAlignment);
1829 
1830   //---------------------------------------------------------------------
1831   // Verified entry point (VEP)
1832   //---------------------------------------------------------------------
1833   wrapper_VEPStart = __ offset();
1834 














1835   __ save_return_pc();
1836   __ generate_stack_overflow_check(frame_size_in_bytes);  // Check before creating frame.
1837 #ifndef USE_RESIZE_FRAME
1838   __ push_frame(frame_size_in_bytes);                     // Create a new frame for the wrapper.
1839 #else
1840   __ resize_frame(-frame_size_in_bytes, Z_R0_scratch);    // No new frame for the wrapper.
1841                                                           // Just resize the existing one.
1842 #endif
1843 
1844   wrapper_FrameDone = __ offset();
1845 
1846   __ verify_thread();
1847 
1848   // Native nmethod wrappers never take possession of the oop arguments.
1849   // So the caller will gc the arguments.
1850   // The only thing we need an oopMap for is if the call is static.
1851   //
1852   // An OopMap for lock (and class if static), and one for the VM call itself
1853   OopMapSet  *oop_maps        = new OopMapSet();
1854   OopMap     *map             = new OopMap(stack_slots * 2, 0 /* arg_slots*/);


2679     // Check ic: object class <-> cached class
2680     // Compress cached class for comparison. That's more efficient.
2681     if (UseCompressedClassPointers) {
2682       __ z_lg(Z_R11, holder_klass_offset, Z_method);             // Z_R11 is overwritten a few instructions down anyway.
2683       __ compare_klass_ptr(Z_R11, klass_offset, Z_ARG1, false); // Cached class can't be zero.
2684     } else {
2685       __ z_clc(klass_offset, sizeof(void *)-1, Z_ARG1, holder_klass_offset, Z_method);
2686     }
2687     __ z_brne(ic_miss);  // Cache miss: call runtime to handle this.
2688 
2689     // This def MUST MATCH code in gen_c2i_adapter!
2690     const Register code = Z_R11;
2691 
2692     __ z_lg(Z_method, holder_metadata_offset, Z_method);
2693     __ load_and_test_long(Z_R0, method_(code));
2694     __ z_brne(ic_miss);  // Cache miss: call runtime to handle this.
2695 
2696     // Fallthru to VEP. Duplicate LTG, but saved taken branch.
2697   }
2698 
2699   address c2i_entry;
2700   c2i_entry = gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);




















2701 
2702   return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
2703 }
2704 
2705 // This function returns the adjust size (in number of words) to a c2i adapter
2706 // activation for use during deoptimization.
2707 //
2708 // Actually only compiled frames need to be adjusted, but it
2709 // doesn't harm to adjust entry and interpreter frames, too.
2710 //
2711 int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals) {
2712   assert(callee_locals >= callee_parameters,
2713           "test and remove; got more parms than locals");
2714   // Handle the abi adjustment here instead of doing it in push_skeleton_frames.
2715   return (callee_locals - callee_parameters) * Interpreter::stackElementWords +
2716          frame::z_parent_ijava_frame_abi_size / BytesPerWord;
2717 }
2718 
2719 uint SharedRuntime::out_preserve_stack_slots() {
2720   return frame::z_jit_out_preserve_size/VMRegImpl::stack_slot_size;


< prev index next >