summaryrefslogtreecommitdiff
path: root/src/zap
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@users.noreply.github.com>2018-10-03 08:52:40 -0700
committerGitHub <noreply@github.com>2018-10-03 08:52:40 -0700
commitb68296ce2c56188cf2a7bd263903e27c67717702 (patch)
tree3c535c8fe4f92d91fc590a6cd25731ed5b222f25 /src/zap
parent50567db6e3851f4c4680771424a354e2258333b4 (diff)
downloadcoreclr-b68296ce2c56188cf2a7bd263903e27c67717702.tar.gz
coreclr-b68296ce2c56188cf2a7bd263903e27c67717702.tar.bz2
coreclr-b68296ce2c56188cf2a7bd263903e27c67717702.zip
Add MethodImplOptions.AggressiveOptimization and use it for tiering (#20009)
Add MethodImplOptions.AggressiveOptimization and use it for tiering Part of fix for https://github.com/dotnet/corefx/issues/32235 Workaround for https://github.com/dotnet/coreclr/issues/19751 - Added and set CORJIT_FLAG_AGGRESSIVE_OPT to indicate that a method is flagged with AggressiveOptimization - For a method flagged with AggressiveOptimization, tiering uses a foreground tier 1 JIT on first call to the method, skipping the tier 0 JIT and call counting - When tiering is disabled, a method flagged with AggressiveOptimization does not use r2r-pregenerated code - R2r crossgen does not generate code for a method flagged with AggressiveOptimization
Diffstat (limited to 'src/zap')
-rw-r--r--src/zap/zapinfo.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp
index 7320729dec..341e0d82af 100644
--- a/src/zap/zapinfo.cpp
+++ b/src/zap/zapinfo.cpp
@@ -435,6 +435,15 @@ void ZapInfo::CompileMethod()
// this they can add the hint and reduce the perf cost at runtime.
m_pImage->m_pPreloader->PrePrepareMethodIfNecessary(m_currentMethodHandle);
+ DWORD methodAttribs = getMethodAttribs(m_currentMethodHandle);
+ if (methodAttribs & CORINFO_FLG_AGGRESSIVE_OPT)
+ {
+ // Skip methods marked with MethodImplOptions.AggressiveOptimization, they will be jitted instead. In the future,
+ // consider letting the JIT determine whether aggressively optimized code can/should be pregenerated for the method
+ // instead of this check.
+ return;
+ }
+
m_jitFlags = ComputeJitFlags(m_currentMethodHandle);
#ifdef FEATURE_READYTORUN_COMPILER
@@ -443,7 +452,6 @@ void ZapInfo::CompileMethod()
// READYTORUN: FUTURE: Producedure spliting
m_jitFlags.Clear(CORJIT_FLAGS::CORJIT_FLAG_PROCSPLIT);
- DWORD methodAttribs = getMethodAttribs(m_currentMethodHandle);
if (!(methodAttribs & CORINFO_FLG_NOSECURITYWRAP) || (methodAttribs & CORINFO_FLG_SECURITYCHECK))
{
m_zapper->Warning(W("ReadyToRun: Methods with security checks not supported\n"));