Skip to content

Commit

Permalink
Merge pull request #1658 from babsingh/remove_dup_xrs_flag
Browse files Browse the repository at this point in the history
Remove duplicate flag (J9_SIG_XRS) and fix dependencies
  • Loading branch information
keithc-ca authored Apr 12, 2018
2 parents 3260e32 + e36e4e5 commit c92206f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
12 changes: 8 additions & 4 deletions runtime/compiler/trj9/control/J9Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2230,13 +2230,17 @@ bool J9::Options::feLatePostProcess(void * base, TR::OptionSet * optionSet)
doAOT = false;
}

// If the VM -Xrs option has been specified the user is requesting that
// we remove signals. Set the noResumableTrapHandler option to note this
// If the VM -Xrs or -Xrs:sync option has been specified the user is requesting
// that we remove signals. Set the noResumableTrapHandler option to note this
// request.
// Also disable the packed decimal part of DAA because some PD instructions
// trigger hardward exceptions. A new option has been added to disable traps
// trigger hardware exceptions. A new option has been added to disable traps
// Which allows the disabling of DAA and traps to be decoupled from the handler
if (javaVM->sigFlags & J9_SIG_XRS)
// Multiple variants of -Xrs option are available now:
// -Xrs Ignore all signals (J9_SIG_XRS_SYNC, J9_SIG_XRS_ASYNC)
// -Xrs:sync Ignore synchronous signals (J9_SIG_XRS_SYNC)
// -Xrs:async Ignore asynchronous signals (J9_SIG_XRS_ASYNC)
if (J9_ARE_ALL_BITS_SET(javaVM->sigFlags, J9_SIG_XRS_SYNC))
{
self()->setOption(TR_NoResumableTrapHandler);
self()->setOption(TR_DisablePackedDecimalIntrinsics);
Expand Down
4 changes: 2 additions & 2 deletions runtime/j9vm/jvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4477,7 +4477,7 @@ JVM_RaiseSignal(jint sigNum)

Trc_SC_RaiseSignal_Entry(sigNum);

if (J9_ARE_ALL_BITS_SET(javaVM->sigFlags, J9_SIG_XRS)
if (J9_ARE_ALL_BITS_SET(javaVM->sigFlags, J9_SIG_XRS_SYNC)
&& isSignalSpecial(sigNum)) {
/* Ignore signal */
} else {
Expand Down Expand Up @@ -4548,7 +4548,7 @@ JVM_RegisterSignal(jint sigNum, void* handler)
/* Don't allow user to register a native handler since
* the signal is already used by the VM.
*/
} else if (J9_ARE_NO_BITS_SET(javaVM->sigFlags, J9_SIG_XRS)
} else if (J9_ARE_NO_BITS_SET(javaVM->sigFlags, J9_SIG_XRS_SYNC)
&& isSignalSpecial(sigNum)) {
/* Don't allow user to register a native handler since
* the signal is already used by the VM.
Expand Down
2 changes: 1 addition & 1 deletion runtime/jcl/common/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ jobject getPropertyList(JNIEnv *env)
* we consider to be asynchronous signals.
* The JCLs do not install handlers for any synchronous signals */
strings[propIndex++] = "ibm.signalhandling.rs";
if (javaVM->sigFlags & J9_SIG_XRS_ASYNC) {
if (J9_ARE_ALL_BITS_SET(javaVM->sigFlags, J9_SIG_XRS_ASYNC)) {
strings[propIndex++] = "true";
} else {
strings[propIndex++] = "false";
Expand Down
1 change: 0 additions & 1 deletion runtime/oti/j9consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ extern "C" {
#define J9_SIG_NO_SIG_QUIT 0x1
#define J9_SIG_NO_SIG_CHAIN 0x4
#define J9_SIG_NO_SIG_INT 0x8
#define J9_SIG_XRS 0x10
#define J9_SIG_XRS_SYNC 0x10
#define J9_SIG_XRS_ASYNC 0x20
#define J9_SIG_ZOS_CEEHDLR 0x40
Expand Down
4 changes: 2 additions & 2 deletions runtime/vm/jvminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -5904,10 +5904,10 @@ setSignalOptions(J9JavaVM* vm)

GET_OPTION_VALUE(argIndex, ':', &optionValue);

if (optionValue && 0 == strcmp(optionValue, "sync")) {
if ((NULL != optionValue) && (0 == strcmp(optionValue, "sync"))) {
vm->sigFlags |= J9_SIG_XRS_SYNC;
sigOptions |= J9PORT_SIG_OPTIONS_REDUCED_SIGNALS_SYNCHRONOUS;
} else if (optionValue && 0 == strcmp(optionValue, "async")) {
} else if ((NULL != optionValue) && (0 == strcmp(optionValue, "async"))) {
vm->sigFlags |= (J9_SIG_XRS_ASYNC | J9_SIG_NO_SIG_QUIT);
sigOptions |= J9PORT_SIG_OPTIONS_REDUCED_SIGNALS_ASYNCHRONOUS;
} else {
Expand Down

0 comments on commit c92206f

Please sign in to comment.