Skip to content

Commit

Permalink
Merge pull request #2349 from r30shah/UseCountingRecompilationPR
Browse files Browse the repository at this point in the history
Comment and reword assert in Recompilation for jProfiling
  • Loading branch information
mpirvu committed Jul 13, 2018
2 parents aea43dc + 9163a4f commit 0f74948
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions runtime/compiler/control/J9Recompilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ J9::Recompilation::beforeOptimization()
//
if (self()->isProfilingCompilation()) // this asks the bodyInfo
{
// JProfiling should not use either sampling or counting mechanism to trip recompilation.
// Even though _useSampling is set to true here, at the end of compilation we disable sampling
// causing us to rely only on the in-body recompilation test that relies on block frequency counter
// to trip recompilation making sure we have enough profiling data to use in recompilation.
_useSampling = _compilation->getProfilingMode() != JitProfiling;
self()->findOrCreateProfileInfo()->setProfilingCount (DEFAULT_PROFILING_COUNT);
self()->findOrCreateProfileInfo()->setProfilingFrequency (DEFAULT_PROFILING_FREQUENCY);
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/p/codegen/PPCRecompilation.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2017 IBM Corp. and others
* Copyright (c) 2000, 2018 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -167,7 +167,7 @@ TR::Instruction *TR_PPCRecompilation::generatePrologue(TR::Instruction *cursor)
else
{
// This only applies to JitProfiling, as JProfiling uses sampling
TR_ASSERT(_compilation->getProfilingMode() == JitProfiling, "JProfiling should use sampling to trigger recompilation");
TR_ASSERT(_compilation->getProfilingMode() == JitProfiling, "JProfiling should not use counting mechanism to trip recompilation");

cursor = generateTrg1Src1ImmInstruction(cg(), TR::InstOpCode::cmpi4, firstNode, cr0, gr0, 0, cursor);
// this is just padding for consistent code length
Expand Down
4 changes: 2 additions & 2 deletions runtime/compiler/x/codegen/X86Recompilation.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2017 IBM Corp. and others
* Copyright (c) 2000, 2018 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -182,7 +182,7 @@ TR::Instruction *TR_X86Recompilation::generatePrologue(TR::Instruction *cursor)
else
{
// This only applies to JitProfiling, as JProfiling uses sampling
TR_ASSERT(_compilation->getProfilingMode() == JitProfiling, "JProfiling should use sampling to trigger recompilation");
TR_ASSERT(_compilation->getProfilingMode() == JitProfiling, "JProfiling should not use counting mechanism to trigger recompilation");
cursor = new (trHeapMemory()) TR::X86MemImmInstruction(cursor, CMP4MemImms, mRef, 0, cg());
}

Expand Down

0 comments on commit 0f74948

Please sign in to comment.