Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/sharedRuntime_sparc.cpp @ 16657:ab59ee6c581b
[SPARC] Fix deoptimization fixup of return pc when called via the deoptimization entry
author | Stefan Anzinger <stefan.anzinger@gmail.com> |
---|---|
date | Wed, 30 Jul 2014 08:40:08 -0700 |
parents | 422eda5267b3 |
children | 4e3b63e7a9f6 |
comparison
equal
deleted
inserted
replaced
16656:5391f043d5f5 | 16657:ab59ee6c581b |
---|---|
3565 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words); | 3565 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words); |
3566 | 3566 |
3567 // Restore G2_thread | 3567 // Restore G2_thread |
3568 __ get_thread(); | 3568 __ get_thread(); |
3569 | 3569 |
3570 #ifdef GRAAL | |
3571 // load throwing pc from JavaThread and patch it as the return address | |
3572 // of the current frame. Then clear the field in JavaThread | |
3573 __ block_comment("load throwing pc and patch return"); | |
3574 Address exception_pc(G2_thread, JavaThread::exception_pc_offset()); | |
3575 Label has_no_pc; | |
3576 // TODO: Remove this weird check if we should patch the return pc | |
3577 // This is because when graal decides to deoptimize and the ExceptionHandlerStub.java | |
3578 // jumps back to this code and the I7 register contains the pc pointing to the begin | |
3579 // of this code. If this is the case (PC within a certain range) then we need to patch | |
3580 // the return pc. | |
3581 // THIS NEEDS REWORK! (sa) | |
3582 __ rdpc(L0); | |
3583 __ sub(L0, I7, L0); | |
3584 __ cmp(L0, 0xFFF); | |
3585 __ br(Assembler::greater, false, Assembler::pt, has_no_pc); | |
3586 __ delayed() -> nop(); | |
3587 __ cmp(L0, -0xFFF); | |
3588 __ br(Assembler::less, false, Assembler::pt, has_no_pc); | |
3589 __ delayed() -> nop(); | |
3590 __ ld_ptr(exception_pc, I7); | |
3591 __ sub(I7, 8, I7); | |
3592 __ st_ptr(G0, exception_pc); | |
3593 __ bind(has_no_pc); | |
3594 __ block_comment("/load throwing pc and patch return"); | |
3595 #endif // GAAL | |
3596 | |
3597 #ifdef ASSERT | 3570 #ifdef ASSERT |
3598 { | 3571 { |
3599 // verify that there is really an exception oop in exception_oop | 3572 // verify that there is really an exception oop in exception_oop |
3600 Label has_exception; | 3573 Label has_exception; |
3601 __ ld_ptr(G2_thread, JavaThread::exception_oop_offset(), Oexception); | 3574 __ ld_ptr(G2_thread, JavaThread::exception_oop_offset(), Oexception); |