Skip to content

Commit

Permalink
More PAL cleanup (dotnet#26709)
Browse files Browse the repository at this point in the history
* Delete more unused methods from PAL

* Delete PAL_EntryPoint

* Delete always defined FEATURE_PAL_SXS and related code
  • Loading branch information
jkotas committed Sep 14, 2019
1 parent bce868f commit 59002f5
Show file tree
Hide file tree
Showing 38 changed files with 22 additions and 731 deletions.
4 changes: 0 additions & 4 deletions clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,8 @@ if(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DFEATURE_MERGE_JIT_AND_ENGINE)
endif(FEATURE_MERGE_JIT_AND_ENGINE)
add_definitions(-DFEATURE_MULTICOREJIT)
if (FEATURE_NI_BIND_FALLBACK)
add_definitions(-DFEATURE_NI_BIND_FALLBACK)
endif(FEATURE_NI_BIND_FALLBACK)
if(CLR_CMAKE_PLATFORM_UNIX)
add_definitions(-DFEATURE_PAL)
add_definitions(-DFEATURE_PAL_SXS)
add_definitions(-DFEATURE_PAL_ANSI)
endif(CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_PLATFORM_LINUX OR CLR_CMAKE_PLATFORM_FREEBSD)
Expand Down
5 changes: 0 additions & 5 deletions src/binder/assemblybinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,6 @@ namespace BINDER_SPACE
sCoreLib = sCoreLibDir;
sCoreLib.Append(CoreLibName_IL_W);
BOOL fExplicitBindToNativeImage = (fBindToNativeImage == true)? TRUE:FALSE;
#ifdef FEATURE_NI_BIND_FALLBACK
// Some non-Windows platforms do not automatically generate the NI image as CoreLib.dll.
// If those platforms also do not support automatic fallback from NI to IL, bind as IL.
fExplicitBindToNativeImage = FALSE;
#endif // FEATURE_NI_BIND_FALLBACK
IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib,
TRUE /* fIsInGAC */,
fExplicitBindToNativeImage,
Expand Down
4 changes: 0 additions & 4 deletions src/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1990,10 +1990,6 @@ HRESULT Debugger::Startup(void)
}
#endif

#ifdef FEATURE_PAL
PAL_InitializeDebug();
#endif // FEATURE_PAL

// Lazily initialize the interop-safe heap

// Must be done before the RC thread is initialized.
Expand Down
86 changes: 0 additions & 86 deletions src/pal/inc/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,6 @@ typedef PVOID NATIVE_LIBRARY_HANDLE;
#endif // !_MSC_VER
#endif // !THROW_DECL

#ifndef _MSC_VER
#if defined(CORECLR)
// Define this if the underlying platform supports true 2-pass EH.
// At the same time, this enables running several PAL instances
// side-by-side.
#define FEATURE_PAL_SXS 1
#endif // CORECLR
#endif // !_MSC_VER

#if defined(_MSC_VER)
#define DECLSPEC_ALIGN(x) __declspec(align(x))
#else
Expand Down Expand Up @@ -395,13 +386,6 @@ PALAPI
PAL_InitializeCoreCLR(
const char *szExePath);

PALIMPORT
DWORD_PTR
PALAPI
PAL_EntryPoint(
IN LPTHREAD_START_ROUTINE lpStartAddress,
IN LPVOID lpParameter);

/// <summary>
/// This function shuts down PAL WITHOUT exiting the current process.
/// </summary>
Expand Down Expand Up @@ -501,12 +485,6 @@ PAL_GetTransportPipeName(
IN const char *applicationGroupId,
IN const char *suffix);

PALIMPORT
void
PALAPI
PAL_InitializeDebug(
void);

PALIMPORT
void
PALAPI
Expand Down Expand Up @@ -3024,8 +3002,6 @@ PAL_BindResources(IN LPCSTR lpDomain);
#define EXCEPTION_NONCONTINUABLE 0x1
#define EXCEPTION_UNWINDING 0x2

#ifdef FEATURE_PAL_SXS

#define EXCEPTION_EXIT_UNWIND 0x4 // Exit unwind is in progress (not used by PAL SEH)
#define EXCEPTION_NESTED_CALL 0x10 // Nested exception handler call
#define EXCEPTION_TARGET_UNWIND 0x20 // Target unwind in progress
Expand All @@ -3039,8 +3015,6 @@ PAL_BindResources(IN LPCSTR lpDomain);
#define IS_UNWINDING(Flag) ((Flag & EXCEPTION_UNWIND) != 0)
#define IS_TARGET_UNWIND(Flag) (Flag & EXCEPTION_TARGET_UNWIND)

#endif // FEATURE_PAL_SXS

#define EXCEPTION_IS_SIGNAL 0x100

#define EXCEPTION_MAXIMUM_PARAMETERS 15
Expand All @@ -3064,8 +3038,6 @@ typedef struct _EXCEPTION_POINTERS {
PCONTEXT ContextRecord;
} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS;

#ifdef FEATURE_PAL_SXS

typedef LONG EXCEPTION_DISPOSITION;

