Skip to content

Commit 57aef85

Browse files
committed
8301838: PPC: continuation yield intrinsic: exception check not needed if yield succeeded
Reviewed-by: lucy, goetz
1 parent df93880 commit 57aef85

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,34 +1980,38 @@ static void gen_continuation_yield(MacroAssembler* masm,
19801980

19811981
Label L_pinned;
19821982

1983-
__ cmpdi(CCR0, R3_RET, 0);
1983+
__ cmpwi(CCR0, R3_RET, 0);
19841984
__ bne(CCR0, L_pinned);
19851985

1986+
// yield succeeded
1987+
19861988
// Pop frames of continuation including this stub's frame
19871989
__ ld_ptr(R1_SP, JavaThread::cont_entry_offset(), R16_thread);
19881990
// The frame pushed by gen_continuation_enter is on top now again
19891991
continuation_enter_cleanup(masm);
19901992

1991-
__ bind(L_pinned); // pinned -- return to caller
1993+
// Pop frame and return
1994+
Label L_return;
1995+
__ bind(L_return);
1996+
__ pop_frame();
1997+
__ ld(R0, _abi0(lr), R1_SP); // Return pc
1998+
__ mtlr(R0);
1999+
__ blr();
2000+
2001+
// yield failed - continuation is pinned
2002+
2003+
__ bind(L_pinned);
19922004

19932005
// handle pending exception thrown by freeze
1994-
Label ok;
19952006
__ ld(tmp, in_bytes(JavaThread::pending_exception_offset()), R16_thread);
19962007
__ cmpdi(CCR0, tmp, 0);
1997-
__ beq(CCR0, ok);
2008+
__ beq(CCR0, L_return); // return if no exception is pending
19982009
__ pop_frame();
19992010
__ ld(R0, _abi0(lr), R1_SP); // Return pc
20002011
__ mtlr(R0);
20012012
__ load_const_optimized(tmp, StubRoutines::forward_exception_entry(), R0);
20022013
__ mtctr(tmp);
20032014
__ bctr();
2004-
__ bind(ok);
2005-
2006-
// Pop frame and return
2007-
__ pop_frame();
2008-
__ ld(R0, _abi0(lr), R1_SP); // Return pc
2009-
__ mtlr(R0);
2010-
__ blr();
20112015
}
20122016

20132017
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)