Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute read barrier for constrained TX within the GS event handler #2790

Merged
merged 1 commit into from
Sep 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions runtime/vm/zcinterp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,26 @@ define({HANDLE_GS_EVENT_HELPER},{
define({HANDLE_GS_EVENT},{
BEGIN_FUNC($1)
dnl Test the TX bit of GSECI (bit 16) to see if the CPU was in transactional-
dnl execution mode when the guarded storage event was recognized. If this was
dnl the case do not execute the read barrier and simply return to the fallback
dnl transaction abort JIT code to handle it by forcing condition code to be 2
dnl with the below CL(G)FI instruction indicating a transitent transaction
dnl abort. See eclipse/openj9#2545 for more details.
dnl execution mode when the guarded storage event was recognized. At that point
dnl we have two cases:
dnl
dnl 1. TX was a non-constrained transaction:
dnl If this was the case do not execute the read barrier and simply return to
dnl the fallback transaction abort JIT code to handle it by forcing condition
dnl code to be 2 with the below CL(G)FI instruction indicating a transitent
dnl transaction abort.
dnl
dnl 2. TX was a constrained transaction:
dnl If this was the case then we are safe to execute the read barrier because
dnl the JIT has ensured that there will be no side-effects of the transaction
dnl being aborted prior to reaching the guarded storage event handler. In this
dnl case it is functionally safe to execute the read barrier.
dnl
dnl See eclipse/openj9#2545 and eclipse/openj9#2790 for more details.
TM J9TR_VMThread_gsParameters_GSECI(J9VMTHREAD),128
JZ LABEL_NAME(L_GS_CALLHELPER)
TM J9TR_VMThread_gsParameters_GSECI(J9VMTHREAD),64
JNZ LABEL_NAME(L_GS_CALLHELPER)
CLFI_GPR J9SP,0
J LABEL_NAME(L_GS_DONE)
PLACE_LABEL(L_GS_CALLHELPER)
Expand Down