enum {
Expand All @@ -3075,8 +3047,6 @@ enum {
ExceptionCollidedUnwind,
};

#endif // FEATURE_PAL_SXS

//
// A function table entry is generated for each frame function.
//
Expand Down Expand Up @@ -3273,25 +3243,9 @@ PALAPI
PAL_nanosleep(
IN long timeInNs);

#ifndef FEATURE_PAL_SXS

typedef LONG (PALAPI_NOEXPORT *PTOP_LEVEL_EXCEPTION_FILTER)(
struct _EXCEPTION_POINTERS *ExceptionInfo);
typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;

PALIMPORT
LPTOP_LEVEL_EXCEPTION_FILTER
PALAPI
SetUnhandledExceptionFilter(
IN LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);

#else // FEATURE_PAL_SXS

typedef EXCEPTION_DISPOSITION (PALAPI_NOEXPORT *PVECTORED_EXCEPTION_HANDLER)(
struct _EXCEPTION_POINTERS *ExceptionPointers);

#endif // FEATURE_PAL_SXS

// Define BitScanForward64 and BitScanForward
// Per MSDN, BitScanForward64 will search the mask data from LSB to MSB for a set bit.
// If one is found, its bit position is stored in the out PDWORD argument and 1 is returned;
Expand Down Expand Up @@ -4458,18 +4412,6 @@ PALIMPORT DLLEXPORT void * __cdecl bsearch(const void *, const void *, size_t, s

PALIMPORT time_t __cdecl time(time_t *);

struct tm {
int tm_sec; /* seconds after the minute - [0,59] */
int tm_min; /* minutes after the hour - [0,59] */
int tm_hour; /* hours since midnight - [0,23] */
int tm_mday; /* day of the month - [1,31] */
int tm_mon; /* months since January - [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday - [0,6] */
int tm_yday; /* days since January 1 - [0,365] */
int tm_isdst; /* daylight savings time flag */
};

#endif // !PAL_STDCPP_COMPAT

PALIMPORT int __cdecl _open_osfhandle(INT_PTR, int);
Expand Down Expand Up @@ -4815,8 +4757,6 @@ class CatchHardwareExceptionHolder
#define HardwareExceptionHolder
#endif // FEATURE_ENABLE_HARDWARE_EXCEPTIONS

#ifdef FEATURE_PAL_SXS

class NativeExceptionHolderBase;

PALIMPORT
Expand Down Expand Up @@ -5027,8 +4967,6 @@ class NativeExceptionHolderFactory

} // extern "C++"

#endif // FEATURE_PAL_SXS

#define PAL_CPP_THROW(type, obj) { throw obj; }
#define PAL_CPP_RETHROW { throw; }
#define PAL_CPP_TRY try { HardwareExceptionHolder
Expand All @@ -5046,32 +4984,8 @@ class NativeExceptionHolderFactory
#pragma warning(disable:4611) // interaction between '_setjmp' and C++ object destruction is non-portable
#endif

#ifdef FEATURE_PAL_SXS

#define PAL_TRY_FOR_DLLMAIN(ParamType, paramDef, paramRef, _reason) PAL_TRY(ParamType, paramDef, paramRef)

#else // FEATURE_PAL_SXS

#define PAL_TRY(ParamType, paramDef, paramRef) \
{ \
ParamType __param = paramRef; \
ParamType paramDef; paramDef = __param; \
try { \
HardwareExceptionHolder

#define PAL_TRY_FOR_DLLMAIN(ParamType, paramDef, paramRef, _reason) \
{ \
ParamType __param = paramRef; \
ParamType paramDef; paramDef = __param; \
try { \
HardwareExceptionHolder

#define PAL_ENDTRY \
} \
}

#endif // FEATURE_PAL_SXS

#endif // __cplusplus

// Platform-specific library naming
Expand Down
4 changes: 0 additions & 4 deletions src/pal/inc/pal_unwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#ifndef __PAL_UNWIND_H__
#define __PAL_UNWIND_H__

#if FEATURE_PAL_SXS

#ifdef __cplusplus
extern "C"
{
Expand Down Expand Up @@ -86,6 +84,4 @@ extern "C"
};
#endif // __cplusplus

#endif // FEATURE_PAL_SXS

#endif // __PAL_UNWIND_H__
4 changes: 0 additions & 4 deletions src/pal/inc/rt/palrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1281,8 +1281,6 @@ typedef OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK *POUT_OF_PROCESS_FUNCTION_TABLE_C
#define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME \
"OutOfProcessFunctionTableCallback"

#if defined(FEATURE_PAL_SXS)

// #if !defined(_TARGET_MAC64)
// typedef LONG (*PEXCEPTION_ROUTINE)(
// IN PEXCEPTION_POINTERS pExceptionPointers,
Expand Down Expand Up @@ -1403,8 +1401,6 @@ typedef DISPATCHER_CONTEXT *PDISPATCHER_CONTEXT;
#define ExceptionStackUnwind EXCEPTION_EXECUTE_HANDLER
#define ExceptionContinueExecution EXCEPTION_CONTINUE_EXECUTION

#endif // FEATURE_PAL_SXS

typedef struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD;
typedef EXCEPTION_REGISTRATION_RECORD *PEXCEPTION_REGISTRATION_RECORD;

Expand Down
Loading

0 comments on commit 59002f5

Please sign in to comment.