Skip to content

Commit 56fd9d6

Browse files
authored
Merge pull request #20255 from dsouzai/fixAOTTests_0.48
(0.48) Distinguish why AOT is disabled post-restore
2 parents ccc7390 + 82ad6d9 commit 56fd9d6

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

runtime/compiler/control/OptionsPostRestore.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ J9::OptionsPostRestore::invalidateCompiledMethodsIfNeeded(bool invalidateAll)
540540
}
541541

542542
void
543-
J9::OptionsPostRestore::disableAOTCompilation()
543+
J9::OptionsPostRestore::disableAOTCompilation(bool disabledPreCheckpoint)
544544
{
545545
static bool aotDisabled = false;
546546
if (aotDisabled)
@@ -567,7 +567,14 @@ J9::OptionsPostRestore::disableAOTCompilation()
567567
aotDisabled = true;
568568
_disableAOTPostRestore = true;
569569

570-
j9nls_printf(PORTLIB, (UDATA) J9NLS_WARNING, J9NLS_JIT_CHECKPOINT_RESTORE_AOT_DISABLED);
570+
if (disabledPreCheckpoint)
571+
{
572+
j9nls_printf(PORTLIB, (UDATA) J9NLS_WARNING, J9NLS_JIT_CHECKPOINT_RESTORE_AOT_DISABLED_PRE_CHECKPOINT);
573+
}
574+
else
575+
{
576+
j9nls_printf(PORTLIB, (UDATA) J9NLS_WARNING, J9NLS_JIT_CHECKPOINT_RESTORE_AOT_DISABLED);
577+
}
571578
}
572579

573580
void
@@ -834,8 +841,10 @@ J9::OptionsPostRestore::processCompilerOptions()
834841
J9JavaVM *vm = _jitConfig->javaVM;
835842
PORT_ACCESS_FROM_JAVAVM(vm);
836843

844+
bool aotEnabledPreCheckpoint = TR_J9SharedCache::aotHeaderValidationDelayed() ? true : TR::Options::sharedClassCache();
845+
837846
bool jitEnabled = TR::Options::canJITCompile();
838-
bool aotEnabled = TR_J9SharedCache::aotHeaderValidationDelayed() ? true : TR::Options::sharedClassCache();
847+
bool aotEnabled = aotEnabledPreCheckpoint;
839848

840849
_argIndexXjit = FIND_AND_CONSUME_RESTORE_ARG(OPTIONAL_LIST_MATCH, J9::Options::_externalOptionStrings[J9::ExternalOptions::Xjit], 0);
841850
_argIndexXnojit = FIND_AND_CONSUME_RESTORE_ARG(OPTIONAL_LIST_MATCH, J9::Options::_externalOptionStrings[J9::ExternalOptions::Xnojit], 0);
@@ -848,7 +857,7 @@ J9::OptionsPostRestore::processCompilerOptions()
848857
// If -Xnoaot was specified pre-checkpoint, there is a lot of infrastructure
849858
// that needs to be set up. For now, ignore -Xaot post-restore if -Xnoaot
850859
// was specified pre-checkpoint.
851-
if (aotEnabled)
860+
if (aotEnabledPreCheckpoint)
852861
aotEnabled = (_argIndexXaot >= _argIndexXnoaot);
853862

854863
if (!aotEnabled)
@@ -859,7 +868,7 @@ J9::OptionsPostRestore::processCompilerOptions()
859868
if (_disableAOTPostRestore)
860869
{
861870
aotEnabled = false;
862-
disableAOTCompilation();
871+
disableAOTCompilation(!aotEnabledPreCheckpoint);
863872
}
864873

865874
if (!jitEnabled)

runtime/compiler/control/OptionsPostRestore.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,11 @@ class OptionsPostRestore
119119

120120
/**
121121
* \brief Helper method to disable further AOT compilation.
122+
*
123+
* \param disabledPreCheckpoint bool to indicate whther AOT was disable post
124+
* restore or pre checkpoint.
122125
*/
123-
void disableAOTCompilation();
126+
void disableAOTCompilation(bool disabledPreCheckpoint = false);
124127

125128
/**
126129
* \brief Helper method to perform tasks prior to processing

runtime/nls/jitm/j9jit.nls

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,10 @@ J9NLS_JIT_OPTIONS_PERCENT_OUT_OF_RANGE.sample_input_1=-XX:codecachetotalMaxRAMPe
431431
J9NLS_JIT_OPTIONS_PERCENT_OUT_OF_RANGE.sample_input_2=0.8
432432
J9NLS_JIT_OPTIONS_PERCENT_OUT_OF_RANGE.sample_input_3=25
433433
# END NON-TRANSLATABLE
434+
435+
J9NLS_JIT_CHECKPOINT_RESTORE_AOT_DISABLED_PRE_CHECKPOINT=AOT load and compilation disabled pre-checkpoint and post-restore.
436+
# START NON-TRANSLATABLE
437+
J9NLS_JIT_CHECKPOINT_RESTORE_AOT_DISABLED_PRE_CHECKPOINT.explanation=The JVM was running in a mode pre-checkpoint that prevents AOT load and compilation.
438+
J9NLS_JIT_CHECKPOINT_RESTORE_AOT_DISABLED_PRE_CHECKPOINT.system_action=The compiler will not generate AOT code. AOT code from the shared class cache will not be used.
439+
J9NLS_JIT_CHECKPOINT_RESTORE_AOT_DISABLED_PRE_CHECKPOINT.user_response=Remove any (pre-checkpoint) option that would have resulted in this behaviour.
440+
# END NON-TRANSLATABLE

0 commit comments

Comments
 (0)