summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/ceemain.cpp16
-rw-r--r--src/vm/clrprivbinderwinrt.cpp11
-rw-r--r--src/vm/encee.cpp15
-rw-r--r--src/vm/excep.cpp55
-rw-r--r--src/vm/i386/cgenx86.cpp3
-rw-r--r--src/vm/mlinfo.cpp4
-rw-r--r--src/vm/util.cpp25
-rw-r--r--src/vm/win32threadpool.cpp4
8 files changed, 73 insertions, 60 deletions
diff --git a/src/vm/ceemain.cpp b/src/vm/ceemain.cpp
index 67fa33cebb..b16d7972be 100644
--- a/src/vm/ceemain.cpp
+++ b/src/vm/ceemain.cpp
@@ -1933,15 +1933,17 @@ void STDMETHODCALLTYPE EEShutDownHelper(BOOL fIsDllUnloading)
#endif
#ifdef FEATURE_PREJIT
- // If we're doing basic block profiling, we need to write the log files to disk.
-
- static BOOL fIBCLoggingDone = FALSE;
- if (!fIBCLoggingDone)
{
- if (g_IBCLogger.InstrEnabled())
- Module::WriteAllModuleProfileData(true);
+ // If we're doing basic block profiling, we need to write the log files to disk.
+
+ static BOOL fIBCLoggingDone = FALSE;
+ if (!fIBCLoggingDone)
+ {
+ if (g_IBCLogger.InstrEnabled())
+ Module::WriteAllModuleProfileData(true);
- fIBCLoggingDone = TRUE;
+ fIBCLoggingDone = TRUE;
+ }
}
#endif // FEATURE_PREJIT
diff --git a/src/vm/clrprivbinderwinrt.cpp b/src/vm/clrprivbinderwinrt.cpp
index b82d46cdab..b4fb45c083 100644
--- a/src/vm/clrprivbinderwinrt.cpp
+++ b/src/vm/clrprivbinderwinrt.cpp
@@ -287,7 +287,8 @@ HRESULT CLRPrivBinderWinRT::BindWinRTAssemblyByName(
{
STANDARD_VM_CONTRACT;
HRESULT hr = S_OK;
- ReleaseHolder<CLRPrivAssemblyWinRT> pAssembly;
+ ReleaseHolder<CLRPrivAssemblyWinRT> pAssembly;
+ LPWSTR wszFullTypeName = nullptr;
#ifndef FEATURE_CORECLR
NewArrayHolder<WCHAR> wszAssemblySimpleName;
#endif
@@ -319,11 +320,13 @@ HRESULT CLRPrivBinderWinRT::BindWinRTAssemblyByName(
IfFailGo(fusion::util::GetProperty(pAssemblyName, ASM_NAME_NAME, &wszAssemblySimpleName));
#else
WCHAR wszAssemblySimpleName[_MAX_PATH];
- DWORD cchAssemblySimpleName = _MAX_PATH;
- IfFailGo(pAssemblyName->GetName(&cchAssemblySimpleName, wszAssemblySimpleName));
+ {
+ DWORD cchAssemblySimpleName = _MAX_PATH;
+ IfFailGo(pAssemblyName->GetName(&cchAssemblySimpleName, wszAssemblySimpleName));
+ }
#endif
- LPWSTR wszFullTypeName = wcschr(wszAssemblySimpleName, W('!'));
+ wszFullTypeName = wcschr(wszAssemblySimpleName, W('!'));
if (wszFullTypeName != nullptr)
{
diff --git a/src/vm/encee.cpp b/src/vm/encee.cpp
index ca4e7fe553..7f12643340 100644
--- a/src/vm/encee.cpp
+++ b/src/vm/encee.cpp
@@ -149,7 +149,11 @@ HRESULT EditAndContinueModule::ApplyEditAndContinue(
HRESULT hr = S_OK;
HENUMInternal enumENC;
-
+
+ BYTE *pLocalILMemory = NULL;
+ IMDInternalImport *pMDImport = NULL;
+ IMDInternalImport *pNewMDImport = NULL;
+
CONTRACT_VIOLATION(GCViolation); // SafeComHolder goes to preemptive mode, which will trigger a GC
SafeComHolder<IMDInternalImportENC> pIMDInternalImportENC;
SafeComHolder<IMetaDataEmit> pEmitter;
@@ -175,8 +179,7 @@ HRESULT EditAndContinueModule::ApplyEditAndContinue(
IfFailGo(hr);
// Grab the current importer.
- IMDInternalImport *pMDImport = GetMDImport();
- IMDInternalImport *pNewMDImport;
+ pMDImport = GetMDImport();
// Apply the EnC delta to this module's metadata.
IfFailGo(pMDImport->ApplyEditAndContinue(pDeltaMD, cbDeltaMD, &pNewMDImport));
@@ -195,7 +198,7 @@ HRESULT EditAndContinueModule::ApplyEditAndContinue(
IfFailGo(GetMetaDataPublicInterfaceFromInternal(pMDImport, IID_IMetaDataEmit, (void **)&pEmitter));
// Copy the deltaIL into our RVAable IL memory
- BYTE *pLocalILMemory = new BYTE[cbDeltaIL];
+ pLocalILMemory = new BYTE[cbDeltaIL];
memcpy(pLocalILMemory, pDeltaIL, cbDeltaIL);
// Enumerate all of the EnC delta tokens
@@ -203,7 +206,6 @@ HRESULT EditAndContinueModule::ApplyEditAndContinue(
IfFailGo(pIMDInternalImportENC->EnumDeltaTokensInit(&enumENC));
mdToken token;
- FieldDesc * pField = NULL;
while (pIMDInternalImportENC->EnumNext(&enumENC, &token))
{
STRESS_LOG3(LF_ENC, LL_INFO100, "EACM::AEAC: updated token 0x%x; type 0x%x; rid 0x%x\n", token, TypeFromToken(token), RidFromToken(token));
@@ -248,8 +250,7 @@ HRESULT EditAndContinueModule::ApplyEditAndContinue(
// FieldDef token - add a new field
LOG((LF_ENC, LL_INFO10000, "EACM::AEAC: Found field 0x%x\n", token));
- pField = LookupFieldDef(token);
- if (pField)
+ if (LookupFieldDef(token))
{
// Field already exists - just ignore for now
continue;
diff --git a/src/vm/excep.cpp b/src/vm/excep.cpp
index c161c47785..b7c55d38a7 100644
--- a/src/vm/excep.cpp
+++ b/src/vm/excep.cpp
@@ -9916,47 +9916,48 @@ PTR_EHWatsonBucketTracker GetWatsonBucketTrackerForPreallocatedException(OBJECTR
goto doValidation;
}
- // Find the reference to the exception tracker corresponding to the preallocated exception,
- // starting the search from the current exception tracker (2nd arg of NULL specifies that).
-#if defined(WIN64EXCEPTIONS)
- PTR_ExceptionTracker pEHTracker = NULL;
- PTR_ExceptionTracker pPreviousEHTracker = NULL;
+ {
+ // Find the reference to the exception tracker corresponding to the preallocated exception,
+ // starting the search from the current exception tracker (2nd arg of NULL specifies that).
+ #if defined(WIN64EXCEPTIONS)
+ PTR_ExceptionTracker pEHTracker = NULL;
+ PTR_ExceptionTracker pPreviousEHTracker = NULL;
#elif _TARGET_X86_
- PTR_ExInfo pEHTracker = NULL;
- PTR_ExInfo pPreviousEHTracker = NULL;
+ PTR_ExInfo pEHTracker = NULL;
+ PTR_ExInfo pPreviousEHTracker = NULL;
#else // !(_WIN64 || _TARGET_X86_)
#error Unsupported platform
#endif // _WIN64
- if (fStartSearchFromPreviousTracker)
- {
- // Get the exception tracker previous to the current one
- pPreviousEHTracker = GetThread()->GetExceptionState()->GetCurrentExceptionTracker()->GetPreviousExceptionTracker();
+ if (fStartSearchFromPreviousTracker)
+ {
+ // Get the exception tracker previous to the current one
+ pPreviousEHTracker = GetThread()->GetExceptionState()->GetCurrentExceptionTracker()->GetPreviousExceptionTracker();
+
+ // If there is no previous tracker to start from, then simply abort the search attempt.
+ // If we couldnt find the exception tracker, then buckets are not available
+ if (pPreviousEHTracker == NULL)
+ {
+ LOG((LF_EH, LL_INFO100, "GetWatsonBucketTrackerForPreallocatedException - Couldnt find the previous EHTracker to start the search from.\n"));
+ pWBTracker = NULL;
+ goto done;
+ }
+ }
+
+ pEHTracker = GetEHTrackerForPreallocatedException(gc.oPreAllocThrowable, pPreviousEHTracker);
- // If there is no previous tracker to start from, then simply abort the search attempt.
// If we couldnt find the exception tracker, then buckets are not available
- if (pPreviousEHTracker == NULL)
+ if (pEHTracker == NULL)
{
- LOG((LF_EH, LL_INFO100, "GetWatsonBucketTrackerForPreallocatedException - Couldnt find the previous EHTracker to start the search from.\n"));
+ LOG((LF_EH, LL_INFO100, "GetWatsonBucketTrackerForPreallocatedException - Couldnt find EHTracker for preallocated exception object.\n"));
pWBTracker = NULL;
goto done;
}
- }
- pEHTracker = GetEHTrackerForPreallocatedException(gc.oPreAllocThrowable, pPreviousEHTracker);
-
- // If we couldnt find the exception tracker, then buckets are not available
- if (pEHTracker == NULL)
- {
- LOG((LF_EH, LL_INFO100, "GetWatsonBucketTrackerForPreallocatedException - Couldnt find EHTracker for preallocated exception object.\n"));
- pWBTracker = NULL;
- goto done;
+ // Get the Watson Bucket Tracker from the exception tracker
+ pWBTracker = pEHTracker->GetWatsonBucketTracker();
}
-
- // Get the Watson Bucket Tracker from the exception tracker
- pWBTracker = pEHTracker->GetWatsonBucketTracker();
-
doValidation:
_ASSERTE(pWBTracker != NULL);
diff --git a/src/vm/i386/cgenx86.cpp b/src/vm/i386/cgenx86.cpp
index cefeeef0f0..8864b025ae 100644
--- a/src/vm/i386/cgenx86.cpp
+++ b/src/vm/i386/cgenx86.cpp
@@ -1784,13 +1784,14 @@ DWORD GetLogicalCpuCount()
PAL_TRY(Param *, pParam, &param)
{
unsigned char buffer[16];
+ DWORD* dwBuffer = NULL;
DWORD maxCpuId = getcpuid(0, buffer);
if (maxCpuId < 1)
goto lDone;
- DWORD* dwBuffer = (DWORD*)buffer;
+ dwBuffer = (DWORD*)buffer;
if (dwBuffer[1] == 'uneG') {
if (dwBuffer[3] == 'Ieni') {
diff --git a/src/vm/mlinfo.cpp b/src/vm/mlinfo.cpp
index ab2545296e..74bd536969 100644
--- a/src/vm/mlinfo.cpp
+++ b/src/vm/mlinfo.cpp
@@ -4865,6 +4865,8 @@ void ArrayMarshalInfo::InitForHiddenLengthArray(TypeHandle thElement)
{
STANDARD_VM_CONTRACT;
+ MethodTable *pMT = NULL;
+
// WinRT supports arrays of any WinRT-legal types
if (thElement.IsArray())
{
@@ -4877,7 +4879,7 @@ void ArrayMarshalInfo::InitForHiddenLengthArray(TypeHandle thElement)
m_thElement = thElement;
- MethodTable *pMT = thElement.GetMethodTable();
+ pMT = thElement.GetMethodTable();
if (pMT->IsString())
{
m_vtElement = VTHACK_HSTRING;
diff --git a/src/vm/util.cpp b/src/vm/util.cpp
index a7c264fb67..a96a56cd58 100644
--- a/src/vm/util.cpp
+++ b/src/vm/util.cpp
@@ -1950,17 +1950,18 @@ size_t GetLogicalProcessorCacheSizeFromOS()
// Crack the information. Iterate through all the SLPI array entries for all processors in system.
// Will return the greatest of all the processor cache sizes or zero
-
- size_t last_cache_size = 0;
-
- for (DWORD i=0; i < nEntries; i++)
{
- if (pslpi[i].Relationship == RelationCache)
+ size_t last_cache_size = 0;
+
+ for (DWORD i=0; i < nEntries; i++)
{
- last_cache_size = max(last_cache_size, pslpi[i].Cache.Size);
- }
- }
- cache_size = last_cache_size;
+ if (pslpi[i].Relationship == RelationCache)
+ {
+ last_cache_size = max(last_cache_size, pslpi[i].Cache.Size);
+ }
+ }
+ cache_size = last_cache_size;
+ }
Exit:
if(pslpi)
@@ -1991,6 +1992,9 @@ DWORD GetLogicalCpuCountFromOS()
DWORD nEntries = 0;
+ DWORD prevcount = 0;
+ DWORD count = 1;
+
// Try to use GetLogicalProcessorInformation API and get a valid pointer to the SLPI array if successful. Returns NULL
// if API not present or on failure.
SYSTEM_LOGICAL_PROCESSOR_INFORMATION *pslpi = IsGLPISupported(&nEntries) ;
@@ -2001,9 +2005,6 @@ DWORD GetLogicalCpuCountFromOS()
goto lDone;
}
- DWORD prevcount = 0;
- DWORD count = 1;
-
for (DWORD j = 0; j < nEntries; j++)
{
if (pslpi[j].Relationship == RelationProcessorCore)
diff --git a/src/vm/win32threadpool.cpp b/src/vm/win32threadpool.cpp
index 98c7d3ea81..e8a05c383f 100644
--- a/src/vm/win32threadpool.cpp
+++ b/src/vm/win32threadpool.cpp
@@ -3679,6 +3679,8 @@ DWORD __stdcall ThreadpoolMgr::CompletionPortThreadStart(LPVOID lpArgs)
BOOL fThreadInit = FALSE;
Thread *pThread = NULL;
+ DWORD cpThreadWait = 0;
+
if (g_fEEStarted) {
pThread = SetupThreadNoThrow();
if (pThread == NULL) {
@@ -3713,7 +3715,7 @@ DWORD __stdcall ThreadpoolMgr::CompletionPortThreadStart(LPVOID lpArgs)
ThreadCounter::Counts oldCounts;
ThreadCounter::Counts newCounts;
- DWORD cpThreadWait = CP_THREAD_WAIT;
+ cpThreadWait = CP_THREAD_WAIT;
for (;; )
{
Top: