ソースを参照

Remove unused preprocessors

Oguz Bastemur 9 年 前
コミット
92243a06e9

+ 21 - 28
lib/Backend/BailOut.cpp

@@ -316,12 +316,6 @@ BailOutRecord::BailOutRecord(uint32 bailOutOffset, uint bailOutCacheIndex, IR::B
 }
 
 #if ENABLE_DEBUG_CONFIG_OPTIONS
-#define REJIT_TESTTRACE(...) \
-    if (Js::Configuration::Global.flags.TestTrace.IsEnabled(Js::ReJITPhase)) \
-    { \
-        Output::Print(__VA_ARGS__); \
-        Output::Flush(); \
-    }
 #define REJIT_KIND_TESTTRACE(bailOutKind, ...) \
     if (Js::Configuration::Global.flags.TestTrace.IsEnabled(Js::ReJITPhase)) \
     { \
@@ -334,7 +328,6 @@ BailOutRecord::BailOutRecord(uint32 bailOutOffset, uint bailOutCacheIndex, IR::B
 const char16 * const trueString = _u("true");
 const char16 * const falseString = _u("false");
 #else
-#define REJIT_TESTTRACE(...)
 #define REJIT_KIND_TESTTRACE(...)
 #endif
 
@@ -727,8 +720,8 @@ BailOutRecord::AdjustOffsetsForDiagMode(Js::JavascriptCallStackLayout * layout,
 }
 
 void
-BailOutRecord::IsOffsetNativeIntOrFloat(uint offsetIndex, int argOutSlotStart, bool * pIsFloat64, bool * pIsInt32, 
-    bool * pIsSimd128F4, bool * pIsSimd128I4, bool * pIsSimd128I8, bool * pIsSimd128I16, bool * pIsSimd128U4, 
+BailOutRecord::IsOffsetNativeIntOrFloat(uint offsetIndex, int argOutSlotStart, bool * pIsFloat64, bool * pIsInt32,
+    bool * pIsSimd128F4, bool * pIsSimd128I4, bool * pIsSimd128I8, bool * pIsSimd128I16, bool * pIsSimd128U4,
     bool * pIsSimd128U8, bool * pIsSimd128U16, bool * pIsSimd128B4, bool * pIsSimd128B8, bool * pIsSimd128B16) const
 {
     bool isFloat64 = this->argOutOffsetInfo->argOutFloat64Syms->Test(argOutSlotStart + offsetIndex) != 0;
@@ -745,7 +738,7 @@ BailOutRecord::IsOffsetNativeIntOrFloat(uint offsetIndex, int argOutSlotStart, b
     bool isSimd128B8    = this->argOutOffsetInfo->argOutSimd128B8Syms->Test(argOutSlotStart + offsetIndex) != 0;
     bool isSimd128B16   = this->argOutOffsetInfo->argOutSimd128B16Syms->Test(argOutSlotStart + offsetIndex) != 0;
 
-    Assert(!isFloat64 || !isInt32 || 
+    Assert(!isFloat64 || !isInt32 ||
         !isSimd128F4 || !isSimd128I4 || !isSimd128I8 || !isSimd128I16 || !
         !isSimd128U4 || !isSimd128U8 || !isSimd128U16);
 
@@ -766,8 +759,8 @@ BailOutRecord::IsOffsetNativeIntOrFloat(uint offsetIndex, int argOutSlotStart, b
 void
 BailOutRecord::RestoreValue(IR::BailOutKind bailOutKind, Js::JavascriptCallStackLayout * layout, Js::Var * values, Js::ScriptContext * scriptContext,
     bool fromLoopBody, Js::Var * registerSaves, Js::InterpreterStackFrame * newInstance, Js::Var* pArgumentsObject, void * argoutRestoreAddress,
-    uint regSlot, int offset, bool isLocal, bool isFloat64, bool isInt32, 
-    bool isSimd128F4, bool isSimd128I4, bool isSimd128I8, bool isSimd128I16, 
+    uint regSlot, int offset, bool isLocal, bool isFloat64, bool isInt32,
+    bool isSimd128F4, bool isSimd128I4, bool isSimd128I8, bool isSimd128I16,
     bool isSimd128U4, bool isSimd128U8, bool isSimd128U16, bool isSimd128B4, bool isSimd128B8, bool isSimd128B16) const
 {
     bool boxStackInstance = true;
@@ -801,7 +794,7 @@ BailOutRecord::RestoreValue(IR::BailOutKind bailOutKind, Js::JavascriptCallStack
             }
             else if (
                     isSimd128F4 || isSimd128I4 || isSimd128I8 || isSimd128I16 ||
-                    isSimd128U4 || isSimd128U8 || isSimd128U16 || isSimd128B4 || 
+                    isSimd128U4 || isSimd128U8 || isSimd128U16 || isSimd128B4 ||
                     isSimd128B8 || isSimd128B16
                     )
             {
@@ -826,8 +819,8 @@ BailOutRecord::RestoreValue(IR::BailOutKind bailOutKind, Js::JavascriptCallStack
             // and we bailout during bar args evaluation, we recover from args from argoutRestoreAddress, not from caller function frame.
             // This is because try-catch is implemented as a C wrapper, so args will be a different offset from rbp in that case.
             Assert(
-                   !isFloat64 && !isInt32 && 
-                   !isSimd128F4 && !isSimd128I4 && !isSimd128I8 && !isSimd128I16 && !isSimd128U4 && 
+                   !isFloat64 && !isInt32 &&
+                   !isSimd128F4 && !isSimd128I4 && !isSimd128I8 && !isSimd128I16 && !isSimd128U4 &&
                    !isSimd128U8 && !isSimd128U16 && !isSimd128B4 && !isSimd128B8 && !isSimd128B16
                   );
 
@@ -1019,8 +1012,8 @@ BailOutRecord::RestoreValues(IR::BailOutKind bailOutKind, Js::JavascriptCallStac
         globalBailOutRecordTable->IterateGlobalBailOutRecordTableRows(m_bailOutRecordId, [=](GlobalBailOutRecordDataRow *row) {
             Assert(row->offset != 0);
             RestoreValue(bailOutKind, layout, values, scriptContext, fromLoopBody, registerSaves, newInstance, pArgumentsObject,
-                argoutRestoreAddress, row->regSlot, row->offset, true, row->isFloat, row->isInt, row->isSimd128F4, 
-                row->isSimd128I4, row->isSimd128I8, row->isSimd128I16, row->isSimd128U4, row->isSimd128U8, row->isSimd128U16, 
+                argoutRestoreAddress, row->regSlot, row->offset, true, row->isFloat, row->isInt, row->isSimd128F4,
+                row->isSimd128I4, row->isSimd128I8, row->isSimd128I16, row->isSimd128U4, row->isSimd128U8, row->isSimd128U16,
                 row->isSimd128B4, row->isSimd128B8, row->isSimd128B16);
         });
     }
@@ -1045,12 +1038,12 @@ BailOutRecord::RestoreValues(IR::BailOutKind bailOutKind, Js::JavascriptCallStac
             bool isSimd128B16;
 
             offset = offsets[i];
-            this->IsOffsetNativeIntOrFloat(i, argOutSlotStart, &isFloat64, &isInt32, 
-                                           &isSimd128F4, &isSimd128I4, &isSimd128I8, &isSimd128I16, 
+            this->IsOffsetNativeIntOrFloat(i, argOutSlotStart, &isFloat64, &isInt32,
+                                           &isSimd128F4, &isSimd128I4, &isSimd128I8, &isSimd128I16,
                                            &isSimd128U4, &isSimd128U8, &isSimd128U16, &isSimd128B4, &isSimd128B8, &isSimd128B16);
 
             RestoreValue(bailOutKind, layout, values, scriptContext, fromLoopBody, registerSaves, newInstance, pArgumentsObject,
-                         argoutRestoreAddress, i, offset, false, isFloat64, isInt32, isSimd128F4, isSimd128I4, isSimd128I8, 
+                         argoutRestoreAddress, i, offset, false, isFloat64, isInt32, isSimd128F4, isSimd128I4, isSimd128I8,
                          isSimd128I16, isSimd128U4, isSimd128U8, isSimd128U16, isSimd128B4, isSimd128B8, isSimd128B16);
         }
     }
@@ -1654,10 +1647,10 @@ BailOutRecord::BailOutHelper(Js::JavascriptCallStackLayout * layout, Js::ScriptF
             newInstance->SetNonVarReg(paramClosureReg, nullptr);
         }
     }
-    
+
     if (bailOutRecord->globalBailOutRecordTable->hasStackArgOpt)
     {
-        newInstance->TrySetFrameObjectInHeapArgObj(functionScriptContext, bailOutRecord->globalBailOutRecordTable->hasNonSimpleParams, 
+        newInstance->TrySetFrameObjectInHeapArgObj(functionScriptContext, bailOutRecord->globalBailOutRecordTable->hasNonSimpleParams,
             bailOutRecord->globalBailOutRecordTable->isScopeObjRestored);
     }
 
@@ -1911,7 +1904,7 @@ void BailOutRecord::ScheduleFunctionCodeGen(Js::ScriptFunction * function, Js::S
 
             case IR::BailOutOnNotNativeArray:
 
-                // REVIEW: We have an issue with array profile info.  The info on the type of array we have won't 
+                // REVIEW: We have an issue with array profile info.  The info on the type of array we have won't
                 //         get fixed by rejitting.  For now, just give up after 50 rejits.
                 if (profileInfo->GetRejitCount() >= 50)
                 {
@@ -2339,9 +2332,9 @@ void BailOutRecord::ScheduleLoopBodyCodeGen(Js::ScriptFunction * function, Js::S
     totalJittedLoopIterations = totalJittedLoopIterations <= Js::LoopEntryPointInfo::GetDecrLoopCountPerBailout() ? 0 : totalJittedLoopIterations - Js::LoopEntryPointInfo::GetDecrLoopCountPerBailout();
 
     CheckPreemptiveRejit(executeFunction, bailOutKind, bailOutRecordNotConst, totalJittedLoopIterations, interpreterFrame->GetCurrentLoopNum());
-    
+
     entryPointInfo->totalJittedLoopIterations = totalJittedLoopIterations;
-    
+
     if ((executeFunction->HasDynamicProfileInfo() && totalJittedLoopIterations == 0) ||
         PHASE_FORCE(Js::ReJITPhase, executeFunction))
     {
@@ -2403,7 +2396,7 @@ void BailOutRecord::ScheduleLoopBodyCodeGen(Js::ScriptFunction * function, Js::S
                 executeFunction->SetDontRethunkAfterBailout();
                 rejitReason = RejitReason::DisableSwitchOptExpectingString;
                 break;
-            
+
             case IR::BailOnStackArgsOutOfActualsRange:
                 AssertMsg(false, "How did we reach here ? Stack args opt is currently disabled in loop body gen.");
                 break;
@@ -2849,8 +2842,8 @@ void GlobalBailOutRecordDataTable::Finalize(NativeCodeData::Allocator *allocator
 #endif
 }
 
-void  GlobalBailOutRecordDataTable::AddOrUpdateRow(JitArenaAllocator *allocator, uint32 bailOutRecordId, uint32 regSlot, bool isFloat, bool isInt, 
-                                                   bool isSimd128F4, bool isSimd128I4, bool isSimd128I8, bool isSimd128I16, bool isSimd128U4, bool isSimd128U8, bool isSimd128U16, 
+void  GlobalBailOutRecordDataTable::AddOrUpdateRow(JitArenaAllocator *allocator, uint32 bailOutRecordId, uint32 regSlot, bool isFloat, bool isInt,
+                                                   bool isSimd128F4, bool isSimd128I4, bool isSimd128I8, bool isSimd128I16, bool isSimd128U4, bool isSimd128U8, bool isSimd128U16,
                                                    bool isSimd128B4, bool isSimd128B8, bool isSimd128B16, int32 offset, uint *lastUpdatedRowIndex)
 {
     Assert(offset != 0);

+ 0 - 2
lib/Common/Core/ConfigParser.cpp

@@ -61,7 +61,6 @@ void ConfigParser::ParseOnModuleLoad(CmdLineArgsParser& parser, HANDLE hmod)
 
 void ConfigParser::ParseRegistry(CmdLineArgsParser &parser)
 {
-    // xplat-todo: registry?
 #ifdef _WIN32
     HKEY hk;
     bool includeUserHive = true;
@@ -92,7 +91,6 @@ void ConfigParser::ParseRegistry(CmdLineArgsParser &parser)
 
 void ConfigParser::ParseRegistryKey(HKEY hk, CmdLineArgsParser &parser)
 {
-    // xplat-todo: registry?
 #ifdef _WIN32
     DWORD dwSize;
     DWORD dwValue;

+ 0 - 91
pal/inc/pal.h

@@ -744,91 +744,6 @@ wsprintfW(
 #define wsprintf wsprintfA
 #endif
 
-#define MB_OK                   0x00000000L
-#define MB_OKCANCEL             0x00000001L
-#define MB_ABORTRETRYIGNORE     0x00000002L
-#define MB_YESNO                0x00000004L
-#define MB_RETRYCANCEL          0x00000005L
-
-#define MB_ICONHAND             0x00000010L
-#define MB_ICONQUESTION         0x00000020L
-#define MB_ICONEXCLAMATION      0x00000030L
-#define MB_ICONASTERISK         0x00000040L
-
-#define MB_ICONINFORMATION      MB_ICONASTERISK
-#define MB_ICONSTOP             MB_ICONHAND
-#define MB_ICONERROR            MB_ICONHAND
-
-#define MB_DEFBUTTON1           0x00000000L
-#define MB_DEFBUTTON2           0x00000100L
-#define MB_DEFBUTTON3           0x00000200L
-
-#define MB_SYSTEMMODAL          0x00001000L
-#define MB_TASKMODAL            0x00002000L
-#define MB_SETFOREGROUND        0x00010000L
-#define MB_TOPMOST              0x00040000L
-
-#define MB_NOFOCUS                  0x00008000L
-#define MB_SETFOREGROUND            0x00010000L
-#define MB_DEFAULT_DESKTOP_ONLY     0x00020000L
-
-// Note: this is the NT 4.0 and greater value.
-#define MB_SERVICE_NOTIFICATION 0x00200000L
-
-#define MB_TYPEMASK             0x0000000FL
-#define MB_ICONMASK             0x000000F0L
-#define MB_DEFMASK              0x00000F00L
-
-#define IDOK                    1
-#define IDCANCEL                2
-#define IDABORT                 3
-#define IDRETRY                 4
-#define IDIGNORE                5
-#define IDYES                   6
-#define IDNO                    7
-
-PALIMPORT
-int
-PALAPI
-MessageBoxW(
-        IN LPVOID hWnd,  // NOTE: diff from winuser.h
-        IN LPCWSTR lpText,
-        IN LPCWSTR lpCaption,
-        IN UINT uType);
-
-PALIMPORT
-int
-PALAPI
-MessageBoxA(
-        IN LPVOID hWnd,  // NOTE: diff from winuser.h
-        IN LPCSTR lpText,
-        IN LPCSTR lpCaption,
-        IN UINT uType);
-
-#ifdef UNICODE
-#define MessageBox MessageBoxW
-#else
-#define MessageBox MessageBoxA
-#endif
-
-/***************** wincon.h Entrypoints **********************************/
-
-#define CTRL_C_EVENT        0
-#define CTRL_BREAK_EVENT    1
-#define CTRL_CLOSE_EVENT    2
-// 3 is reserved!
-// 4 is reserved!
-#define CTRL_LOGOFF_EVENT   5
-#define CTRL_SHUTDOWN_EVENT 6
-
-typedef
-BOOL
-(PALAPI *PHANDLER_ROUTINE)(
-    DWORD CtrlType
-    );
-
-//end wincon.h Entrypoints
-
 // From win32.h
 #ifndef _CRTIMP
 #ifdef __llvm__
@@ -1559,12 +1474,6 @@ SetCurrentDirectoryW(
 #define SetCurrentDirectory SetCurrentDirectoryA
 #endif
 
-// maximum length of the NETBIOS name (not including NULL)
-#define MAX_COMPUTERNAME_LENGTH 15
-
-// maximum length of the username (not including NULL)
-#define UNLEN   256
-
 PALIMPORT
 BOOL
 PALAPI

+ 3 - 48
pal/inc/pal_error.h

@@ -1,6 +1,6 @@
 //
 // Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 //
 
 /*++
@@ -18,109 +18,64 @@
 /* STARTERRORCODES - do not remove this marker, it is consumed by the palsatellite tool */
 
 #define ERROR_SUCCESS 0L
-#define ERROR_INVALID_FUNCTION 1L
 #define ERROR_FILE_NOT_FOUND 2L
 #define ERROR_PATH_NOT_FOUND 3L
-#define ERROR_TOO_MANY_OPEN_FILES 4L
 #define ERROR_ACCESS_DENIED 5L
 #define ERROR_INVALID_HANDLE 6L
 #define ERROR_NOT_ENOUGH_MEMORY 8L
-#define ERROR_BAD_ENVIRONMENT 10L
-#define ERROR_BAD_FORMAT 11L
+#define ERROR_BUFFER_OVERFLOW 111L
 #define ERROR_INVALID_ACCESS 12L
 #define ERROR_INVALID_DATA 13L
 #define ERROR_OUTOFMEMORY 14L
-#define ERROR_INVALID_DRIVE 15L
-#define ERROR_NO_MORE_FILES 18L
-#define ERROR_WRITE_PROTECT 19L
-#define ERROR_NOT_READY 21L
 #define ERROR_BAD_COMMAND 22L
 
 #define ERROR_BAD_LENGTH 24L
 #define ERROR_WRITE_FAULT 29L
-#define ERROR_READ_FAULT 30L
 #define ERROR_GEN_FAILURE 31L
 #define ERROR_SHARING_VIOLATION 32L
 #define ERROR_LOCK_VIOLATION 33L
-#define ERROR_SHARING_BUFFER_EXCEEDED 36L
 #define ERROR_HANDLE_EOF 38L
-#define ERROR_HANDLE_DISK_FULL 39L
 #define ERROR_NOT_SUPPORTED 50L
-#define ERROR_DUP_NAME 52L
-#define ERROR_BAD_NETPATH 53L
 #define ERROR_DEV_NOT_EXIST 55L
 #define ERROR_BAD_NET_NAME 67L
 #define ERROR_FILE_EXISTS 80L
-#define ERROR_CANNOT_MAKE 82L
 #define ERROR_INVALID_PARAMETER 87L
-#define ERROR_NET_WRITE_FAULT 88L
-#define ERROR_DRIVE_LOCKED 108L
-#define ERROR_BROKEN_PIPE 109L
 #define ERROR_OPEN_FAILED 110L
-#define ERROR_BUFFER_OVERFLOW 111L
 #define ERROR_DISK_FULL 112L
 #define ERROR_CALL_NOT_IMPLEMENTED 120L
-#define ERROR_SEM_TIMEOUT 121L
 #define ERROR_INSUFFICIENT_BUFFER 122L
 #define ERROR_INVALID_NAME 123L
 #define ERROR_MOD_NOT_FOUND 126L
 #define ERROR_PROC_NOT_FOUND 127L
-#define ERROR_WAIT_NO_CHILDREN 128L
 #define ERROR_NEGATIVE_SEEK 131L
-#define ERROR_SEEK_ON_DEVICE 132L
 #define ERROR_DIR_NOT_EMPTY 145L
-#define ERROR_SIGNAL_REFUSED 156L
 #define ERROR_NOT_LOCKED 158L
 #define ERROR_BAD_PATHNAME 161L
 #define ERROR_BUSY 170L
 
-#define ERROR_INVALID_ORDINAL 182L
 #define ERROR_ALREADY_EXISTS 183L
-#define ERROR_INVALID_EXE_SIGNATURE 191L
 #define ERROR_EXE_MARKED_INVALID 192L
-#define ERROR_BAD_EXE_FORMAT 193L
 #define ERROR_ENVVAR_NOT_FOUND 203L
 #define ERROR_FILENAME_EXCED_RANGE 206L
-#define ERROR_PIPE_BUSY 231L
-#define ERROR_NO_DATA 232L
-#define ERROR_MORE_DATA 234L
-#define ERROR_NO_MORE_ITEMS 259L
 #define ERROR_DIRECTORY 267L
 #define ERROR_NOT_OWNER 288L
 #define ERROR_PARTIAL_COPY 299L
 #define ERROR_INVALID_ADDRESS 487L
 #define ERROR_ARITHMETIC_OVERFLOW 534L
-#define ERROR_OPERATION_ABORTED 995L
-#define ERROR_IO_INCOMPLETE 996L
-#define ERROR_IO_PENDING 997L
 #define ERROR_NOACCESS 998L
 #define ERROR_STACK_OVERFLOW 1001L
-#define ERROR_INVALID_FLAGS 1004L
-#define ERROR_UNRECOGNIZED_VOLUME 1005L
 #define ERROR_FILE_INVALID 1006L
 #define ERROR_PROCESS_ABORTED 1067L
+#define ERROR_INVALID_FLAGS 1004L
 #define ERROR_NO_UNICODE_TRANSLATION 1113L
 #define ERROR_DLL_INIT_FAILED 1114L
-#define ERROR_IO_DEVICE 1117L
-#define ERROR_DISK_OPERATION_FAILED 1127L
-#define ERROR_POSSIBLE_DEADLOCK 1131L
 #define ERROR_TOO_MANY_LINKS 1142L
 
-#define ERROR_INVALID_DLL 1154L
-#define ERROR_DLL_NOT_FOUND 1157L
 #define ERROR_NOT_FOUND 1168L
-#define ERROR_CANCELLED 1223L
-#define ERROR_NOT_AUTHENTICATED 1244L
 
 #define ERROR_INTERNAL_ERROR 1359L
-#define ERROR_FILE_CORRUPT 1392L
-#define ERROR_DISK_CORRUPT 1393L
-#define ERROR_WRONG_TARGET_NAME 1396L
 #define ERROR_NO_SYSTEM_RESOURCES 1450L
 #define ERROR_COMMITMENT_LIMIT 1455L
-#define ERROR_TIMEOUT 1460L
-#define ERROR_EVENTLOG_FILE_CORRUPT 1500L
-#define ERROR_LOG_FILE_FULL 1502L
 #define ERROR_UNSUPPORTED_TYPE 1630L
 
 #define RPC_S_INVALID_VERS_OPTION 1756L

+ 17 - 30
pal/inc/rt/ntimage.h

@@ -6,8 +6,8 @@
 
 //
 // ===========================================================================
-// File: ntimage.h 
-// 
+// File: ntimage.h
+//
 // ===========================================================================
 
 //
@@ -17,7 +17,7 @@
 //
 //Author:
 //
-//     
+//
 //
 //Revision History:
 //
@@ -31,7 +31,7 @@
 #endif
 
 //
-// Define the linker version number.  
+// Define the linker version number.
 
 #define IMAGE_MAJOR_LINKER_VERSION 2
 
@@ -1007,7 +1007,7 @@ typedef IMAGE_RELOCATION UNALIGNED *PIMAGE_RELOCATION;
 #define IMAGE_REL_IA64_SECREL22         0x000C
 #define IMAGE_REL_IA64_SECREL64I        0x000D
 #define IMAGE_REL_IA64_SECREL32         0x000E
-// 
+//
 #define IMAGE_REL_IA64_DIR32NB          0x0010
 #define IMAGE_REL_IA64_SREL14           0x0011
 #define IMAGE_REL_IA64_SREL22           0x0012
@@ -1570,22 +1570,9 @@ typedef struct _IMAGE_DEBUG_DIRECTORY {
     ULONG   PointerToRawData;
 } IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
 
-#define IMAGE_DEBUG_TYPE_UNKNOWN          0
-#define IMAGE_DEBUG_TYPE_COFF             1
-#define IMAGE_DEBUG_TYPE_CODEVIEW         2
-#define IMAGE_DEBUG_TYPE_FPO              3
-#define IMAGE_DEBUG_TYPE_MISC             4
-#define IMAGE_DEBUG_TYPE_EXCEPTION        5
-#define IMAGE_DEBUG_TYPE_FIXUP            6
-#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC      7
-#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC    8
-#define IMAGE_DEBUG_TYPE_BORLAND          9
-#define IMAGE_DEBUG_TYPE_RESERVED10       10
-#define IMAGE_DEBUG_TYPE_CLSID            11
-
 // end_winnt
 
-// 
+//
 
 // begin_winnt
 
@@ -1808,24 +1795,24 @@ typedef enum ReplacesCorHdrNumericDefines
     COR_VTABLEGAP_NAME_LENGTH           =8,
 
 // Maximum size of a NativeType descriptor.
-    NATIVE_TYPE_MAX_CB                  =1,   
+    NATIVE_TYPE_MAX_CB                  =1,
     COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE=0xFF,
 
 // #defines for the MIH FLAGS
     IMAGE_COR_MIH_METHODRVA             =0x01,
-    IMAGE_COR_MIH_EHRVA                 =0x02,    
+    IMAGE_COR_MIH_EHRVA                 =0x02,
     IMAGE_COR_MIH_BASICBLOCK            =0x08,
 
 // V-table constants
-    COR_VTABLE_32BIT                    =0x01,          // V-table slots are 32-bits in size.   
-    COR_VTABLE_64BIT                    =0x02,          // V-table slots are 64-bits in size.   
+    COR_VTABLE_32BIT                    =0x01,          // V-table slots are 32-bits in size.
+    COR_VTABLE_64BIT                    =0x02,          // V-table slots are 64-bits in size.
     COR_VTABLE_FROM_UNMANAGED           =0x04,          // If set, transition from unmanaged.
     COR_VTABLE_CALL_MOST_DERIVED        =0x10,          // Call most derived method described by
 
 // EATJ constants
     IMAGE_COR_EATJ_THUNK_SIZE           =32,            // Size of a jump thunk reserved range.
 
-// Max name lengths    
+// Max name lengths
     //<TODO> Change to unlimited name lengths. </TODO>
     MAX_CLASS_NAME                      =1024,
     MAX_PACKAGE_NAME                    =1024,
@@ -1835,13 +1822,13 @@ typedef enum ReplacesCorHdrNumericDefines
 typedef struct IMAGE_COR20_HEADER
 {
     // Header versioning
-    ULONG                   cb;              
+    ULONG                   cb;
     USHORT                  MajorRuntimeVersion;
     USHORT                  MinorRuntimeVersion;
-    
+
     // Symbol table and startup information
-    IMAGE_DATA_DIRECTORY    MetaData;        
-    ULONG                   Flags;           
+    IMAGE_DATA_DIRECTORY    MetaData;
+    ULONG                   Flags;
 
     // If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is not set, EntryPointToken represents a managed entrypoint.
     // If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is set, EntryPointRVA represents an RVA to a native entrypoint.
@@ -1849,7 +1836,7 @@ typedef struct IMAGE_COR20_HEADER
         ULONG               EntryPointToken;
         ULONG               EntryPointRVA;
     };
-    
+
     // Binding information
     IMAGE_DATA_DIRECTORY    Resources;
     IMAGE_DATA_DIRECTORY    StrongNameSignature;
@@ -1861,7 +1848,7 @@ typedef struct IMAGE_COR20_HEADER
 
     // Precompiled image info (internal use only - set to zero)
     IMAGE_DATA_DIRECTORY    ManagedNativeHeader;
-    
+
 } IMAGE_COR20_HEADER, *PIMAGE_COR20_HEADER;
 
 #endif // __IMAGE_COR20_HEADER_DEFINED__

+ 0 - 109
pal/inc/rt/palrt.h

@@ -59,64 +59,20 @@ Revision History:
 #define DISP_E_OVERFLOW                  _HRESULT_TYPEDEF_(0x8002000AL)
 #define DISP_E_DIVBYZERO                 _HRESULT_TYPEDEF_(0x80020012L)
 
-#define CLASS_E_CLASSNOTAVAILABLE        _HRESULT_TYPEDEF_(0x80040111L)
-#define CLASS_E_NOAGGREGATION            _HRESULT_TYPEDEF_(0x80040110L)
-
 #define CO_E_CLASSSTRING                 _HRESULT_TYPEDEF_(0x800401F3L)
 
 #define URL_E_INVALID_SYNTAX             _HRESULT_TYPEDEF_(0x80041001L)
 #define MK_E_SYNTAX                      _HRESULT_TYPEDEF_(0x800401E4L)
 
-#define STG_E_INVALIDFUNCTION            _HRESULT_TYPEDEF_(0x80030001L)
 #define STG_E_FILENOTFOUND               _HRESULT_TYPEDEF_(0x80030002L)
 #define STG_E_PATHNOTFOUND               _HRESULT_TYPEDEF_(0x80030003L)
 #define STG_E_WRITEFAULT                 _HRESULT_TYPEDEF_(0x8003001DL)
 #define STG_E_FILEALREADYEXISTS          _HRESULT_TYPEDEF_(0x80030050L)
-#define STG_E_ABNORMALAPIEXIT            _HRESULT_TYPEDEF_(0x800300FAL)
 
-#define NTE_BAD_UID                      _HRESULT_TYPEDEF_(0x80090001L)
 #define NTE_BAD_HASH                     _HRESULT_TYPEDEF_(0x80090002L)
 #define NTE_BAD_KEY                      _HRESULT_TYPEDEF_(0x80090003L)
-#define NTE_BAD_LEN                      _HRESULT_TYPEDEF_(0x80090004L)
-#define NTE_BAD_DATA                     _HRESULT_TYPEDEF_(0x80090005L)
-#define NTE_BAD_SIGNATURE                _HRESULT_TYPEDEF_(0x80090006L)
-#define NTE_BAD_VER                      _HRESULT_TYPEDEF_(0x80090007L)
-#define NTE_BAD_ALGID                    _HRESULT_TYPEDEF_(0x80090008L)
-#define NTE_BAD_FLAGS                    _HRESULT_TYPEDEF_(0x80090009L)
-#define NTE_BAD_TYPE                     _HRESULT_TYPEDEF_(0x8009000AL)
-#define NTE_BAD_KEY_STATE                _HRESULT_TYPEDEF_(0x8009000BL)
-#define NTE_BAD_HASH_STATE               _HRESULT_TYPEDEF_(0x8009000CL)
-#define NTE_NO_KEY                       _HRESULT_TYPEDEF_(0x8009000DL)
-#define NTE_NO_MEMORY                    _HRESULT_TYPEDEF_(0x8009000EL)
-#define NTE_SIGNATURE_FILE_BAD           _HRESULT_TYPEDEF_(0x8009001CL)
-#define NTE_FAIL                         _HRESULT_TYPEDEF_(0x80090020L)
-
-#define CRYPT_E_HASH_VALUE               _HRESULT_TYPEDEF_(0x80091007L)
-
-#define TYPE_E_SIZETOOBIG                _HRESULT_TYPEDEF_(0x800288C5L)
-#define TYPE_E_DUPLICATEID               _HRESULT_TYPEDEF_(0x800288C6L)
 
 #define STD_CTL_SCODE(n) MAKE_SCODE(SEVERITY_ERROR, FACILITY_CONTROL, n)
-#define CTL_E_OVERFLOW                  STD_CTL_SCODE(6)
-#define CTL_E_OUTOFMEMORY               STD_CTL_SCODE(7)
-#define CTL_E_DIVISIONBYZERO            STD_CTL_SCODE(11)
-#define CTL_E_OUTOFSTACKSPACE           STD_CTL_SCODE(28)
-#define CTL_E_FILENOTFOUND              STD_CTL_SCODE(53)
-#define CTL_E_DEVICEIOERROR             STD_CTL_SCODE(57)
-#define CTL_E_PERMISSIONDENIED          STD_CTL_SCODE(70)
-#define CTL_E_PATHFILEACCESSERROR       STD_CTL_SCODE(75)
-#define CTL_E_PATHNOTFOUND              STD_CTL_SCODE(76)
-
-#define INET_E_CANNOT_CONNECT            _HRESULT_TYPEDEF_(0x800C0004L)
-#define INET_E_RESOURCE_NOT_FOUND        _HRESULT_TYPEDEF_(0x800C0005L)
-#define INET_E_OBJECT_NOT_FOUND          _HRESULT_TYPEDEF_(0x800C0006L)
-#define INET_E_DATA_NOT_AVAILABLE        _HRESULT_TYPEDEF_(0x800C0007L)
-#define INET_E_DOWNLOAD_FAILURE          _HRESULT_TYPEDEF_(0x800C0008L)
-#define INET_E_CONNECTION_TIMEOUT        _HRESULT_TYPEDEF_(0x800C000BL)
-#define INET_E_UNKNOWN_PROTOCOL          _HRESULT_TYPEDEF_(0x800C000DL)
-
-#define DBG_PRINTEXCEPTION_C             _HRESULT_TYPEDEF_(0x40010006L)
-
 /********************** errorrep.h ****************************************/
 
 typedef enum tagEFaultRepRetVal
@@ -372,28 +328,12 @@ typedef union _ULARGE_INTEGER {
 /******************* HRESULT types ****************************************/
 
 #define FACILITY_WINDOWS                 8
-#define FACILITY_URT                     19
-#define FACILITY_UMI                     22
-#define FACILITY_SXS                     23
 #define FACILITY_STORAGE                 3
-#define FACILITY_SSPI                    9
-#define FACILITY_SCARD                   16
-#define FACILITY_SETUPAPI                15
-#define FACILITY_SECURITY                9
-#define FACILITY_RPC                     1
 #define FACILITY_WIN32                   7
 #define FACILITY_CONTROL                 10
 #define FACILITY_NULL                    0
-#define FACILITY_MSMQ                    14
-#define FACILITY_MEDIASERVER             13
-#define FACILITY_INTERNET                12
 #define FACILITY_ITF                     4
-#define FACILITY_DPLAY                   21
 #define FACILITY_DISPATCH                2
-#define FACILITY_COMPLUS                 17
-#define FACILITY_CERT                    11
-#define FACILITY_ACS                     20
-#define FACILITY_AAF                     18
 
 #define NO_ERROR 0L
 
@@ -703,25 +643,6 @@ STDAPI_(HRESULT) VariantClear(VARIANT * pvarg);
 
 STDAPI CreateStreamOnHGlobal(PVOID hGlobal, BOOL fDeleteOnRelease, interface IStream** ppstm);
 
-#define STGM_DIRECT             0x00000000L
-
-#define STGM_READ               0x00000000L
-#define STGM_WRITE              0x00000001L
-#define STGM_READWRITE          0x00000002L
-
-#define STGM_SHARE_DENY_NONE    0x00000040L
-#define STGM_SHARE_DENY_READ    0x00000030L
-#define STGM_SHARE_DENY_WRITE   0x00000020L
-#define STGM_SHARE_EXCLUSIVE    0x00000010L
-
-#define STGM_DELETEONRELEASE    0x04000000L
-
-#define STGM_CREATE             0x00001000L
-#define STGM_CONVERT            0x00020000L
-#define STGM_FAILIFTHERE        0x00000000L
-
-#define STGM_NOSNAPSHOT         0x00200000L
-
 STDAPI IIDFromString(LPOLESTR lpsz, IID* lpiid);
 STDAPI_(int) StringFromGUID2(REFGUID rguid, LPOLESTR lpsz, int cchMax);
 
@@ -1362,23 +1283,6 @@ typedef VOID (__stdcall *WAITORTIMERCALLBACK)(PVOID, BOOLEAN);
 #define IMAGE_COR20_HEADER_FIELD(obj, f)    ((obj).f)
 #endif
 
-// copied from winnt.h
-#define PROCESSOR_ARCHITECTURE_INTEL            0
-#define PROCESSOR_ARCHITECTURE_MIPS             1
-#define PROCESSOR_ARCHITECTURE_ALPHA            2
-#define PROCESSOR_ARCHITECTURE_PPC              3
-#define PROCESSOR_ARCHITECTURE_SHX              4
-#define PROCESSOR_ARCHITECTURE_ARM              5
-#define PROCESSOR_ARCHITECTURE_IA64             6
-#define PROCESSOR_ARCHITECTURE_ALPHA64          7
-#define PROCESSOR_ARCHITECTURE_MSIL             8
-#define PROCESSOR_ARCHITECTURE_AMD64            9
-#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64    10
-#define PROCESSOR_ARCHITECTURE_NEUTRAL          11
-#define PROCESSOR_ARCHITECTURE_ARM64            12
-
-#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
-
 //
 // JIT Debugging Info. This structure is defined to have constant size in
 // both the emulated and native environment.
@@ -1440,10 +1344,6 @@ STDAPI SafeArrayDestroy(SAFEARRAY * psa);
 EXTERN_C void * _stdcall _lfind(const void *, const void *, unsigned int *, unsigned int,
         int (__cdecl *)(const void *, const void *));
 
-
-/*<TODO>****************** clean this up ***********************</TODO>*/
-
-
 interface IDispatch;
 interface ITypeInfo;
 interface ITypeLib;
@@ -1457,15 +1357,6 @@ typedef VOID (WINAPI *LPOVERLAPPED_COMPLETION_ROUTINE)(
 //
 // Debug APIs
 //
-#define EXCEPTION_DEBUG_EVENT       1
-#define CREATE_THREAD_DEBUG_EVENT   2
-#define CREATE_PROCESS_DEBUG_EVENT  3
-#define EXIT_THREAD_DEBUG_EVENT     4
-#define EXIT_PROCESS_DEBUG_EVENT    5
-#define LOAD_DLL_DEBUG_EVENT        6
-#define UNLOAD_DLL_DEBUG_EVENT      7
-#define OUTPUT_DEBUG_STRING_EVENT   8
-#define RIP_EVENT                   9
 
 typedef struct _EXCEPTION_DEBUG_INFO {
     EXCEPTION_RECORD ExceptionRecord;

+ 31 - 36
pal/src/include/pal/threadsusp.hpp

@@ -1,6 +1,6 @@
 //
 // Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
 //
 
 /*++
@@ -22,15 +22,15 @@ Abstract:
 #define _PAL_THREADSUSP_HPP
 
 // Need this ifdef since this header is included by .c files so they can use the diagnostic function.
-#ifdef __cplusplus 
+#ifdef __cplusplus
 
 // Note: do not include malloc.hpp from this header. The template InternalDelete
-// needs to know the layout of class CPalThread, which includes a member of type 
-// CThreadSuspensionInfo, which is defined later in this header, and it is not  
+// needs to know the layout of class CPalThread, which includes a member of type
+// CThreadSuspensionInfo, which is defined later in this header, and it is not
 // yet known at this point.
-// If any future change should bring this issue back, the circular dependency can 
-// be further broken by making the InternalDelete's CPalThread argument a 
-// templatized argument, so that type checking on it takes place only at 
+// If any future change should bring this issue back, the circular dependency can
+// be further broken by making the InternalDelete's CPalThread argument a
+// templatized argument, so that type checking on it takes place only at
 // instantiation time.
 #include "pal/threadinfo.hpp"
 #include "pal/thread.hpp"
@@ -82,10 +82,6 @@ Abstract:
 
 namespace CorUnix
 {
-#ifdef _DEBUG
-#define MAX_TRACKED_CRITSECS 8
-#endif
-
     PAL_ERROR
     InternalResumeThread(
         CPalThread *pthrResumer,
@@ -131,22 +127,22 @@ namespace CorUnix
             BOOL m_fSemaphoresInitialized;
 #endif // USE_POSIX_SEMAPHORES
 
-            /* Most of the variables above are either accessed by a thread 
+            /* Most of the variables above are either accessed by a thread
             holding the appropriate suspension mutex(es) or are only
             accessed by their own threads (and thus don't require
-            synchronization). 
-            
+            synchronization).
+
             m_fPending, m_fSuspendedForShutdown,
-            m_fSuspendSignalSent, and m_fResumeSignalSent 
+            m_fSuspendSignalSent, and m_fResumeSignalSent
             may be set by a different thread than the owner and thus
             require synchronization.
 
-            m_fSelfsusp is set to TRUE only by its own thread but may be later 
-            accessed by other threads. 
+            m_fSelfsusp is set to TRUE only by its own thread but may be later
+            accessed by other threads.
 
-            m_lNumThreadsSuspendedByThisThread is accessed by its owning 
+            m_lNumThreadsSuspendedByThisThread is accessed by its owning
             thread and therefore does not require synchronization. */
-            
+
 #ifdef _DEBUG
             VOID
             IncrNumThreadsSuspendedByThisThread(
@@ -173,10 +169,10 @@ namespace CorUnix
             ReleaseSuspensionLocks(
                 CPalThread *pthrSuspender,
                 CPalThread *pthrTarget
-            );  
+            );
 
 #if USE_POSIX_SEMAPHORES
-            sem_t* 
+            sem_t*
             GetSuspendSemaphore(
                 void
                 )
@@ -184,7 +180,7 @@ namespace CorUnix
                 return &m_semSusp;
             };
 
-            sem_t* 
+            sem_t*
             GetResumeSemaphore(
                 void
                 )
@@ -210,7 +206,7 @@ namespace CorUnix
 #endif // USE_POSIX_SEMAPHORES
 
 #if DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX
-            LONG* 
+            LONG*
             GetSuspensionSpinlock(
                 void
                 )
@@ -233,7 +229,7 @@ namespace CorUnix
                 )
             {
                 m_fPending = fPending;
-            };	
+            };
 
             BOOL
             GetSuspPending(
@@ -241,7 +237,7 @@ namespace CorUnix
                 )
             {
                 return m_fPending;
-            };     
+            };
 
             void
             SetSelfSusp(
@@ -249,33 +245,33 @@ namespace CorUnix
                 )
             {
                 m_fSelfsusp = fSelfsusp;
-            }; 
-            
+            };
+
             BOOL
             GetSelfSusp(
                 void
                 )
             {
                 return m_fSelfsusp;
-            }; 
+            };
 
             void
             PostOnSuspendSemaphore();
 
             void
-            WaitOnSuspendSemaphore();     
+            WaitOnSuspendSemaphore();
 
             void
             PostOnResumeSemaphore();
 
             void
-            WaitOnResumeSemaphore();             
+            WaitOnResumeSemaphore();
 
-            static 
-            BOOL 
+            static
+            BOOL
             TryAcquireSuspensionLock(
                 CPalThread* pthrTarget
-            );    
+            );
 
             int GetBlockingPipe(
                 void
@@ -303,7 +299,7 @@ namespace CorUnix
 #endif
             {
                 InitializeSuspensionLock();
-            }; 
+            };
 
             virtual ~CThreadSuspensionInfo();
 
@@ -330,7 +326,7 @@ namespace CorUnix
             {
                 m_fSuspendedForShutdown = fSuspendedForShutdown;
             };
-            
+
             BOOL
             GetSuspendedForShutdown(
                 void
@@ -380,4 +376,3 @@ extern LONG g_ssSuspensionLock;
 #endif
 
 #endif // _PAL_THREADSUSP_HPP
-