GetEmitter()->emitComputeCodeSizes();
#ifdef DEBUG
+ unsigned instrCount;
// Code to test or stress our ability to run a fallback compile.
// We trigger the fallback here, before asking the VM for any memory,
codeSize = GetEmitter()->emitEndCodeGen(compiler, trackedStackPtrsContig, GetInterruptible(),
IsFullPtrRegMapRequired(), compiler->compHndBBtabCount, &prologSize,
- &epilogSize, codePtr, &coldCodePtr, &consPtr);
+ &epilogSize, codePtr, &coldCodePtr, &consPtr DEBUGARG(&instrCount));
#ifdef DEBUG
assert(compiler->compCodeGenDone == false);
#ifdef DEBUG
if (compiler->opts.disAsm || verbose)
{
- printf("\n; Total bytes of code %d, prolog size %d, PerfScore %.2f, (MethodHash=%08x) for method %s\n",
- codeSize, prologSize, compiler->info.compPerfScore, compiler->info.compMethodHash(),
+ printf("\n; Total bytes of code %d, prolog size %d, PerfScore %.2f, instruction count %d (MethodHash=%08x) for "
+ "method %s\n",
+ codeSize, prologSize, compiler->info.compPerfScore, instrCount, compiler->info.compMethodHash(),
compiler->info.compFullName);
printf("; ============================================================\n\n");
printf(""); // in our logic this causes a flush
// Same parameters as ICorStaticInfo::setVars().
void Compiler::eeDispVars(CORINFO_METHOD_HANDLE ftn, ULONG32 cVars, ICorDebugInfo::NativeVarInfo* vars)
{
- printf("*************** Variable debug info\n");
- printf("%d live ranges\n", cVars);
+ ALLVARSET_TP uniqueVars(AllVarSetOps::MakeEmpty(this));
+ for (unsigned i = 0; i < cVars; i++)
+ {
+ // ignore "special vars" and out of bounds vars
+ if ((((int)vars[i].varNumber) >= 0) && (vars[i].varNumber < lclMAX_ALLSET_TRACKED))
+ {
+ AllVarSetOps::AddElemD(this, uniqueVars, vars[i].varNumber);
+ }
+ }
+ printf("; Variable debug info: %d live range(s), %d var(s) for method %s\n", cVars,
+ AllVarSetOps::Count(this, uniqueVars), info.compFullName);
+
for (unsigned i = 0; i < cVars; i++)
{
eeDispVar(&vars[i]);
unsigned* epilogSize,
void** codeAddr,
void** coldCodeAddr,
- void** consAddr)
+ void** consAddr DEBUGARG(unsigned* instrCount))
{
#ifdef DEBUG
if (emitComp->verbose)
#define DEFAULT_CODE_BUFFER_INIT 0xcc
+#ifdef DEBUG
+ *instrCount = 0;
+#endif
for (insGroup* ig = emitIGlist; ig != nullptr; ig = ig->igNext)
{
assert(!(ig->igFlags & IGF_PLACEHOLDER)); // There better not be any placeholder groups left
{
printf("\t\t\t\t\t\t;; bbWeight=%s PerfScore %.2f", refCntWtd2str(ig->igWeight), ig->igPerfScore);
}
+ *instrCount += ig->igInsCnt;
#endif // DEBUG
emitCurIG = nullptr;