< prev index next >

src/cpu/s390/vm/macroAssembler_s390.cpp

Print this page
rev 12487 : 8172049: [s390] Implement "JEP 270: Reserved Stack Areas for Critical Sections".
Reviewed-by: mdoerr


2649     z_nilf(tmp2, mask);
2650     z_llgfr(tmp2, tmp2);
2651   }
2652 
2653   z_release();
2654   z_st(Z_R0, 0, tmp2, tmp1);
2655 }
2656 
2657 // Don't rely on register locking, always use Z_R1 as scratch register instead.
2658 void MacroAssembler::bang_stack_with_offset(int offset) {
2659   // Stack grows down, caller passes positive offset.
2660   assert(offset > 0, "must bang with positive offset");
2661   if (Displacement::is_validDisp(-offset)) {
2662     z_tmy(-offset, Z_SP, mask_stackbang);
2663   } else {
2664     add2reg(Z_R1, -offset, Z_SP);    // Do not destroy Z_SP!!!
2665     z_tm(0, Z_R1, mask_stackbang);  // Just banging.
2666   }
2667 }
2668 


























2669 // Defines obj, preserves var_size_in_bytes, okay for t2 == var_size_in_bytes.
2670 void MacroAssembler::tlab_allocate(Register obj,
2671                                    Register var_size_in_bytes,
2672                                    int con_size_in_bytes,
2673                                    Register t1,
2674                                    Label& slow_case) {
2675   assert_different_registers(obj, var_size_in_bytes, t1);
2676   Register end = t1;
2677   Register thread = Z_thread;
2678 
2679   z_lg(obj, Address(thread, JavaThread::tlab_top_offset()));
2680   if (var_size_in_bytes == noreg) {
2681     z_lay(end, Address(obj, con_size_in_bytes));
2682   } else {
2683     z_lay(end, Address(obj, var_size_in_bytes));
2684   }
2685   z_cg(end, Address(thread, JavaThread::tlab_end_offset()));
2686   branch_optimized(bcondHigh, slow_case);
2687 
2688   // Update the tlab top pointer.




2649     z_nilf(tmp2, mask);
2650     z_llgfr(tmp2, tmp2);
2651   }
2652 
2653   z_release();
2654   z_st(Z_R0, 0, tmp2, tmp1);
2655 }
2656 
2657 // Don't rely on register locking, always use Z_R1 as scratch register instead.
2658 void MacroAssembler::bang_stack_with_offset(int offset) {
2659   // Stack grows down, caller passes positive offset.
2660   assert(offset > 0, "must bang with positive offset");
2661   if (Displacement::is_validDisp(-offset)) {
2662     z_tmy(-offset, Z_SP, mask_stackbang);
2663   } else {
2664     add2reg(Z_R1, -offset, Z_SP);    // Do not destroy Z_SP!!!
2665     z_tm(0, Z_R1, mask_stackbang);  // Just banging.
2666   }
2667 }
2668 
2669 void MacroAssembler::reserved_stack_check(Register return_pc) {
2670   // Test if reserved zone needs to be enabled.
2671   Label no_reserved_zone_enabling;
2672   assert(return_pc == Z_R14, "Return pc must be in R14 before z_br() to StackOverflow stub.");
2673   BLOCK_COMMENT("reserved_stack_check {");
2674 
2675   z_clg(Z_SP, Address(Z_thread, JavaThread::reserved_stack_activation_offset()));
2676   z_brl(no_reserved_zone_enabling);
2677 
2678   // Enable reserved zone again, throw stack overflow exception.
2679   save_return_pc();
2680   push_frame_abi160(0);
2681   call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), Z_thread);
2682   pop_frame();
2683   restore_return_pc();
2684 
2685   load_const_optimized(Z_R1, StubRoutines::throw_delayed_StackOverflowError_entry());
2686   // Don't use call() or z_basr(), they will invalidate Z_R14 which contains the return pc.
2687   z_br(Z_R1);
2688 
2689   should_not_reach_here();
2690 
2691   bind(no_reserved_zone_enabling);
2692   BLOCK_COMMENT("} reserved_stack_check");
2693 }
2694 
2695 // Defines obj, preserves var_size_in_bytes, okay for t2 == var_size_in_bytes.
2696 void MacroAssembler::tlab_allocate(Register obj,
2697                                    Register var_size_in_bytes,
2698                                    int con_size_in_bytes,
2699                                    Register t1,
2700                                    Label& slow_case) {
2701   assert_different_registers(obj, var_size_in_bytes, t1);
2702   Register end = t1;
2703   Register thread = Z_thread;
2704 
2705   z_lg(obj, Address(thread, JavaThread::tlab_top_offset()));
2706   if (var_size_in_bytes == noreg) {
2707     z_lay(end, Address(obj, con_size_in_bytes));
2708   } else {
2709     z_lay(end, Address(obj, var_size_in_bytes));
2710   }
2711   z_cg(end, Address(thread, JavaThread::tlab_end_offset()));
2712   branch_optimized(bcondHigh, slow_case);
2713 
2714   // Update the tlab top pointer.


< prev index next >