@@ -375,7 +375,9 @@ char * J9::Options::_externalOptionStrings[J9::ExternalOptions::TR_NumExternalOp
375
375
" -XX:codecachetotalMaxRAMPercentage=" , // = 67
376
376
" -XX:+JITServerAOTCacheDelayMethodRelocation" , // = 68
377
377
" -XX:-JITServerAOTCacheDelayMethodRelocation" , // = 69
378
- // TR_NumExternalOptions = 70
378
+ " -XX:+IProfileDuringStartupPhase" , // = 70
379
+ " -XX:-IProfileDuringStartupPhase" , // = 71
380
+ // TR_NumExternalOptions = 72
379
381
};
380
382
381
383
// ************************************************************************
@@ -3142,25 +3144,38 @@ bool J9::Options::feLatePostProcess(void * base, TR::OptionSet * optionSet)
3142
3144
}
3143
3145
else // do AOT
3144
3146
{
3145
- if (!self ()->getOption (TR_DisablePersistIProfile))
3147
+ // Turn off Iprofiler for the warm runs, but not if we cache only bootstrap classes
3148
+ // This is because we may be missing IProfiler information for non-bootstrap classes
3149
+ // that could not be stored in SCC
3150
+ if (!self ()->getOption (TR_DisablePersistIProfile) &&
3151
+ J9_ARE_ALL_BITS_SET (javaVM->sharedClassConfig ->runtimeFlags , J9SHR_RUNTIMEFLAG_ENABLE_CACHE_NON_BOOT_CLASSES))
3146
3152
{
3147
- // Turn off Iprofiler for the warm runs, but not if we cache only bootstrap classes
3148
- // This is because we may be missing IProfiler information for non-bootstrap classes
3149
- // that could not be stored in SCC
3150
- if (J9_ARE_ALL_BITS_SET (javaVM->sharedClassConfig ->runtimeFlags , J9SHR_RUNTIMEFLAG_ENABLE_CACHE_NON_BOOT_CLASSES))
3153
+ TR::CompilationInfo * compInfo = getCompilationInfo (jitConfig);
3154
+ if (compInfo->isWarmSCC () == TR_yes)
3151
3155
{
3152
- TR::CompilationInfo * compInfo = getCompilationInfo (jitConfig);
3153
- static char * dnipdsp = feGetEnv (" TR_DisableNoIProfilerDuringStartupPhase" );
3154
- if (compInfo->isWarmSCC () == TR_yes && !dnipdsp)
3155
- {
3156
- self ()->setOption (TR_NoIProfilerDuringStartupPhase);
3157
- }
3156
+ self ()->setOption (TR_NoIProfilerDuringStartupPhase);
3158
3157
}
3159
3158
}
3160
3159
}
3161
3160
}
3162
3161
#endif
3163
3162
3163
+ // The use of -XX:[+/-]IProfileDuringStartupPhase sets if we always/never IProfile
3164
+ // during the startup phase
3165
+ {
3166
+ // The FIND_ARG_IN_VMARGS macro expect the J9JavaVM to be in the `vm` variable, instead of `javaVM`
3167
+ // The method uses the `vm` variable for the TR_J9VMBase
3168
+ J9JavaVM * vm = javaVM;
3169
+ const char *xxIProfileDuringStartupPhase = J9::Options::_externalOptionStrings[J9::ExternalOptions::XXplusIProfileDuringStartupPhase];
3170
+ const char *xxDisableIProfileDuringStartupPhase = J9::Options::_externalOptionStrings[J9::ExternalOptions::XXminusIProfileDuringStartupPhase];
3171
+ int32_t xxIProfileDuringStartupPhaseArgIndex = FIND_ARG_IN_VMARGS (EXACT_MATCH, xxIProfileDuringStartupPhase, 0 );
3172
+ int32_t xxDisableIProfileDuringStartupPhaseArgIndex = FIND_ARG_IN_VMARGS (EXACT_MATCH, xxDisableIProfileDuringStartupPhase, 0 );
3173
+ if (xxIProfileDuringStartupPhaseArgIndex > xxDisableIProfileDuringStartupPhaseArgIndex)
3174
+ self ()->setOption (TR_NoIProfilerDuringStartupPhase, false ); // Override -Xjit:noIProfilerDuringStartupPhase
3175
+ else if (xxDisableIProfileDuringStartupPhaseArgIndex >= 0 )
3176
+ self ()->setOption (TR_NoIProfilerDuringStartupPhase);
3177
+ }
3178
+
3164
3179
// Divide by 0 checks
3165
3180
if (TR::Options::_LoopyMethodDivisionFactor == 0 )
3166
3181
TR::Options::_LoopyMethodDivisionFactor = 16 ; // Reset it back to the default value
0 commit comments