Skip to content

Commit

Permalink
Comment and reword assert in Recompilation for jProfiling
Browse files Browse the repository at this point in the history
jProfiling should not use either sampling or counting to trip
recompilation. For this kind of method bodies, we have emitted
recompilation test to check method invocation count and loop
frequency against tuned threshold to trip recompilation.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
  • Loading branch information
r30shah committed Jul 13, 2018
1 parent 3cbbe5f commit 9163a4f
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 9163a4f

Please sign in to comment.