comparison src/cpu/sparc/vm/sharedRuntime_sparc.cpp @ 16941:4e3b63e7a9f6

Fixing relock on interpreter when entering synchronized methods.
author Stefan Anzinger <stefan.anzinger@oracle.com>
date Mon, 25 Aug 2014 11:32:04 -0700
parents ab59ee6c581b
children 2d6dd2eebd51
comparison
equal deleted inserted replaced
16940:c01648e41410 16941:4e3b63e7a9f6
3431 // setup code generation tools 3431 // setup code generation tools
3432 int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code 3432 int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code
3433 if (UseStackBanging) { 3433 if (UseStackBanging) {
3434 pad += StackShadowPages*16 + 32; 3434 pad += StackShadowPages*16 + 32;
3435 } 3435 }
3436 #ifdef GRAAL
3437 pad += 32; // Increase the buffer size when compiling for GRAAL
3438 #endif
3436 #ifdef _LP64 3439 #ifdef _LP64
3437 CodeBuffer buffer("deopt_blob", 2100+pad, 512); 3440 CodeBuffer buffer("deopt_blob", 2100+pad, 512);
3438 #else 3441 #else
3439 // Measured 8/7/03 at 1212 in 32bit debug build (no VerifyThread) 3442 // Measured 8/7/03 at 1212 in 32bit debug build (no VerifyThread)
3440 // Measured 8/7/03 at 1396 in 32bit debug build (VerifyThread) 3443 // Measured 8/7/03 at 1396 in 32bit debug build (VerifyThread)
3565 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words); 3568 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
3566 3569
3567 // Restore G2_thread 3570 // Restore G2_thread
3568 __ get_thread(); 3571 __ get_thread();
3569 3572
3573 #ifdef GRAAL
3574 // load throwing pc from JavaThread and patch it as the return address
3575 // of the current frame. Then clear the field in JavaThread
3576 __ block_comment("load throwing pc and patch return");
3577 Address exception_pc(G2_thread, JavaThread::exception_pc_offset());
3578 Label has_no_pc;
3579 // TODO: Remove this weird check if we should patch the return pc
3580 // This is because when graal decides to deoptimize and the ExceptionHandlerStub.java
3581 // jumps back to this code and the I7 register contains the pc pointing to the begin
3582 // of this code. If this is the case (PC within a certain range) then we need to patch
3583 // the return pc.
3584 // THIS NEEDS REWORK! (sa)
3585 __ rdpc(L0);
3586 __ sub(L0, I7, L0);
3587 __ cmp(L0, 0xFFF);
3588 __ br(Assembler::greater, false, Assembler::pt, has_no_pc);
3589 __ delayed() -> nop();
3590 __ cmp(L0, -0xFFF);
3591 __ br(Assembler::less, false, Assembler::pt, has_no_pc);
3592 __ delayed() -> nop();
3593 __ ld_ptr(exception_pc, I7);
3594 __ sub(I7, 8, I7);
3595 __ st_ptr(G0, exception_pc);
3596 __ bind(has_no_pc);
3597 __ block_comment("/load throwing pc and patch return");
3598 #endif // GAAL
3599
3570 #ifdef ASSERT 3600 #ifdef ASSERT
3571 { 3601 {
3572 // verify that there is really an exception oop in exception_oop 3602 // verify that there is really an exception oop in exception_oop
3573 Label has_exception; 3603 Label has_exception;
3574 __ ld_ptr(G2_thread, JavaThread::exception_oop_offset(), Oexception); 3604 __ ld_ptr(G2_thread, JavaThread::exception_oop_offset(), Oexception);