From cef1fd517b3731372ed51cc840047aab5b68bec0 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Fri, 23 Aug 2024 21:09:35 +0800 Subject: [PATCH 1/4] pal/misc.h --- src/coreclr/pal/src/include/pal/misc.h | 54 ------------------------- src/coreclr/pal/src/init/pal.cpp | 1 - src/coreclr/pal/src/misc/fmtmessage.cpp | 1 - src/coreclr/pal/src/misc/perftrace.cpp | 1 - src/coreclr/pal/src/misc/time.cpp | 1 - 5 files changed, 58 deletions(-) delete mode 100644 src/coreclr/pal/src/include/pal/misc.h diff --git a/src/coreclr/pal/src/include/pal/misc.h b/src/coreclr/pal/src/include/pal/misc.h deleted file mode 100644 index ffa6448ed7d308..00000000000000 --- a/src/coreclr/pal/src/include/pal/misc.h +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*++ - - - -Module Name: - - include/pal/misc.h - -Abstract: - Header file for the initialization and clean up functions - for the misc Win32 functions - - - ---*/ - -#ifndef __MISC_H_ -#define __MISC_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif // __cplusplus - -/*++ -Function : - MsgBoxInitialize - - Initialize the critical sections. - -Return value: - TRUE if initialize succeeded - FALSE otherwise - ---*/ -BOOL MsgBoxInitialize( void ); - -/*++ -Function : - MsgBoxCleanup - - Deletes the critical sections. - ---*/ -void MsgBoxCleanup( void ); - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif /* __MISC_H_ */ diff --git a/src/coreclr/pal/src/init/pal.cpp b/src/coreclr/pal/src/init/pal.cpp index a6bd6f01f1dff0..8dcf3a1aee4830 100644 --- a/src/coreclr/pal/src/init/pal.cpp +++ b/src/coreclr/pal/src/init/pal.cpp @@ -30,7 +30,6 @@ SET_DEFAULT_DEBUG_CHANNEL(PAL); // some headers have code with asserts, so do th #include "../thread/procprivate.hpp" #include "pal/module.h" #include "pal/virtual.h" -#include "pal/misc.h" #include "pal/environ.h" #include "pal/utils.h" #include "pal/debug.h" diff --git a/src/coreclr/pal/src/misc/fmtmessage.cpp b/src/coreclr/pal/src/misc/fmtmessage.cpp index 0598914b06cb51..cfedd815da3cae 100644 --- a/src/coreclr/pal/src/misc/fmtmessage.cpp +++ b/src/coreclr/pal/src/misc/fmtmessage.cpp @@ -23,7 +23,6 @@ Revision History: #include "pal/dbgmsg.h" #include "pal/critsect.h" #include "pal/module.h" -#include "pal/misc.h" #include "errorstrings.h" diff --git a/src/coreclr/pal/src/misc/perftrace.cpp b/src/coreclr/pal/src/misc/perftrace.cpp index 691c9048cb5729..2f5072a8da2375 100644 --- a/src/coreclr/pal/src/misc/perftrace.cpp +++ b/src/coreclr/pal/src/misc/perftrace.cpp @@ -27,7 +27,6 @@ Module Name: #include "pal/perftrace.h" #include "pal/dbgmsg.h" #include "pal/cruntime.h" -#include "pal/misc.h" /* Standard headers */ #include diff --git a/src/coreclr/pal/src/misc/time.cpp b/src/coreclr/pal/src/misc/time.cpp index 7d78ae930c3979..2774cb7f125b75 100644 --- a/src/coreclr/pal/src/misc/time.cpp +++ b/src/coreclr/pal/src/misc/time.cpp @@ -19,7 +19,6 @@ Module Name: #include "pal/palinternal.h" #include "pal/dbgmsg.h" -#include "pal/misc.h" #include #include From 8141296118edacf5e4d801ea546783d950d95c6a Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 10 Dec 2024 23:14:15 +0800 Subject: [PATCH 2/4] COMCharacter --- src/coreclr/vm/util.cpp | 56 ----------------------------------------- src/coreclr/vm/util.hpp | 11 -------- 2 files changed, 67 deletions(-) diff --git a/src/coreclr/vm/util.cpp b/src/coreclr/vm/util.cpp index c279c50bf2b981..331a430436e25b 100644 --- a/src/coreclr/vm/util.cpp +++ b/src/coreclr/vm/util.cpp @@ -1889,62 +1889,6 @@ int __cdecl stricmpUTF8(const char* szStr1, const char* szStr2) } #ifndef DACCESS_COMPILE -// -// -// COMCharacter and Helper functions -// -// - -#ifndef TARGET_UNIX -/*============================GetCharacterInfoHelper============================ -**Determines character type info (digit, whitespace, etc) for the given char. -**Args: c is the character on which to operate. -** CharInfoType is one of CT_CTYPE1, CT_CTYPE2, CT_CTYPE3 and specifies the type -** of information being requested. -**Returns: The bitmask returned by GetStringTypeEx. The caller needs to know -** how to interpret this. -**Exceptions: ArgumentException if GetStringTypeEx fails. -==============================================================================*/ -INT32 GetCharacterInfoHelper(WCHAR c, INT32 CharInfoType) -{ - WRAPPER_NO_CONTRACT; - - unsigned short result=0; - if (!GetStringTypeEx(LOCALE_USER_DEFAULT, CharInfoType, &(c), 1, &result)) { - _ASSERTE(!"This should not happen, verify the arguments passed to GetStringTypeEx()"); - } - return(INT32)result; -} -#endif // !TARGET_UNIX - -/*==============================nativeIsWhiteSpace============================== -**The locally available version of IsWhiteSpace. Designed to be called by other -**native methods. The work is mostly done by GetCharacterInfoHelper -**Args: c -- the character to check. -**Returns: true if c is whitespace, false otherwise. -**Exceptions: Only those thrown by GetCharacterInfoHelper. -==============================================================================*/ -BOOL COMCharacter::nativeIsWhiteSpace(WCHAR c) -{ - WRAPPER_NO_CONTRACT; - -#ifndef TARGET_UNIX - if (c <= (WCHAR) 0x7F) // common case - { - BOOL result = (c == ' ') || (c == '\r') || (c == '\n') || (c == '\t') || (c == '\f') || (c == (WCHAR) 0x0B); - - ASSERT(result == ((GetCharacterInfoHelper(c, CT_CTYPE1) & C1_SPACE)!=0)); - - return result; - } - - // GetCharacterInfoHelper costs around 160 instructions - return((GetCharacterInfoHelper(c, CT_CTYPE1) & C1_SPACE)!=0); -#else // !TARGET_UNIX - return iswspace(c); -#endif // !TARGET_UNIX -} - BOOL RuntimeFileNotFound(HRESULT hr) { LIMITED_METHOD_CONTRACT; diff --git a/src/coreclr/vm/util.hpp b/src/coreclr/vm/util.hpp index a025e86e0768b0..bfe16de10da136 100644 --- a/src/coreclr/vm/util.hpp +++ b/src/coreclr/vm/util.hpp @@ -800,17 +800,6 @@ BOOL DbgIsExecutable(LPVOID lpMem, SIZE_T length); int GetRandomInt(int maxVal); -// -// -// COMCHARACTER -// -// -class COMCharacter { -public: - //These are here for support from native code. They are never called from our managed classes. - static BOOL nativeIsWhiteSpace(WCHAR c); -}; - // ====================================================================================== // Simple, reusable 100ns timer for normalizing ticks. For use in Q/FCalls to avoid discrepency with // tick frequency between native and managed. From 180d5e6d74722824f35e393f3f5d00d314f1f035 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 10 Dec 2024 23:21:48 +0800 Subject: [PATCH 3/4] MAX_CACHE_LINE_SIZE --- src/coreclr/vm/util.hpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/coreclr/vm/util.hpp b/src/coreclr/vm/util.hpp index bfe16de10da136..e50c42153b4139 100644 --- a/src/coreclr/vm/util.hpp +++ b/src/coreclr/vm/util.hpp @@ -18,13 +18,6 @@ #include "posterror.h" #include -// Hot cache lines need to be aligned to cache line size to improve performance -#if defined(TARGET_ARM64) -#define MAX_CACHE_LINE_SIZE 128 -#else -#define MAX_CACHE_LINE_SIZE 64 -#endif - #ifndef DACCESS_COMPILE #if defined(TARGET_WINDOWS) && defined(TARGET_ARM64) // Flag to check if atomics feature is available on From 49968a32f9b8d62d20ac86a59c5f40d1f0cc106b Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Tue, 10 Dec 2024 23:40:47 +0800 Subject: [PATCH 4/4] clr/fs --- src/coreclr/inc/clr/fs.h | 13 ------------- src/coreclr/inc/clr/fs/path.h | 4 ---- src/coreclr/inc/clr/str.h | 27 --------------------------- 3 files changed, 44 deletions(-) delete mode 100644 src/coreclr/inc/clr/fs.h delete mode 100644 src/coreclr/inc/clr/str.h diff --git a/src/coreclr/inc/clr/fs.h b/src/coreclr/inc/clr/fs.h deleted file mode 100644 index d7efac04cf5fb3..00000000000000 --- a/src/coreclr/inc/clr/fs.h +++ /dev/null @@ -1,13 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// This header will include all headers relating to file system functionality. - -#ifndef _clr_fs_h_ -#define _clr_fs_h_ - -#include "fs/path.h" - -#endif // _clr_fs_h_ diff --git a/src/coreclr/inc/clr/fs/path.h b/src/coreclr/inc/clr/fs/path.h index efc21a5cdd4392..1f5454c9ac9252 100644 --- a/src/coreclr/inc/clr/fs/path.h +++ b/src/coreclr/inc/clr/fs/path.h @@ -10,10 +10,6 @@ #include "clrtypes.h" -#include "strsafe.h" - -#include "clr/str.h" - namespace clr { namespace fs diff --git a/src/coreclr/inc/clr/str.h b/src/coreclr/inc/clr/str.h deleted file mode 100644 index d09a965fed6816..00000000000000 --- a/src/coreclr/inc/clr/str.h +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// - -// -// This header provides general standard string services. -// - -#ifndef _clr_str_h_ -#define _clr_str_h_ - -namespace clr -{ - namespace str - { - //----------------------------------------------------------------------------------------- - // Returns true if the provided string is a null pointer or the empty string. - static inline bool - IsNullOrEmpty(LPCWSTR wzStr) - { - return wzStr == nullptr || *wzStr == W('\0'); - } - } -} - -#endif // _clr_str_h_ -