From 58561e4e2c8c4973aa740a182d0d5f57f1bd8cfb Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Tue, 21 Nov 2017 18:20:16 -0800 Subject: [PATCH] format spmi source (#15144) --- .../superpmi/superpmi-shared/methodcontext.cpp | 37 +++++++++++----------- .../superpmi/superpmi-shared/methodcontext.h | 7 ++-- .../superpmi-shim-collector/icorjitinfo.cpp | 5 ++- src/ToolBox/superpmi/superpmi/icorjitinfo.cpp | 3 +- 4 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index 8f7acc5..3a9f48f 100644 --- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -1886,10 +1886,10 @@ void MethodContext::dmpGetBuiltinClass(DWORD key, DWORDLONG value) } CORINFO_CLASS_HANDLE MethodContext::repGetBuiltinClass(CorInfoClassId classId) { - AssertCodeMsg(GetBuiltinClass != nullptr, EXCEPTIONCODE_MC, - "Encountered an empty LWM while looking for %016llX", (DWORDLONG)classId); - AssertCodeMsg(GetBuiltinClass->GetIndex((DWORDLONG)classId) != -1, EXCEPTIONCODE_MC, - "Didn't find %016llX", (DWORDLONG)classId); + AssertCodeMsg(GetBuiltinClass != nullptr, EXCEPTIONCODE_MC, "Encountered an empty LWM while looking for %016llX", + (DWORDLONG)classId); + AssertCodeMsg(GetBuiltinClass->GetIndex((DWORDLONG)classId) != -1, EXCEPTIONCODE_MC, "Didn't find %016llX", + (DWORDLONG)classId); CORINFO_CLASS_HANDLE value = (CORINFO_CLASS_HANDLE)GetBuiltinClass->Get((DWORD)classId); DEBUG_REP(dmpGetBuiltinClass((DWORDLONG)classId, (DWORDLONG)value)); return value; @@ -2147,13 +2147,14 @@ void MethodContext::recGetHelperFtn(CorInfoHelpFunc ftnNum, void** ppIndirection value.A = (DWORDLONG)*ppIndirection; value.B = (DWORDLONG)result; - if (GetHelperFtn->GetIndex((DWORD)ftnNum) != -1) - { - DLDL oldValue = GetHelperFtn->Get((DWORD)ftnNum); + if (GetHelperFtn->GetIndex((DWORD)ftnNum) != -1) + { + DLDL oldValue = GetHelperFtn->Get((DWORD)ftnNum); - AssertCodeMsg(oldValue.A == value.A && oldValue.B == oldValue.B, EXCEPTIONCODE_MC, "collision! old: %016llX %016llX, new: %016llX %016llX \n", oldValue.A, oldValue.B, value.A, value.B); - - } + AssertCodeMsg(oldValue.A == value.A && oldValue.B == oldValue.B, EXCEPTIONCODE_MC, + "collision! old: %016llX %016llX, new: %016llX %016llX \n", oldValue.A, oldValue.B, value.A, + value.B); + } GetHelperFtn->Add((DWORD)ftnNum, value); DEBUG_REC(dmpGetHelperFtn((DWORD)ftnNum, value)); @@ -3031,7 +3032,7 @@ CORINFO_METHOD_HANDLE MethodContext::repResolveVirtualMethod(CORINFO_METHOD_HAND } void MethodContext::recGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, - bool *requiresInstMethodTableArg, + bool* requiresInstMethodTableArg, CORINFO_METHOD_HANDLE result) { if (GetUnboxedEntry == nullptr) @@ -3039,12 +3040,12 @@ void MethodContext::recGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, GetUnboxedEntry = new LightWeightMap(); } - DWORDLONG key = (DWORDLONG) ftn; - DLD value; - value.A = (DWORDLONG) result; + DWORDLONG key = (DWORDLONG)ftn; + DLD value; + value.A = (DWORDLONG)result; if (requiresInstMethodTableArg != nullptr) { - value.B = (DWORD) *requiresInstMethodTableArg ? 1 : 0; + value.B = (DWORD)*requiresInstMethodTableArg ? 1 : 0; } else { @@ -3056,12 +3057,10 @@ void MethodContext::recGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, void MethodContext::dmpGetUnboxedEntry(DWORDLONG key, DLD value) { - printf("GetUnboxedEntry ftn-%016llX, result-%016llX, requires-inst-%u", - key, value.A, value.B); + printf("GetUnboxedEntry ftn-%016llX, result-%016llX, requires-inst-%u", key, value.A, value.B); } -CORINFO_METHOD_HANDLE MethodContext::repGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, - bool* requiresInstMethodTableArg) +CORINFO_METHOD_HANDLE MethodContext::repGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg) { DWORDLONG key = (DWORDLONG)ftn; diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h index 450831d..582a26f 100644 --- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.h +++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.h @@ -877,12 +877,9 @@ public: CORINFO_CLASS_HANDLE implClass, CORINFO_CONTEXT_HANDLE ownerType); - void recGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, - bool* requiresInstMethodTableArg, - CORINFO_METHOD_HANDLE result); + void recGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg, CORINFO_METHOD_HANDLE result); void dmpGetUnboxedEntry(DWORDLONG key, DLD value); - CORINFO_METHOD_HANDLE repGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, - bool* requiresInstMethodTableArg); + CORINFO_METHOD_HANDLE repGetUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg); void recGetDefaultEqualityComparerClass(CORINFO_CLASS_HANDLE cls, CORINFO_CLASS_HANDLE result); void dmpGetDefaultEqualityComparerClass(DWORDLONG key, DWORDLONG value); diff --git a/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp index 3477bac..fe5f557 100644 --- a/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp +++ b/src/ToolBox/superpmi/superpmi-shim-collector/icorjitinfo.cpp @@ -246,9 +246,8 @@ CORINFO_METHOD_HANDLE interceptor_ICJI::resolveVirtualMethod(CORINFO_METHOD_HAND CORINFO_METHOD_HANDLE interceptor_ICJI::getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg) { mc->cr->AddCall("getUnboxedEntry"); - bool localRequiresInstMethodTableArg = false; - CORINFO_METHOD_HANDLE result = - original_ICorJitInfo->getUnboxedEntry(ftn, &localRequiresInstMethodTableArg); + bool localRequiresInstMethodTableArg = false; + CORINFO_METHOD_HANDLE result = original_ICorJitInfo->getUnboxedEntry(ftn, &localRequiresInstMethodTableArg); mc->recGetUnboxedEntry(ftn, &localRequiresInstMethodTableArg, result); if (requiresInstMethodTableArg != nullptr) { diff --git a/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp b/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp index e8f86ce..fc5677c 100644 --- a/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp +++ b/src/ToolBox/superpmi/superpmi/icorjitinfo.cpp @@ -189,8 +189,7 @@ CORINFO_METHOD_HANDLE MyICJI::resolveVirtualMethod(CORINFO_METHOD_HANDLE virtua CORINFO_METHOD_HANDLE MyICJI::getUnboxedEntry(CORINFO_METHOD_HANDLE ftn, bool* requiresInstMethodTableArg) { jitInstance->mc->cr->AddCall("getUnboxedEntry"); - CORINFO_METHOD_HANDLE result = - jitInstance->mc->repGetUnboxedEntry(ftn, requiresInstMethodTableArg); + CORINFO_METHOD_HANDLE result = jitInstance->mc->repGetUnboxedEntry(ftn, requiresInstMethodTableArg); return result; } -- 2.7.4