Skip to content

Commit 16d13ae

Browse files
authored
Merge pull request #21952 from r30shah/backport21938
(0.53) Disable System.nanoTime acceleration under AOT on Z
2 parents 7bed029 + 3751665 commit 16d13ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

runtime/compiler/z/codegen/J9CodeGenerator.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,13 @@ J9::Z::CodeGenerator::initialize()
228228
// Enable high-resolution timer for System.nanoTime() unless we need to support checkpointing (i.e. snapshot mode), which requires
229229
// that we adjust nanoTime() after restoring checkpoints. This adjustment is currently not implemented for the high res timer, hence
230230
// we need to stick to the Java nanoTime() implementation.
231-
if (!fej9->isSnapshotModeEnabled())
231+
// In case of generating a portable code, even though we would not suffer the same issue of adjustment required, in case such code is
232+
// used in application that will be checkpointed, it will suffer the same issue of unsupported nanoTime() adjustment for high res timer.
233+
// As currently Snapshot mode is available on Linux on Z only, disabling the acceleration on Linux when we are generating portable code.
234+
if (!(fej9->isSnapshotModeEnabled() || (comp->target().isLinux() && comp->compilePortableCode())))
235+
{
232236
cg->setSupportsCurrentTimeMaxPrecision();
237+
}
233238

234239
// Support BigDecimal Long Lookaside versioning optimizations.
235240
if (!comp->getOption(TR_DisableBDLLVersioning))

0 commit comments

Comments
 (0)