Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #110632

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix typos #110632

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/coreclr/pal/src/include/pal/synchcache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.

/*++



Module Name:

include/pal/synchcache.hpp

Abstract:
Simple look-aside cache for unused objects with default
constructor or no constructor



--*/

#ifndef _SYNCH_CACHE_H_
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/amd64/cgenamd64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/arm/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/arm64/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/fcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<UINT_PTR>( (__helperframe.InsureInit(NULL)), (__helperframe.MachineState()->GetRetAddr()) ) )
( static_cast<UINT_PTR>( (__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!!!
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/vm/frames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -1813,7 +1813,7 @@ MethodDesc* HelperMethodFrame::GetFunction()
//
//

BOOL HelperMethodFrame::InsureInit(MachState * unwindState)
BOOL HelperMethodFrame::EnsureInit(MachState * unwindState)
{
CONTRACTL {
NOTHROW;
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/vm/frames.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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); }
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/i386/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/i386/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/coreclr/vm/i386/cgenx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<TADDR>(pUnwoundState->pRetAddr());
pRD->pCurrentContext->Eip = pRD->ControlPC = pUnwoundState->GetRetAddr();
Expand Down Expand Up @@ -295,7 +295,7 @@ void HelperMethodFrame::UpdateRegDisplay(const PREGDISPLAY pRD, bool updateFloat
{
MachState unwindState;

InsureInit(&unwindState);
EnsureInit(&unwindState);
pRD->PCTAddr = dac_cast<TADDR>(unwindState.pRetAddr());
pRD->ControlPC = unwindState.GetRetAddr();
pRD->SP = unwindState._esp;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/jithelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/loongarch64/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/methodtablebuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/vm/proftoeeinterfaceimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/riscv64/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions src/libraries/System.Data.Common/src/System/Data/DataColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -1760,35 +1760,35 @@ 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)]
[RequiresDynamicCode(DataSet.RequiresDynamicCodeMessage)]
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)]
[RequiresDynamicCode(DataSet.RequiresDynamicCodeMessage)]
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)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading