Repository: dotnet/runtime
File: src/coreclr/vm/jithelpers.cpp (C++)

Code before:

    GCX_COOP();
    if (gcStatic)
    {
        refHandle.Set(pMT->GetGCThreadStaticsBasePointer());
    }
    else
    {
        refHandle.Set(pMT->GetNonGCThreadStaticsBasePointer());
    }

    END_QCALL;
}

// *** This helper corresponds CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED2.
HCIMPL1(void*, JIT_GetNonGCThreadStaticBaseOptimized2, UINT32 staticBlockIndex)
{
    FCALL_CONTRACT;

    return ((BYTE*)&t_ThreadStatics) + staticBlockIndex;
}
HCIMPLEND

// *** This helper corresponds CORINFO_HELP_GETDIRECTONTHREADLOCALDATA_NONGCTHREADSTATIC_BASE.
// Returns the address of the pThread field within thread-local storage, which serves as the storage
// location for the DirectOnThreadLocalData.pNativeThread thread static field. Adjust the value by adjusted by
// OFFSETOF__CORINFO_Array__data, since all thread static bases are returned as relative to the start of an
// array object.
HCIMPL0(void*, JIT_GetDirectOnThreadLocalDataNonGCThreadStaticBase)
{
    FCALL_CONTRACT;

    return (void*)((uint8_t*)&(((ThreadLocalData*)&t_ThreadStatics)->pThread) - OFFSETOF__CORINFO_Array__data);
}
HCIMPLEND

#include <optdefault.h>

//========================================================================
//
//      CASTING HELPERS
//
//========================================================================

static BOOL ObjIsInstanceOfCore(Object *pObject, TypeHandle toTypeHnd, BOOL throwCastException)
{
    CONTRACTL {
        THROWS;
        GC_TRIGGERS;
        MODE_COOPERATIVE;
        PRECONDITION(CheckPointer(pObject));

Review comment (suggestion):
The phrase "Adjust the value by adjusted by" contains a redundant word. It should be either "Adjust the value by" or "adjusted by".
```suggestion
// location for the DirectOnThreadLocalData.pNativeThread thread static field. Adjust the value by
```

Code after:

    GCX_COOP();
    if (gcStatic)
    {
        refHandle.Set(pMT->GetGCThreadStaticsBasePointer());
    }
    else
    {
        refHandle.Set(pMT->GetNonGCThreadStaticsBasePointer());
    }

    END_QCALL;
}

// *** This helper corresponds CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR_OPTIMIZED2.
HCIMPL1(void*, JIT_GetNonGCThreadStaticBaseOptimized2, UINT32 staticBlockIndex)
{
    FCALL_CONTRACT;

    return ((BYTE*)&t_ThreadStatics) + staticBlockIndex;
}
HCIMPLEND

// *** This helper corresponds CORINFO_HELP_GETDIRECTONTHREADLOCALDATA_NONGCTHREADSTATIC_BASE.
// Returns the address of the pThread field within thread-local storage, which serves as the storage
// location for the DirectOnThreadLocalData.pNativeThread thread static field. Adjust the value by
// OFFSETOF__CORINFO_Array__data, since all thread static bases are returned as relative to the start of an
// array object.
HCIMPL0(void*, JIT_GetDirectOnThreadLocalDataNonGCThreadStaticBase)
{
    FCALL_CONTRACT;

    return (void*)((uint8_t*)&(((ThreadLocalData*)&t_ThreadStatics)->pThread) - OFFSETOF__CORINFO_Array__data);
}
HCIMPLEND

#include <optdefault.h>

//========================================================================
//
//      CASTING HELPERS
//
//========================================================================

static BOOL ObjIsInstanceOfCore(Object *pObject, TypeHandle toTypeHnd, BOOL throwCastException)
{
    CONTRACTL {
        THROWS;
        GC_TRIGGERS;
        MODE_COOPERATIVE;
        PRECONDITION(CheckPointer(pObject));