diff options
Diffstat (limited to 'src/jit/inline.cpp')
-rw-r--r-- | src/jit/inline.cpp | 396 |
1 files changed, 178 insertions, 218 deletions
diff --git a/src/jit/inline.cpp b/src/jit/inline.cpp index f813427220..deccc0e84b 100644 --- a/src/jit/inline.cpp +++ b/src/jit/inline.cpp @@ -11,8 +11,7 @@ // Lookup table for inline description strings -static const char* InlineDescriptions[] = -{ +static const char* InlineDescriptions[] = { #define INLINE_OBSERVATION(name, type, description, impact, target) description, #include "inline.def" #undef INLINE_OBSERVATION @@ -20,8 +19,7 @@ static const char* InlineDescriptions[] = // Lookup table for inline targets -static const InlineTarget InlineTargets[] = -{ +static const InlineTarget InlineTargets[] = { #define INLINE_OBSERVATION(name, type, description, impact, target) InlineTarget::target, #include "inline.def" #undef INLINE_OBSERVATION @@ -29,8 +27,7 @@ static const InlineTarget InlineTargets[] = // Lookup table for inline impacts -static const InlineImpact InlineImpacts[] = -{ +static const InlineImpact InlineImpacts[] = { #define INLINE_OBSERVATION(name, type, description, impact, target) InlineImpact::impact, #include "inline.def" #undef INLINE_OBSERVATION @@ -49,8 +46,7 @@ static const InlineImpact InlineImpacts[] = bool InlIsValidObservation(InlineObservation obs) { - return((obs > InlineObservation::CALLEE_UNUSED_INITIAL) && - (obs < InlineObservation::CALLEE_UNUSED_FINAL)); + return ((obs > InlineObservation::CALLEE_UNUSED_INITIAL) && (obs < InlineObservation::CALLEE_UNUSED_FINAL)); } #endif // DEBUG @@ -99,14 +95,14 @@ const char* InlGetTargetString(InlineObservation obs) InlineTarget t = InlGetTarget(obs); switch (t) { - case InlineTarget::CALLER: - return "caller"; - case InlineTarget::CALLEE: - return "callee"; - case InlineTarget::CALLSITE: - return "call site"; - default: - return "unexpected target"; + case InlineTarget::CALLER: + return "caller"; + case InlineTarget::CALLEE: + return "callee"; + case InlineTarget::CALLSITE: + return "call site"; + default: + return "unexpected target"; } } @@ -139,18 +135,18 @@ const char* InlGetImpactString(InlineObservation obs) InlineImpact i = InlGetImpact(obs); switch (i) { - case InlineImpact::FATAL: - return "correctness -- fatal"; - case InlineImpact::FUNDAMENTAL: - return "correctness -- fundamental limitation"; - case InlineImpact::LIMITATION: - return "correctness -- jit limitation"; - case InlineImpact::PERFORMANCE: - return "performance"; - case InlineImpact::INFORMATION: - return "information"; - default: - return "unexpected impact"; + case InlineImpact::FATAL: + return "correctness -- fatal"; + case InlineImpact::FUNDAMENTAL: + return "correctness -- fundamental limitation"; + case InlineImpact::LIMITATION: + return "correctness -- jit limitation"; + case InlineImpact::PERFORMANCE: + return "performance"; + case InlineImpact::INFORMATION: + return "information"; + default: + return "unexpected impact"; } } @@ -165,16 +161,17 @@ const char* InlGetImpactString(InlineObservation obs) CorInfoInline InlGetCorInfoInlineDecision(InlineDecision d) { - switch (d) { - case InlineDecision::SUCCESS: - return INLINE_PASS; - case InlineDecision::FAILURE: - return INLINE_FAIL; - case InlineDecision::NEVER: - return INLINE_NEVER; - default: - assert(!"Unexpected InlineDecision"); - unreached(); + switch (d) + { + case InlineDecision::SUCCESS: + return INLINE_PASS; + case InlineDecision::FAILURE: + return INLINE_FAIL; + case InlineDecision::NEVER: + return INLINE_NEVER; + default: + assert(!"Unexpected InlineDecision"); + unreached(); } } @@ -189,20 +186,21 @@ CorInfoInline InlGetCorInfoInlineDecision(InlineDecision d) const char* InlGetDecisionString(InlineDecision d) { - switch (d) { - case InlineDecision::SUCCESS: - return "success"; - case InlineDecision::FAILURE: - return "failed this call site"; - case InlineDecision::NEVER: - return "failed this callee"; - case InlineDecision::CANDIDATE: - return "candidate"; - case InlineDecision::UNDECIDED: - return "undecided"; - default: - assert(!"Unexpected InlineDecision"); - unreached(); + switch (d) + { + case InlineDecision::SUCCESS: + return "success"; + case InlineDecision::FAILURE: + return "failed this call site"; + case InlineDecision::NEVER: + return "failed this callee"; + case InlineDecision::CANDIDATE: + return "candidate"; + case InlineDecision::UNDECIDED: + return "undecided"; + default: + assert(!"Unexpected InlineDecision"); + unreached(); } } @@ -217,17 +215,18 @@ const char* InlGetDecisionString(InlineDecision d) bool InlDecisionIsFailure(InlineDecision d) { - switch (d) { - case InlineDecision::SUCCESS: - case InlineDecision::UNDECIDED: - case InlineDecision::CANDIDATE: - return false; - case InlineDecision::FAILURE: - case InlineDecision::NEVER: - return true; - default: - assert(!"Unexpected InlineDecision"); - unreached(); + switch (d) + { + case InlineDecision::SUCCESS: + case InlineDecision::UNDECIDED: + case InlineDecision::CANDIDATE: + return false; + case InlineDecision::FAILURE: + case InlineDecision::NEVER: + return true; + default: + assert(!"Unexpected InlineDecision"); + unreached(); } } @@ -242,17 +241,18 @@ bool InlDecisionIsFailure(InlineDecision d) bool InlDecisionIsSuccess(InlineDecision d) { - switch (d) { - case InlineDecision::SUCCESS: - return true; - case InlineDecision::FAILURE: - case InlineDecision::NEVER: - case InlineDecision::UNDECIDED: - case InlineDecision::CANDIDATE: - return false; - default: - assert(!"Unexpected InlineDecision"); - unreached(); + switch (d) + { + case InlineDecision::SUCCESS: + return true; + case InlineDecision::FAILURE: + case InlineDecision::NEVER: + case InlineDecision::UNDECIDED: + case InlineDecision::CANDIDATE: + return false; + default: + assert(!"Unexpected InlineDecision"); + unreached(); } } @@ -267,17 +267,18 @@ bool InlDecisionIsSuccess(InlineDecision d) bool InlDecisionIsNever(InlineDecision d) { - switch (d) { - case InlineDecision::NEVER: - return true; - case InlineDecision::FAILURE: - case InlineDecision::SUCCESS: - case InlineDecision::UNDECIDED: - case InlineDecision::CANDIDATE: - return false; - default: - assert(!"Unexpected InlineDecision"); - unreached(); + switch (d) + { + case InlineDecision::NEVER: + return true; + case InlineDecision::FAILURE: + case InlineDecision::SUCCESS: + case InlineDecision::UNDECIDED: + case InlineDecision::CANDIDATE: + return false; + default: + assert(!"Unexpected InlineDecision"); + unreached(); } } @@ -306,17 +307,18 @@ bool InlDecisionIsCandidate(InlineDecision d) bool InlDecisionIsDecided(InlineDecision d) { - switch (d) { - case InlineDecision::NEVER: - case InlineDecision::FAILURE: - case InlineDecision::SUCCESS: - return true; - case InlineDecision::UNDECIDED: - case InlineDecision::CANDIDATE: - return false; - default: - assert(!"Unexpected InlineDecision"); - unreached(); + switch (d) + { + case InlineDecision::NEVER: + case InlineDecision::FAILURE: + case InlineDecision::SUCCESS: + return true; + case InlineDecision::UNDECIDED: + case InlineDecision::CANDIDATE: + return false; + default: + assert(!"Unexpected InlineDecision"); + unreached(); } } @@ -375,13 +377,11 @@ void InlineContext::Dump(unsigned indent) #if defined(DEBUG) calleeName = compiler->eeGetMethodFullName(m_Callee); #else - calleeName = "callee"; + calleeName = "callee"; #endif // defined(DEBUG) - } - mdMethodDef calleeToken = - compiler->info.compCompHnd->getMethodDefFromMethod(m_Callee); + mdMethodDef calleeToken = compiler->info.compCompHnd->getMethodDefFromMethod(m_Callee); // Dump this node if (m_Parent == nullptr) @@ -397,15 +397,13 @@ void InlineContext::Dump(unsigned indent) if (m_Offset == BAD_IL_OFFSET) { - printf("%*s[%u IL=???? TR=%06u %08X] [%s%s] %s\n", indent, "", - m_Ordinal, m_TreeID, calleeToken, + printf("%*s[%u IL=???? TR=%06u %08X] [%s%s] %s\n", indent, "", m_Ordinal, m_TreeID, calleeToken, inlineResult, inlineReason, calleeName); } else { IL_OFFSET offset = jitGetILoffs(m_Offset); - printf("%*s[%u IL=%04d TR=%06u %08X] [%s%s] %s\n", indent, "", - m_Ordinal, offset, m_TreeID, calleeToken, + printf("%*s[%u IL=%04d TR=%06u %08X] [%s%s] %s\n", indent, "", m_Ordinal, offset, m_TreeID, calleeToken, inlineResult, inlineReason, calleeName); } } @@ -444,10 +442,7 @@ void InlineContext::DumpData(unsigned indent) { // Root method... cons up a policy so we can display the name InlinePolicy* policy = InlinePolicy::GetPolicy(compiler, true); - printf("\nInlines [%u] into \"%s\" [%s]\n", - m_InlineStrategy->GetInlineCount(), - calleeName, - policy->GetName()); + printf("\nInlines [%u] into \"%s\" [%s]\n", m_InlineStrategy->GetInlineCount(), calleeName, policy->GetName()); } else if (m_Success) { @@ -479,26 +474,24 @@ void InlineContext::DumpXml(FILE* file, unsigned indent) m_Sibling->DumpXml(file, indent); } - const bool isRoot = m_Parent == nullptr; - const bool hasChild = m_Child != nullptr; + const bool isRoot = m_Parent == nullptr; + const bool hasChild = m_Child != nullptr; const char* inlineType = m_Success ? "Inline" : "FailedInline"; - unsigned newIndent = indent; + unsigned newIndent = indent; if (!isRoot) { Compiler* compiler = m_InlineStrategy->GetCompiler(); - mdMethodDef calleeToken = - compiler->info.compCompHnd->getMethodDefFromMethod(m_Callee); - unsigned calleeHash = - compiler->info.compCompHnd->getMethodHash(m_Callee); + mdMethodDef calleeToken = compiler->info.compCompHnd->getMethodDefFromMethod(m_Callee); + unsigned calleeHash = compiler->info.compCompHnd->getMethodHash(m_Callee); const char* inlineReason = InlGetObservationString(m_Observation); int offset = -1; if (m_Offset != BAD_IL_OFFSET) { - offset = (int) jitGetILoffs(m_Offset); + offset = (int)jitGetILoffs(m_Offset); } fprintf(file, "%*s<%s>\n", indent, "", inlineType); @@ -508,8 +501,7 @@ void InlineContext::DumpXml(FILE* file, unsigned indent) fprintf(file, "%*s<Reason>%s</Reason>\n", indent + 2, "", inlineReason); // Optionally, dump data about the last inline - if ((JitConfig.JitInlineDumpData() != 0) - && (this == m_InlineStrategy->GetLastContext())) + if ((JitConfig.JitInlineDumpData() != 0) && (this == m_InlineStrategy->GetLastContext())) { fprintf(file, "%*s<Data>", indent + 2, ""); m_InlineStrategy->DumpDataContents(file); @@ -552,10 +544,7 @@ void InlineContext::DumpXml(FILE* file, unsigned indent) // stmt - statement containing the call (if known) // description - string describing the context of the decision -InlineResult::InlineResult(Compiler* compiler, - GenTreeCall* call, - GenTreeStmt* stmt, - const char* description) +InlineResult::InlineResult(Compiler* compiler, GenTreeCall* call, GenTreeStmt* stmt, const char* description) : m_RootCompiler(nullptr) , m_Policy(nullptr) , m_Call(call) @@ -570,7 +559,7 @@ InlineResult::InlineResult(Compiler* compiler, // Set the policy const bool isPrejitRoot = false; - m_Policy = InlinePolicy::GetPolicy(m_RootCompiler, isPrejitRoot); + m_Policy = InlinePolicy::GetPolicy(m_RootCompiler, isPrejitRoot); // Pass along some optional information to the policy. if (stmt != nullptr) @@ -612,9 +601,7 @@ InlineResult::InlineResult(Compiler* compiler, // We use the inlCallee member to track the method since logically // it is the callee here. -InlineResult::InlineResult(Compiler* compiler, - CORINFO_METHOD_HANDLE method, - const char* description) +InlineResult::InlineResult(Compiler* compiler, CORINFO_METHOD_HANDLE method, const char* description) : m_RootCompiler(nullptr) , m_Policy(nullptr) , m_Call(nullptr) @@ -629,7 +616,7 @@ InlineResult::InlineResult(Compiler* compiler, // Set the policy const bool isPrejitRoot = true; - m_Policy = InlinePolicy::GetPolicy(m_RootCompiler, isPrejitRoot); + m_Policy = InlinePolicy::GetPolicy(m_RootCompiler, isPrejitRoot); } //------------------------------------------------------------------------ @@ -708,7 +695,7 @@ void InlineResult::Report() JITDUMP("\nINLINER: Marking %s as NOINLINE because of %s\n", callee, obsString); } -#endif // DEBUG +#endif // DEBUG COMP_HANDLE comp = m_RootCompiler->info.compCompHnd; comp->setMethodAttribs(m_Callee, CORINFO_FLG_BAD_INLINEE); @@ -796,7 +783,6 @@ InlineStrategy::InlineStrategy(Compiler* compiler) } #endif // DEBUG - } //------------------------------------------------------------------------ @@ -907,13 +893,10 @@ void InlineStrategy::DumpCsvData(FILE* fp) // // So they are "cheaper" that late failures. - unsigned profitableCandidateCount = - m_DiscretionaryCandidateCount - m_UnprofitableCandidateCount; + unsigned profitableCandidateCount = m_DiscretionaryCandidateCount - m_UnprofitableCandidateCount; - unsigned earlyFailCount = m_CandidateCount - - m_AlwaysCandidateCount - - m_ForceCandidateCount - - profitableCandidateCount; + unsigned earlyFailCount = + m_CandidateCount - m_AlwaysCandidateCount - m_ForceCandidateCount - profitableCandidateCount; fprintf(fp, "%u,", earlyFailCount); @@ -1005,8 +988,8 @@ int InlineStrategy::EstimateSize(InlineContext* context) // native code size is fairly well predicted by IL size. // // Model below is for x64 on windows. - unsigned ilSize = context->GetILSize(); - int estimate = (1312 + 228 * ilSize) / 10; + unsigned ilSize = context->GetILSize(); + int estimate = (1312 + 228 * ilSize) / 10; return estimate; } @@ -1036,13 +1019,11 @@ void InlineStrategy::NoteOutcome(InlineContext* context) // Keep track of the inline targeted for data collection or, // if we don't have one (yet), the last successful inline. - bool updateLast = - (m_LastSuccessfulPolicy == nullptr) || - !m_LastSuccessfulPolicy->IsDataCollectionTarget(); + bool updateLast = (m_LastSuccessfulPolicy == nullptr) || !m_LastSuccessfulPolicy->IsDataCollectionTarget(); if (updateLast) { - m_LastContext = context; + m_LastContext = context; m_LastSuccessfulPolicy = context->m_Policy; } else @@ -1063,7 +1044,7 @@ void InlineStrategy::NoteOutcome(InlineContext* context) // increase expense. InlineContext* currentContext = context; - bool isForceInline = false; + bool isForceInline = false; while (currentContext != m_RootContext) { @@ -1082,7 +1063,7 @@ void InlineStrategy::NoteOutcome(InlineContext* context) break; } - isForceInline = true; + isForceInline = true; currentContext = currentContext->GetParent(); } @@ -1181,25 +1162,25 @@ InlineContext* InlineStrategy::NewSuccess(InlineInfo* inlineInfo) noway_assert(parentContext != nullptr); - calleeContext->m_Code = calleeIL; + calleeContext->m_Code = calleeIL; calleeContext->m_ILSize = calleeILSize; calleeContext->m_Parent = parentContext; // Push on front here will put siblings in reverse lexical // order which we undo in the dumper - calleeContext->m_Sibling = parentContext->m_Child; - parentContext->m_Child = calleeContext; - calleeContext->m_Child = nullptr; - calleeContext->m_Offset = stmt->AsStmt()->gtStmtILoffsx; + calleeContext->m_Sibling = parentContext->m_Child; + parentContext->m_Child = calleeContext; + calleeContext->m_Child = nullptr; + calleeContext->m_Offset = stmt->AsStmt()->gtStmtILoffsx; calleeContext->m_Observation = inlineInfo->inlineResult->GetObservation(); - calleeContext->m_Success = true; + calleeContext->m_Success = true; #if defined(DEBUG) || defined(INLINE_DATA) InlinePolicy* policy = inlineInfo->inlineResult->GetPolicy(); - calleeContext->m_Policy = policy; + calleeContext->m_Policy = policy; calleeContext->m_CodeSizeEstimate = policy->CodeSizeEstimate(); - calleeContext->m_Callee = inlineInfo->fncHandle; + calleeContext->m_Callee = inlineInfo->fncHandle; // +1 here since we set this before calling NoteOutcome. calleeContext->m_Ordinal = m_InlineCount + 1; // Update offset with more accurate info @@ -1232,8 +1213,7 @@ InlineContext* InlineStrategy::NewSuccess(InlineInfo* inlineInfo) // A new InlineContext for diagnostic purposes, or nullptr if // the desired context could not be created. -InlineContext* InlineStrategy::NewFailure(GenTree* stmt, - InlineResult* inlineResult) +InlineContext* InlineStrategy::NewFailure(GenTree* stmt, InlineResult* inlineResult) { // Check for a parent context first. We may insert new statements // between the caller and callee that do not pick up either's @@ -1258,13 +1238,13 @@ InlineContext* InlineStrategy::NewFailure(GenTree* stmt, failedContext->m_Parent = parentContext; // Push on front here will put siblings in reverse lexical // order which we undo in the dumper - failedContext->m_Sibling = parentContext->m_Child; - parentContext->m_Child = failedContext; - failedContext->m_Child = nullptr; - failedContext->m_Offset = stmt->AsStmt()->gtStmtILoffsx; + failedContext->m_Sibling = parentContext->m_Child; + parentContext->m_Child = failedContext; + failedContext->m_Child = nullptr; + failedContext->m_Offset = stmt->AsStmt()->gtStmtILoffsx; failedContext->m_Observation = inlineResult->GetObservation(); - failedContext->m_Callee = inlineResult->GetCallee(); - failedContext->m_Success = false; + failedContext->m_Callee = inlineResult->GetCallee(); + failedContext->m_Success = false; #if defined(DEBUG) || defined(INLINE_DATA) @@ -1291,22 +1271,17 @@ void InlineStrategy::Dump() { m_RootContext->Dump(); - printf("Budget: initialTime=%d, finalTime=%d, initialBudget=%d, currentBudget=%d\n", - m_InitialTimeEstimate, - m_CurrentTimeEstimate, - m_InitialTimeBudget, - m_CurrentTimeBudget); + printf("Budget: initialTime=%d, finalTime=%d, initialBudget=%d, currentBudget=%d\n", m_InitialTimeEstimate, + m_CurrentTimeEstimate, m_InitialTimeBudget, m_CurrentTimeBudget); if (m_CurrentTimeBudget > m_InitialTimeBudget) { - printf("Budget: increased by %d because of force inlines\n", - m_CurrentTimeBudget - m_InitialTimeBudget); + printf("Budget: increased by %d because of force inlines\n", m_CurrentTimeBudget - m_InitialTimeBudget); } if (m_CurrentTimeEstimate > m_CurrentTimeBudget) { - printf("Budget: went over budget by %d\n", - m_CurrentTimeEstimate - m_CurrentTimeBudget); + printf("Budget: went over budget by %d\n", m_CurrentTimeEstimate - m_CurrentTimeBudget); } if (m_HasForceViaDiscretionary) @@ -1314,9 +1289,7 @@ void InlineStrategy::Dump() printf("Budget: discretionary inline caused a force inline\n"); } - printf("Budget: initialSize=%d, finalSize=%d\n", - m_InitialSizeEstimate, - m_CurrentSizeEstimate); + printf("Budget: initialSize=%d, finalSize=%d\n", m_InitialSizeEstimate, m_CurrentSizeEstimate); } // Static to track emission of the inline data header @@ -1374,7 +1347,7 @@ void InlineStrategy::DumpData() void InlineStrategy::DumpDataEnsurePolicyIsSet() { // Cache references to compiler substructures. - const Compiler::Info& info = m_Compiler->info; + const Compiler::Info& info = m_Compiler->info; const Compiler::Options& opts = m_Compiler->opts; // If there weren't any successful inlines, we won't have a @@ -1382,7 +1355,7 @@ void InlineStrategy::DumpDataEnsurePolicyIsSet() if (m_LastSuccessfulPolicy == nullptr) { const bool isPrejitRoot = (opts.eeFlags & CORJIT_FLG_PREJIT) != 0; - m_LastSuccessfulPolicy = InlinePolicy::GetPolicy(m_Compiler, isPrejitRoot); + m_LastSuccessfulPolicy = InlinePolicy::GetPolicy(m_Compiler, isPrejitRoot); // Add in a bit of data.... const bool isForceInline = (info.compFlags & CORINFO_FLG_FORCEINLINE) != 0; @@ -1401,10 +1374,7 @@ void InlineStrategy::DumpDataHeader(FILE* file) { DumpDataEnsurePolicyIsSet(); const int limit = JitConfig.JitInlineLimit(); - fprintf(file, - "*** Inline Data: Policy=%s JitInlineLimit=%d ***\n", - m_LastSuccessfulPolicy->GetName(), - limit); + fprintf(file, "*** Inline Data: Policy=%s JitInlineLimit=%d ***\n", m_LastSuccessfulPolicy->GetName(), limit); DumpDataSchema(file); fprintf(file, "\n"); } @@ -1433,7 +1403,7 @@ void InlineStrategy::DumpDataContents(FILE* file) DumpDataEnsurePolicyIsSet(); // Cache references to compiler substructures. - const Compiler::Info& info = m_Compiler->info; + const Compiler::Info& info = m_Compiler->info; const Compiler::Options& opts = m_Compiler->opts; // We'd really like the method identifier to be unique and @@ -1442,28 +1412,20 @@ void InlineStrategy::DumpDataContents(FILE* file) // // Post processing will have to filter out all data from // methods where the root entry appears multiple times. - mdMethodDef currentMethodToken = - info.compCompHnd->getMethodDefFromMethod(info.compMethodHnd); + mdMethodDef currentMethodToken = info.compCompHnd->getMethodDefFromMethod(info.compMethodHnd); // Convert time spent jitting into microseconds - unsigned microsecondsSpentJitting = 0; - unsigned __int64 compCycles = m_Compiler->getInlineCycleCount(); + unsigned microsecondsSpentJitting = 0; + unsigned __int64 compCycles = m_Compiler->getInlineCycleCount(); if (compCycles > 0) { - double countsPerSec = CycleTimer::CyclesPerSecond(); - double counts = (double) compCycles; - microsecondsSpentJitting = (unsigned) ((counts / countsPerSec) * 1000 * 1000); + double countsPerSec = CycleTimer::CyclesPerSecond(); + double counts = (double)compCycles; + microsecondsSpentJitting = (unsigned)((counts / countsPerSec) * 1000 * 1000); } - fprintf(file, - "%08X,%u,%u,%u,%u,%d,%d", - currentMethodToken, - m_InlineCount, - info.compTotalHotCodeSize, - info.compTotalColdCodeSize, - microsecondsSpentJitting, - m_CurrentSizeEstimate / 10, - m_CurrentTimeEstimate); + fprintf(file, "%08X,%u,%u,%u,%u,%d,%d", currentMethodToken, m_InlineCount, info.compTotalHotCodeSize, + info.compTotalColdCodeSize, microsecondsSpentJitting, m_CurrentSizeEstimate / 10, m_CurrentTimeEstimate); m_LastSuccessfulPolicy->DumpData(file); } @@ -1519,10 +1481,10 @@ void InlineStrategy::DumpXml(FILE* file, unsigned indent) } // Cache references to compiler substructures. - const Compiler::Info& info = m_Compiler->info; + const Compiler::Info& info = m_Compiler->info; const Compiler::Options& opts = m_Compiler->opts; - const bool isPrejitRoot = (opts.eeFlags & CORJIT_FLG_PREJIT) != 0; + const bool isPrejitRoot = (opts.eeFlags & CORJIT_FLG_PREJIT) != 0; const bool isForceInline = (info.compFlags & CORINFO_FLG_FORCEINLINE) != 0; // We'd really like the method identifier to be unique and @@ -1531,19 +1493,18 @@ void InlineStrategy::DumpXml(FILE* file, unsigned indent) // // Post processing will have to filter out all data from // methods where the root entry appears multiple times. - mdMethodDef currentMethodToken = - info.compCompHnd->getMethodDefFromMethod(info.compMethodHnd); + mdMethodDef currentMethodToken = info.compCompHnd->getMethodDefFromMethod(info.compMethodHnd); unsigned hash = info.compMethodHash(); // Convert time spent jitting into microseconds - unsigned microsecondsSpentJitting = 0; - unsigned __int64 compCycles = m_Compiler->getInlineCycleCount(); + unsigned microsecondsSpentJitting = 0; + unsigned __int64 compCycles = m_Compiler->getInlineCycleCount(); if (compCycles > 0) { - double countsPerSec = CycleTimer::CyclesPerSecond(); - double counts = (double) compCycles; - microsecondsSpentJitting = (unsigned) ((counts / countsPerSec) * 1000 * 1000); + double countsPerSec = CycleTimer::CyclesPerSecond(); + double counts = (double)compCycles; + microsecondsSpentJitting = (unsigned)((counts / countsPerSec) * 1000 * 1000); } // Get method name just for root method, to make it a bit easier @@ -1556,23 +1517,23 @@ void InlineStrategy::DumpXml(FILE* file, unsigned indent) // Ok to truncate name, just ensure it's null terminated. char buf[64]; strncpy(buf, methodName, sizeof(buf)); - buf[sizeof(buf)-1] = 0; + buf[sizeof(buf) - 1] = 0; for (int i = 0; i < sizeof(buf); i++) { switch (buf[i]) { - case '<': - buf[i] = '['; - break; - case '>': - buf[i] = ']'; - break; - case '&': - buf[i] = '#'; - break; - default: - break; + case '<': + buf[i] = '['; + break; + case '>': + buf[i] = ']'; + break; + case '&': + buf[i] = '#'; + break; + default: + break; } } @@ -1585,7 +1546,7 @@ void InlineStrategy::DumpXml(FILE* file, unsigned indent) fprintf(file, "%*s<ColdSize>%u</ColdSize>\n", indent + 2, "", info.compTotalColdCodeSize); fprintf(file, "%*s<JitTime>%u</JitTime>\n", indent + 2, "", microsecondsSpentJitting); fprintf(file, "%*s<SizeEstimate>%u</SizeEstimate>\n", indent + 2, "", m_CurrentSizeEstimate / 10); - fprintf(file, "%*s<TimeEstimate>%u</TimeEstimate>\n", indent + 2, "", m_CurrentTimeEstimate); + fprintf(file, "%*s<TimeEstimate>%u</TimeEstimate>\n", indent + 2, "", m_CurrentTimeEstimate); // Root context will be null if we're not optimizing the method. // @@ -1648,7 +1609,7 @@ bool InlineStrategy::IsNoInline(ICorJitInfo* info, CORINFO_METHOD_HANDLE method) #if defined(DEBUG) || defined(INLINE_DATA) static ConfigMethodRange range; - const wchar_t* noInlineRange = JitConfig.JitNoInlineRange(); + const wchar_t* noInlineRange = JitConfig.JitNoInlineRange(); if (noInlineRange == nullptr) { @@ -1676,5 +1637,4 @@ bool InlineStrategy::IsNoInline(ICorJitInfo* info, CORINFO_METHOD_HANDLE method) return false; #endif // defined(DEBUG) || defined(INLINE_DATA) - } |