env_copy["SuperPMIShimPath"] = self.jit_path
env_copy["COMPlus_AltJit"] = "*"
env_copy["COMPlus_AltJitName"] = self.collection_shim_name
+ env_copy["COMPlus_EnableExtraSuperPmiQueries"] = "1"
if self.coreclr_args.use_zapdisable:
env_copy["COMPlus_ZapDisable"] = "1"
bool shouldUseVerboseSsa();
bool treesBeforeAfterMorph; // If true, print trees before/after morphing (paired by an intra-compilation id:
int morphNum; // This counts the the trees that have been morphed, allowing us to label each uniquely.
+ bool doExtraSuperPmiQueries;
+ void makeExtraStructQueries(CORINFO_CLASS_HANDLE structHandle, int level); // Make queries recursively 'level' deep.
const char* VarNameToStr(VarName name)
{
CONFIG_STRING(JitMeasureNowayAssertFile,
W("JitMeasureNowayAssertFile")) // Set to file to write noway_assert usage to a file (if not
// set: stdout). Only valid if MEASURE_NOWAY is defined.
+#if defined(DEBUG)
+CONFIG_INTEGER(EnableExtraSuperPmiQueries, W("EnableExtraSuperPmiQueries"), 0) // Make extra queries to somewhat
+ // future-proof SuperPmi method contexts.
+#endif // DEBUG
#if defined(DEBUG) || defined(INLINE_DATA)
CONFIG_INTEGER(JitInlineDumpData, W("JitInlineDumpData"), 0)
compGSReorderStackLayout = true;
varDsc->lvIsUnsafeBuffer = true;
}
+#ifdef DEBUG
+ if (JitConfig.EnableExtraSuperPmiQueries())
+ {
+ makeExtraStructQueries(typeHnd, 2);
+ }
+#endif // DEBUG
+}
+
+#ifdef DEBUG
+//------------------------------------------------------------------------
+// makeExtraStructQueries: Query the information for the given struct handle.
+//
+// Arguments:
+// structHandle -- The handle for the struct type we're querying.
+// level -- How many more levels to recurse.
+//
+void Compiler::makeExtraStructQueries(CORINFO_CLASS_HANDLE structHandle, int level)
+{
+ if (level <= 0)
+ {
+ return;
+ }
+ assert(structHandle != NO_CLASS_HANDLE);
+ (void)typGetObjLayout(structHandle);
+ unsigned fieldCnt = info.compCompHnd->getClassNumInstanceFields(structHandle);
+ for (unsigned int i = 0; i < fieldCnt; i++)
+ {
+ CORINFO_FIELD_HANDLE fieldHandle = info.compCompHnd->getFieldInClass(structHandle, i);
+ unsigned fldOffset = info.compCompHnd->getFieldOffset(fieldHandle);
+ CORINFO_CLASS_HANDLE fieldClassHandle = NO_CLASS_HANDLE;
+ CorInfoType fieldCorType = info.compCompHnd->getFieldType(fieldHandle, &fieldClassHandle);
+ var_types fieldVarType = JITtype2varType(fieldCorType);
+ if (fieldClassHandle != NO_CLASS_HANDLE)
+ {
+ if (varTypeIsStruct(fieldVarType))
+ {
+ fieldVarType = impNormStructType(fieldClassHandle);
+ makeExtraStructQueries(fieldClassHandle, level - 1);
+ }
+ }
+ }
}
+#endif // DEBUG
//------------------------------------------------------------------------
// lvaSetStructUsedAsVarArg: update hfa information for vararg struct args