From 9ee4f9b757bd9b344a28e32c82bc90d30053224e Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Thu, 12 Dec 2024 02:13:37 +0200 Subject: [PATCH] Fix typos --- src/coreclr/pal/src/include/pal/synchcache.hpp | 8 +------- src/coreclr/vm/amd64/cgenamd64.cpp | 2 +- src/coreclr/vm/arm/stubs.cpp | 2 +- src/coreclr/vm/arm64/stubs.cpp | 2 +- src/coreclr/vm/fcall.h | 4 ++-- src/coreclr/vm/frames.cpp | 6 +++--- src/coreclr/vm/frames.h | 10 +++++----- src/coreclr/vm/i386/asmhelpers.S | 2 +- src/coreclr/vm/i386/asmhelpers.asm | 2 +- src/coreclr/vm/i386/cgenx86.cpp | 12 ++++++------ src/coreclr/vm/jithelpers.cpp | 2 +- src/coreclr/vm/loongarch64/stubs.cpp | 2 +- src/coreclr/vm/methodtablebuilder.cpp | 2 +- src/coreclr/vm/proftoeeinterfaceimpl.cpp | 4 ++-- src/coreclr/vm/riscv64/stubs.cpp | 2 +- .../src/System/Data/DataColumn.cs | 16 ++++++++-------- .../System/Diagnostics/Tracing/EventSource.cs | 2 +- .../tests/Writers/RwFactory/CXmlDriverEngine.cs | 2 +- 18 files changed, 38 insertions(+), 44 deletions(-) diff --git a/src/coreclr/pal/src/include/pal/synchcache.hpp b/src/coreclr/pal/src/include/pal/synchcache.hpp index 89ee48c42e944..b2020d4ad2630 100644 --- a/src/coreclr/pal/src/include/pal/synchcache.hpp +++ b/src/coreclr/pal/src/include/pal/synchcache.hpp @@ -2,9 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. /*++ - - - Module Name: include/pal/synchcache.hpp @@ -12,9 +9,6 @@ Module Name: Abstract: Simple look-aside cache for unused objects with default constructor or no constructor - - - --*/ #ifndef _SYNCH_CACHE_H_ @@ -205,7 +199,7 @@ namespace CorUnix static const int MaxDepth = 256; static const int PreAllocFactor = 10; // Everytime a Get finds no available - // cached raw intances, it preallocates + // cached raw instances, it preallocates // MaxDepth/PreAllocFactor new raw // instances and store them into the // cache before continuing diff --git a/src/coreclr/vm/amd64/cgenamd64.cpp b/src/coreclr/vm/amd64/cgenamd64.cpp index a365d0d662804..7548cd8a1742b 100644 --- a/src/coreclr/vm/amd64/cgenamd64.cpp +++ b/src/coreclr/vm/amd64/cgenamd64.cpp @@ -175,7 +175,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat // This allocation throws on OOM. MachState* pUnwoundState = (MachState*)DacAllocHostOnlyInstance(sizeof(*pUnwoundState), true); - InsureInit(pUnwoundState); + EnsureInit(pUnwoundState); pRD->pCurrentContext->Rip = pRD->ControlPC = pUnwoundState->m_Rip; pRD->pCurrentContext->Rsp = pRD->SP = pUnwoundState->m_Rsp; diff --git a/src/coreclr/vm/arm/stubs.cpp b/src/coreclr/vm/arm/stubs.cpp index 18ccde9888fb7..14d24fa05beae 100644 --- a/src/coreclr/vm/arm/stubs.cpp +++ b/src/coreclr/vm/arm/stubs.cpp @@ -651,7 +651,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat // This allocation throws on OOM. MachState* pUnwoundState = (MachState*)DacAllocHostOnlyInstance(sizeof(*pUnwoundState), true); - InsureInit(pUnwoundState); + EnsureInit(pUnwoundState); pRD->pCurrentContext->Pc = pRD->ControlPC = pUnwoundState->_pc; pRD->pCurrentContext->Sp = pRD->SP = pUnwoundState->_sp; diff --git a/src/coreclr/vm/arm64/stubs.cpp b/src/coreclr/vm/arm64/stubs.cpp index 6cf5a7ec84589..ec3cd0dcb1538 100644 --- a/src/coreclr/vm/arm64/stubs.cpp +++ b/src/coreclr/vm/arm64/stubs.cpp @@ -448,7 +448,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat // This allocation throws on OOM. MachState* pUnwoundState = (MachState*)DacAllocHostOnlyInstance(sizeof(*pUnwoundState), true); - InsureInit(pUnwoundState); + EnsureInit(pUnwoundState); pRD->pCurrentContext->Pc = pRD->ControlPC = pUnwoundState->_pc; pRD->pCurrentContext->Sp = pRD->SP = pUnwoundState->_sp; diff --git a/src/coreclr/vm/fcall.h b/src/coreclr/vm/fcall.h index 8c56fd8c55f79..cb01c1470632c 100644 --- a/src/coreclr/vm/fcall.h +++ b/src/coreclr/vm/fcall.h @@ -795,9 +795,9 @@ LPVOID __FCThrowArgument(LPVOID me, enum RuntimeExceptionKind reKind, LPCWSTR ar #define HELPER_METHOD_POLL() { __helperframe.Poll(); INCONTRACT(__fCallCheck.SetDidPoll()); } // The HelperMethodFrame knows how to get its return address. Let other code get at it, too. -// (Uses comma operator to call InsureInit & discard result. +// (Uses comma operator to call EnsureInit & discard result. #define HELPER_METHOD_FRAME_GET_RETURN_ADDRESS() \ - ( static_cast( (__helperframe.InsureInit(NULL)), (__helperframe.MachineState()->GetRetAddr()) ) ) + ( static_cast( (__helperframe.EnsureInit(NULL)), (__helperframe.MachineState()->GetRetAddr()) ) ) // Very short routines, or routines that are guaranteed to force GC or EH // don't need to poll the GC. USE VERY SPARINGLY!!! diff --git a/src/coreclr/vm/frames.cpp b/src/coreclr/vm/frames.cpp index e6afc8995ef8e..26704a2cfd0b0 100644 --- a/src/coreclr/vm/frames.cpp +++ b/src/coreclr/vm/frames.cpp @@ -1787,7 +1787,7 @@ MethodDesc* HelperMethodFrame::GetFunction() WRAPPER_NO_CONTRACT; #ifndef DACCESS_COMPILE - InsureInit(NULL); + EnsureInit(NULL); return m_pMD; #else if (m_MachState.isValid()) @@ -1813,7 +1813,7 @@ MethodDesc* HelperMethodFrame::GetFunction() // // -BOOL HelperMethodFrame::InsureInit(MachState * unwindState) +BOOL HelperMethodFrame::EnsureInit(MachState * unwindState) { CONTRACTL { NOTHROW; @@ -1863,7 +1863,7 @@ BOOL HelperMethodFrame::InsureInit(MachState * unwindState) // result of failing to take a reader lock (because we told it not to yield, // but the writer lock was already held). Since we've not yet updated // m_MachState, this HelperMethodFrame will still be considered not fully - // initialized (so a future call into InsureInit() will attempt to complete + // initialized (so a future call into EnsureInit() will attempt to complete // initialization again). // // Note that, in DAC builds, the contract with LazyMachState::unwindLazyState diff --git a/src/coreclr/vm/frames.h b/src/coreclr/vm/frames.h index 4ea6e33341d0a..2f1cd3c2748f9 100644 --- a/src/coreclr/vm/frames.h +++ b/src/coreclr/vm/frames.h @@ -1308,7 +1308,7 @@ class HelperMethodFrame : public Frame public: #ifndef DACCESS_COMPILE // Lazy initialization of HelperMethodFrame. Need to - // call InsureInit to complete initialization + // call EnsureInit to complete initialization // If this is an FCall, the first param is the entry point for the FCALL. // The MethodDesc will be looked up form this (lazily), and this method // will be used in stack reporting, if this is not an FCall pass a 0 @@ -1336,7 +1336,7 @@ class HelperMethodFrame : public Frame { #if defined(DACCESS_COMPILE) MachState unwoundState; - InsureInit(&unwoundState); + EnsureInit(&unwoundState); return unwoundState.GetRetAddr(); #else // !DACCESS_COMPILE _ASSERTE(!"HMF's should always be initialized in the non-DAC world."); @@ -1419,7 +1419,7 @@ class HelperMethodFrame : public Frame } #endif // DACCESS_COMPILE - BOOL InsureInit(struct MachState* unwindState); + BOOL EnsureInit(struct MachState* unwindState); LazyMachState * MachineState() { LIMITED_METHOD_CONTRACT; @@ -3251,8 +3251,8 @@ class FrameWithCookie FrameType* operator&() { LIMITED_METHOD_CONTRACT; return &m_frame; } LazyMachState * MachineState() { WRAPPER_NO_CONTRACT; return m_frame.MachineState(); } Thread * GetThread() { WRAPPER_NO_CONTRACT; return m_frame.GetThread(); } - BOOL InsureInit(struct MachState* unwindState) - { WRAPPER_NO_CONTRACT; return m_frame.InsureInit(unwindState); } + BOOL EnsureInit(struct MachState* unwindState) + { WRAPPER_NO_CONTRACT; return m_frame.EnsureInit(unwindState); } void Poll() { WRAPPER_NO_CONTRACT; m_frame.Poll(); } void SetStackPointerPtr(TADDR sp) { WRAPPER_NO_CONTRACT; m_frame.SetStackPointerPtr(sp); } void InitAndLink(T_CONTEXT *pContext) { WRAPPER_NO_CONTRACT; m_frame.InitAndLink(pContext); } diff --git a/src/coreclr/vm/i386/asmhelpers.S b/src/coreclr/vm/i386/asmhelpers.S index cc4e6ee1b414d..be0d5bf56e7ce 100644 --- a/src/coreclr/vm/i386/asmhelpers.S +++ b/src/coreclr/vm/i386/asmhelpers.S @@ -180,7 +180,7 @@ LOCAL_LABEL(CallDescrWorkerInternalReturnAddress): #ifdef _DEBUG nop // This is a tag that we use in an assert. Fcalls expect to // be called from Jitted code or from certain blessed call sites like - // this one. (See HelperMethodFrame::InsureInit) + // this one. (See HelperMethodFrame::EnsureInit) #endif // Save FP return value if necessary diff --git a/src/coreclr/vm/i386/asmhelpers.asm b/src/coreclr/vm/i386/asmhelpers.asm index a34cf9a832b43..2f1d12c6d9a71 100644 --- a/src/coreclr/vm/i386/asmhelpers.asm +++ b/src/coreclr/vm/i386/asmhelpers.asm @@ -425,7 +425,7 @@ donestack: ifdef _DEBUG nop ; This is a tag that we use in an assert. Fcalls expect to ; be called from Jitted code or from certain blessed call sites like - ; this one. (See HelperMethodFrame::InsureInit) + ; this one. (See HelperMethodFrame::EnsureInit) endif ; Save FP return value if necessary diff --git a/src/coreclr/vm/i386/cgenx86.cpp b/src/coreclr/vm/i386/cgenx86.cpp index b46de5a0dd969..c4fe9b265ed62 100644 --- a/src/coreclr/vm/i386/cgenx86.cpp +++ b/src/coreclr/vm/i386/cgenx86.cpp @@ -214,7 +214,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat NOTHROW; GC_NOTRIGGER; MODE_ANY; - PRECONDITION(m_MachState.isValid()); // InsureInit has been called + PRECONDITION(m_MachState.isValid()); // EnsureInit has been called SUPPORTS_DAC; } CONTRACT_END; @@ -236,7 +236,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat // This allocation throws on OOM. MachState* pUnwoundState = (MachState*)DacAllocHostOnlyInstance(sizeof(*pUnwoundState), true); - InsureInit(pUnwoundState); + EnsureInit(pUnwoundState); pRD->PCTAddr = dac_cast(pUnwoundState->pRetAddr()); pRD->pCurrentContext->Eip = pRD->ControlPC = pUnwoundState->GetRetAddr(); @@ -295,7 +295,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat { MachState unwindState; - InsureInit(&unwindState); + EnsureInit(&unwindState); pRD->PCTAddr = dac_cast(unwindState.pRetAddr()); pRD->ControlPC = unwindState.GetRetAddr(); pRD->SP = unwindState._esp; @@ -317,10 +317,10 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat thisState->_ebp = unwindState._ebp; pRD->pEbp = (DWORD *)&thisState->_ebp; - // InsureInit always sets m_RegArgs to zero + // EnsureInit always sets m_RegArgs to zero // in the real code. I'm not sure exactly // what should happen in the on-the-fly case, - // but go with what would happen from an InsureInit. + // but go with what would happen from an EnsureInit. RETURN; } @@ -371,7 +371,7 @@ EXTERN_C MachState* STDCALL HelperMethodFrameConfirmState(HelperMethodFrame* fra BEGIN_DEBUG_ONLY_CODE; if (!state->isValid()) { - frame->InsureInit(NULL); + frame->EnsureInit(NULL); _ASSERTE(state->_pEsi != &state->_esi || state->_esi == (TADDR)esiVal); _ASSERTE(state->_pEdi != &state->_edi || state->_edi == (TADDR)ediVal); _ASSERTE(state->_pEbx != &state->_ebx || state->_ebx == (TADDR)ebxVal); diff --git a/src/coreclr/vm/jithelpers.cpp b/src/coreclr/vm/jithelpers.cpp index e116ff3b26994..1bca518432bb3 100644 --- a/src/coreclr/vm/jithelpers.cpp +++ b/src/coreclr/vm/jithelpers.cpp @@ -2060,7 +2060,7 @@ HCIMPL1(void, IL_Throw, Object* obj) HELPER_METHOD_FRAME_BEGIN_ATTRIB_NOPOLL(Frame::FRAME_ATTR_EXCEPTION); // Set up a frame #if defined(_DEBUG) && defined(TARGET_X86) - __helperframe.InsureInit(NULL); + __helperframe.EnsureInit(NULL); g_ExceptionEIP = (LPVOID)__helperframe.GetReturnAddress(); #endif // defined(_DEBUG) && defined(TARGET_X86) diff --git a/src/coreclr/vm/loongarch64/stubs.cpp b/src/coreclr/vm/loongarch64/stubs.cpp index fc047df10fbd4..5fb3bf3619857 100644 --- a/src/coreclr/vm/loongarch64/stubs.cpp +++ b/src/coreclr/vm/loongarch64/stubs.cpp @@ -472,7 +472,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat // This allocation throws on OOM. MachState* pUnwoundState = (MachState*)DacAllocHostOnlyInstance(sizeof(*pUnwoundState), true); - InsureInit(pUnwoundState); + EnsureInit(pUnwoundState); pRD->pCurrentContext->Pc = pRD->ControlPC = pUnwoundState->_pc; pRD->pCurrentContext->Sp = pRD->SP = pUnwoundState->_sp; diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp index 573a3b2ca4f85..69d5aa64d34ec 100644 --- a/src/coreclr/vm/methodtablebuilder.cpp +++ b/src/coreclr/vm/methodtablebuilder.cpp @@ -5067,7 +5067,7 @@ MethodTableBuilder::ValidateMethods() if (IsMiNative(it.ImplFlags())) { // For now simply disallow managed native code if you turn this on you have to at least - // insure that we have SkipVerificationPermission or equivalent + // ensure that we have SkipVerificationPermission or equivalent BuildMethodTableThrowException(BFA_MANAGED_NATIVE_NYI, it.Token()); } else diff --git a/src/coreclr/vm/proftoeeinterfaceimpl.cpp b/src/coreclr/vm/proftoeeinterfaceimpl.cpp index bdf2648af9d7f..fb86e2770b6cd 100644 --- a/src/coreclr/vm/proftoeeinterfaceimpl.cpp +++ b/src/coreclr/vm/proftoeeinterfaceimpl.cpp @@ -8201,11 +8201,11 @@ static BOOL EnsureFrameInitialized(Frame * pFrame) HelperMethodFrame * pHMF = (HelperMethodFrame *) pFrame; - if (pHMF->InsureInit( + if (pHMF->EnsureInit( NULL // unwindState ) != NULL) { - // InsureInit() succeeded and found the return address + // EnsureInit() succeeded and found the return address return TRUE; } diff --git a/src/coreclr/vm/riscv64/stubs.cpp b/src/coreclr/vm/riscv64/stubs.cpp index c170b00438893..5d909803c43a5 100644 --- a/src/coreclr/vm/riscv64/stubs.cpp +++ b/src/coreclr/vm/riscv64/stubs.cpp @@ -366,7 +366,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat // This allocation throws on OOM. MachState* pUnwoundState = (MachState*)DacAllocHostOnlyInstance(sizeof(*pUnwoundState), true); - InsureInit(pUnwoundState); + EnsureInit(pUnwoundState); pRD->pCurrentContext->Pc = pRD->ControlPC = pUnwoundState->_pc; pRD->pCurrentContext->Sp = pRD->SP = pUnwoundState->_sp; diff --git a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs index 1c641bb669fad..bcbb537791e0e 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs @@ -1740,12 +1740,12 @@ protected internal void RaisePropertyChanging(string name) OnPropertyChanging(new PropertyChangedEventArgs(name)); } - private DataStorage InsureStorage() => + private DataStorage EnsureStorage() => _storage ??= DataStorage.CreateStorage(this, _dataType, _storageType); internal void SetCapacity(int capacity) { - InsureStorage().SetCapacity(capacity); + EnsureStorage().SetCapacity(capacity); } private bool ShouldSerializeDefaultValue() => !DefaultValueIsNull; @@ -1760,14 +1760,14 @@ public override string ToString() => _expression == null ? internal object ConvertXmlToObject(string s) { Debug.Assert(s != null, "Caller is responsible for missing element/attribute case"); - return InsureStorage().ConvertXmlToObject(s); + return EnsureStorage().ConvertXmlToObject(s); } [RequiresUnreferencedCode(DataSet.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(DataSet.RequiresDynamicCodeMessage)] internal object ConvertXmlToObject(XmlReader xmlReader, XmlRootAttribute? xmlAttrib) { - return InsureStorage().ConvertXmlToObject(xmlReader, xmlAttrib); + return EnsureStorage().ConvertXmlToObject(xmlReader, xmlAttrib); } [RequiresUnreferencedCode(DataSet.RequiresUnreferencedCodeMessage)] @@ -1775,7 +1775,7 @@ internal object ConvertXmlToObject(XmlReader xmlReader, XmlRootAttribute? xmlAtt internal string ConvertObjectToXml(object value) { Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); - return InsureStorage().ConvertObjectToXml(value); + return EnsureStorage().ConvertObjectToXml(value); } [RequiresUnreferencedCode(DataSet.RequiresUnreferencedCodeMessage)] @@ -1783,12 +1783,12 @@ internal string ConvertObjectToXml(object value) internal void ConvertObjectToXml(object value, XmlWriter xmlWriter, XmlRootAttribute? xmlAttrib) { Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); - InsureStorage().ConvertObjectToXml(value, xmlWriter, xmlAttrib); + EnsureStorage().ConvertObjectToXml(value, xmlWriter, xmlAttrib); } internal object GetEmptyColumnStore(int recordCount) { - return InsureStorage().GetEmptyStorageInternal(recordCount); + return EnsureStorage().GetEmptyStorageInternal(recordCount); } internal void CopyValueIntoStore(int record, object store, BitArray nullbits, int storeIndex) @@ -1800,7 +1800,7 @@ internal void CopyValueIntoStore(int record, object store, BitArray nullbits, in [RequiresUnreferencedCode(DataSet.RequiresUnreferencedCodeMessage)] internal void SetStorage(object store, BitArray nullbits) { - InsureStorage().SetStorageInternal(store, nullbits); + EnsureStorage().SetStorageInternal(store, nullbits); } internal void AddDependentColumn(DataColumn expressionColumn) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index d280d33c6e3b5..70c625d217b29 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -5261,7 +5261,7 @@ internal EventDispatcher(EventDispatcher? next, bool[]? eventEnabled, EventListe internal readonly EventListener m_Listener; // The dispatcher this entry is for internal bool[]? m_EventEnabled; // For every event in a the eventSource, is it enabled? - // Only guaranteed to exist after a InsureInit() + // Only guaranteed to exist after a EnsureInit() internal EventDispatcher? m_Next; // These form a linked list in code:EventSource.m_Dispatchers // Of all listeners for that eventSource. } diff --git a/src/libraries/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverEngine.cs b/src/libraries/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverEngine.cs index 7d38b1255f535..ffa85c3f2a7ee 100644 --- a/src/libraries/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverEngine.cs +++ b/src/libraries/System.Private.Xml/tests/Writers/RwFactory/CXmlDriverEngine.cs @@ -693,7 +693,7 @@ private CXmlDriverScenario CreateTestCase(string name, string desc, CXmlDriverPa } catch (Exception e) { - throw new CXmlDriverException("XmlDriver: CreateIntance failed for TestCase '" + "CRWFactoryDriverScenario"/*type.Name*/ + "' (" + e.ToString() + ")"); + throw new CXmlDriverException($"XmlDriver: CreateInstance failed for TestCase '{nameof(CRWFactoryDriverScenario) /*type.Name*/}' ({e})"); } return tmp; }