@@ -2297,7 +2297,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
22972297#ifdef DEBUG
22982298
22992299 const JitConfigValues::MethodSet* pfAltJit;
2300- if (jitFlags->IsSet (JitFlags::JIT_FLAG_PREJIT ))
2300+ if (jitFlags->IsSet (JitFlags::JIT_FLAG_AOT ))
23012301 {
23022302 pfAltJit = &JitConfig.AltJitNgen ();
23032303 }
@@ -2323,7 +2323,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
23232323#else // !DEBUG
23242324
23252325 const char * altJitVal;
2326- if (jitFlags->IsSet (JitFlags::JIT_FLAG_PREJIT ))
2326+ if (jitFlags->IsSet (JitFlags::JIT_FLAG_AOT ))
23272327 {
23282328 altJitVal = JitConfig.AltJitNgen ().list ();
23292329 }
@@ -2927,13 +2927,13 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
29272927 // Honour DOTNET_JitELTHookEnabled or STRESS_PROFILER_CALLBACKS stress mode
29282928 // only if VM has not asked us to generate profiler hooks in the first place.
29292929 // That is, override VM only if it hasn't asked for a profiler callback for this method.
2930- // Don't run this stress mode when pre-JITing , as we would need to emit a relocation
2930+ // Don't run this stress mode under AOT , as we would need to emit a relocation
29312931 // for the call to the fake ELT hook, which wouldn't make sense, as we can't store that
2932- // in the pre-JIT image.
2932+ // in the AOT image.
29332933 if (!compProfilerHookNeeded)
29342934 {
29352935 if ((JitConfig.JitELTHookEnabled () != 0 ) ||
2936- (!jitFlags->IsSet (JitFlags::JIT_FLAG_PREJIT ) && compStressCompile (STRESS_PROFILER_CALLBACKS, 5 )))
2936+ (!jitFlags->IsSet (JitFlags::JIT_FLAG_AOT ) && compStressCompile (STRESS_PROFILER_CALLBACKS, 5 )))
29372937 {
29382938 opts.compJitELTHookEnabled = true ;
29392939 }
@@ -3049,7 +3049,7 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
30493049
30503050 if (opts.compProcedureSplitting )
30513051 {
3052- // Note that opts.compdbgCode is true under ngen for checked assemblies!
3052+ // Note that opts.compDbgCode is true under AOT for checked assemblies!
30533053 opts.compProcedureSplitting = !opts.compDbgCode || enableFakeSplitting;
30543054
30553055#ifdef DEBUG
@@ -3155,9 +3155,9 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
31553155 printf (" OPTIONS: optimizer should use profile data\n " );
31563156 }
31573157
3158- if (jitFlags->IsSet (JitFlags::JIT_FLAG_PREJIT ))
3158+ if (jitFlags->IsSet (JitFlags::JIT_FLAG_AOT ))
31593159 {
3160- printf (" OPTIONS: Jit invoked for ngen \n " );
3160+ printf (" OPTIONS: Jit invoked for AOT \n " );
31613161 }
31623162 }
31633163#endif
@@ -3234,15 +3234,15 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
32343234
32353235bool Compiler::compJitHaltMethod ()
32363236{
3237- /* This method returns true when we use an INS_BREAKPOINT to allow us to step into the generated native code */
3238- /* Note that this these two "Jit" environment variables also work for ngen images */
3237+ // This method returns true when we use an INS_BREAKPOINT to allow us to step into the generated native code.
3238+ // Note that these two "Jit" environment variables also work for AOT images.
32393239
32403240 if (JitConfig.JitHalt ().contains (info.compMethodHnd , info.compClassHnd , &info.compMethodInfo ->args ))
32413241 {
32423242 return true ;
32433243 }
32443244
3245- /* Use this Hash variant when there are a lot of method with the same name and different signatures */
3245+ // Use this Hash variant when there are a lot of method with the same name and different signatures.
32463246
32473247 unsigned fJitHashHaltVal = (unsigned )JitConfig.JitHashHalt ();
32483248 if ((fJitHashHaltVal != (unsigned )-1 ) && (fJitHashHaltVal == info.compMethodHash ()))
@@ -3721,9 +3721,8 @@ void Compiler::compSetOptimizationLevel()
37213721 {
37223722 theMinOptsValue = true ;
37233723 }
3724- // For PREJIT we never drop down to MinOpts
3725- // unless unless CLFLG_MINOPT is set
3726- else if (!opts.jitFlags ->IsSet (JitFlags::JIT_FLAG_PREJIT))
3724+ // For AOT we never drop down to MinOpts unless unless CLFLG_MINOPT is set
3725+ else if (!IsAot ())
37273726 {
37283727 if ((unsigned )JitConfig.JitMinOptsCodeSize () < info.compILCodeSize )
37293728 {
@@ -3763,10 +3762,9 @@ void Compiler::compSetOptimizationLevel()
37633762 }
37643763 }
37653764#else // !DEBUG
3766- // Retail check if we should force Minopts due to the complexity of the method
3767- // For PREJIT we never drop down to MinOpts
3768- // unless unless CLFLG_MINOPT is set
3769- if (!theMinOptsValue && !opts.jitFlags ->IsSet (JitFlags::JIT_FLAG_PREJIT) &&
3765+ // Retail check if we should force Minopts due to the complexity of the method.
3766+ // For AOT we never drop down to MinOpts unless unless CLFLG_MINOPT is set.
3767+ if (!theMinOptsValue && !IsAot () &&
37703768 ((DEFAULT_MIN_OPTS_CODE_SIZE < info.compILCodeSize ) || (DEFAULT_MIN_OPTS_INSTR_COUNT < opts.instrCount ) ||
37713769 (DEFAULT_MIN_OPTS_BB_COUNT < fgBBcount) || (DEFAULT_MIN_OPTS_LV_NUM_COUNT < lvaCount) ||
37723770 (DEFAULT_MIN_OPTS_LV_REF_COUNT < opts.lvRefCount )))
@@ -3835,14 +3833,13 @@ void Compiler::compSetOptimizationLevel()
38353833 codeGen->setFrameRequired (true );
38363834#endif
38373835
3838- if (opts.OptimizationDisabled () ||
3839- (opts.jitFlags ->IsSet (JitFlags::JIT_FLAG_PREJIT) && !IsTargetAbi (CORINFO_NATIVEAOT_ABI)))
3836+ if (opts.OptimizationDisabled () || IsReadyToRun ())
38403837 {
3841- // The JIT doesn't currently support loop alignment for prejitted images outside NativeAOT.
3838+ // The JIT doesn't currently support loop alignment for AOT images outside NativeAOT.
38423839 // (The JIT doesn't know the final address of the code, hence
38433840 // it can't align code based on unknown addresses.)
38443841
3845- codeGen->SetAlignLoops (false ); // loop alignment not supported for prejitted code
3842+ codeGen->SetAlignLoops (false ); // loop alignment not supported for AOT code
38463843 }
38473844 else
38483845 {
@@ -6677,11 +6674,11 @@ void Compiler::compCompileFinish()
66776674 }
66786675#endif // TRACK_ENREG_STATS
66796676
6680- // Only call _DbgBreakCheck when we are jitting, not when we are ngen-ing
6681- // For ngen the int3 or breakpoint instruction will be right at the
6682- // start of the ngen method and we will stop when we execute it.
6677+ // Only call _DbgBreakCheck when we are jitting, not when we are generating AOT code.
6678+ // For AOT the int3 or breakpoint instruction will be right at the
6679+ // start of the AOT method and we will stop when we execute it.
66836680 //
6684- if (!opts. jitFlags -> IsSet (JitFlags::JIT_FLAG_PREJIT ))
6681+ if (!IsAot ( ))
66856682 {
66866683 if (compJitHaltMethod ())
66876684 {
@@ -6948,9 +6945,9 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
69486945
69496946 const bool forceInline = !!(info.compFlags & CORINFO_FLG_FORCEINLINE);
69506947
6951- if (!compIsForInlining () && opts. jitFlags -> IsSet (JitFlags::JIT_FLAG_PREJIT ))
6948+ if (!compIsForInlining () && IsAot ( ))
69526949 {
6953- // We're prejitting the root method. We also will analyze it as
6950+ // We're AOT compiling the root method. We also will analyze it as
69546951 // a potential inline candidate.
69556952 InlineResult prejitResult (this , info.compMethodHnd , " prejit" );
69566953
0 commit comments