src/cpu/sparc/vm/macroAssembler_sparc.cpp

Print this page




3581   set((-offset)+STACK_BIAS, Rscratch);
3582   st(G0, Rtsp, Rscratch);
3583   set(offset, Roffset);
3584   sub(Rsize, Roffset, Rsize);
3585   cmp(Rsize, G0);
3586   br(Assembler::greater, false, Assembler::pn, loop);
3587   delayed()->sub(Rtsp, Roffset, Rtsp);
3588 
3589   // Bang down shadow pages too.
3590   // At this point, (tmp-0) is the last address touched, so don't
3591   // touch it again.  (It was touched as (tmp-pagesize) but then tmp
3592   // was post-decremented.)  Skip this address by starting at i=1, and
3593   // touch a few more pages below.  N.B.  It is important to touch all
3594   // the way down to and including i=StackShadowPages.
3595   for (int i = 1; i < StackShadowPages; i++) {
3596     set((-i*offset)+STACK_BIAS, Rscratch);
3597     st(G0, Rtsp, Rscratch);
3598   }
3599 }
3600 


















3601 ///////////////////////////////////////////////////////////////////////////////////
3602 #if INCLUDE_ALL_GCS
3603 
3604 static address satb_log_enqueue_with_frame = NULL;
3605 static u_char* satb_log_enqueue_with_frame_end = NULL;
3606 
3607 static address satb_log_enqueue_frameless = NULL;
3608 static u_char* satb_log_enqueue_frameless_end = NULL;
3609 
3610 static int EnqueueCodeSize = 128 DEBUG_ONLY( + 256); // Instructions?
3611 
3612 static void generate_satb_log_enqueue(bool with_frame) {
3613   BufferBlob* bb = BufferBlob::create("enqueue_with_frame", EnqueueCodeSize);
3614   CodeBuffer buf(bb);
3615   MacroAssembler masm(&buf);
3616 
3617 #define __ masm.
3618 
3619   address start = __ pc();
3620   Register pre_val;




3581   set((-offset)+STACK_BIAS, Rscratch);
3582   st(G0, Rtsp, Rscratch);
3583   set(offset, Roffset);
3584   sub(Rsize, Roffset, Rsize);
3585   cmp(Rsize, G0);
3586   br(Assembler::greater, false, Assembler::pn, loop);
3587   delayed()->sub(Rtsp, Roffset, Rtsp);
3588 
3589   // Bang down shadow pages too.
3590   // At this point, (tmp-0) is the last address touched, so don't
3591   // touch it again.  (It was touched as (tmp-pagesize) but then tmp
3592   // was post-decremented.)  Skip this address by starting at i=1, and
3593   // touch a few more pages below.  N.B.  It is important to touch all
3594   // the way down to and including i=StackShadowPages.
3595   for (int i = 1; i < StackShadowPages; i++) {
3596     set((-i*offset)+STACK_BIAS, Rscratch);
3597     st(G0, Rtsp, Rscratch);
3598   }
3599 }
3600 
3601 void MacroAssembler::reserved_stack_check() {
3602   // testing if reserved zone needs to be enabled
3603   Label no_reserved_zone_enabling;
3604 
3605   ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G4_scratch);
3606   cmp_and_brx_short(SP, G4_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling);
3607 
3608   call_VM_leaf(L0, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread);
3609 
3610   AddressLiteral stub(StubRoutines::throw_delayed_StackOverflowError_entry());
3611   jump_to(stub, G4_scratch);
3612   delayed()->restore();
3613 
3614   should_not_reach_here();
3615 
3616   bind(no_reserved_zone_enabling);
3617 }
3618 
3619 ///////////////////////////////////////////////////////////////////////////////////
3620 #if INCLUDE_ALL_GCS
3621 
3622 static address satb_log_enqueue_with_frame = NULL;
3623 static u_char* satb_log_enqueue_with_frame_end = NULL;
3624 
3625 static address satb_log_enqueue_frameless = NULL;
3626 static u_char* satb_log_enqueue_frameless_end = NULL;
3627 
3628 static int EnqueueCodeSize = 128 DEBUG_ONLY( + 256); // Instructions?
3629 
3630 static void generate_satb_log_enqueue(bool with_frame) {
3631   BufferBlob* bb = BufferBlob::create("enqueue_with_frame", EnqueueCodeSize);
3632   CodeBuffer buf(bb);
3633   MacroAssembler masm(&buf);
3634 
3635 #define __ masm.
3636 
3637   address start = __ pc();
3638   Register pre_val;