From c2249c8f4eb4d9abf7226f64fc29b016af8e60f7 Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Mon, 19 Sep 2022 16:47:48 +0300 Subject: [PATCH] Delete unused code (#75814) * Delete unused code * Fix casing of mscoree.idl * Delete START/STOP_MD_PERF macros --- .../Runtime/InteropServices/IException.cs | 35 -- .../debug/debug-pal/unix/diagnosticsipc.cpp | 423 -------------- .../debug/debug-pal/win/diagnosticsipc.cpp | 548 ------------------ src/coreclr/debug/inc/diagnosticsipc.h | 149 ----- src/coreclr/inc/getproductversionnumber.h | 76 --- src/coreclr/inc/{MSCOREE.IDL => mscoree.idl} | 0 src/coreclr/md/compiler/CMakeLists.txt | 1 - src/coreclr/md/compiler/assemblymd.cpp | 26 - src/coreclr/md/compiler/assemblymd_emit.cpp | 20 - src/coreclr/md/compiler/custattr_emit.cpp | 5 - src/coreclr/md/compiler/custattr_import.cpp | 7 - src/coreclr/md/compiler/emit.cpp | 89 --- src/coreclr/md/compiler/import.cpp | 95 --- src/coreclr/md/compiler/mdperf.cpp | 95 --- src/coreclr/md/compiler/mdperf.h | 241 -------- src/coreclr/md/compiler/regmeta.cpp | 1 - src/coreclr/md/compiler/regmeta.h | 7 - .../md/compiler/regmeta_compilersupport.cpp | 1 - src/coreclr/md/compiler/regmeta_emit.cpp | 23 - src/coreclr/md/compiler/regmeta_import.cpp | 33 -- src/coreclr/md/compiler/regmeta_vm.cpp | 5 - src/coreclr/nativeaot/Runtime/rhcommon.h | 16 - .../nativecs_interlocked/hpitinterlock.s | 167 ------ .../nativecs_interlocked/notes.txt | 15 - .../nativecs_interlocked/readme.txt | 39 -- .../nativecs_interlocked/sparcinterloc.s | 72 --- src/mono/dlls/mscordbi/cordb-assembly.cpp | 1 - 27 files changed, 2190 deletions(-) delete mode 100644 src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IException.cs delete mode 100644 src/coreclr/debug/debug-pal/unix/diagnosticsipc.cpp delete mode 100644 src/coreclr/debug/debug-pal/win/diagnosticsipc.cpp delete mode 100644 src/coreclr/debug/inc/diagnosticsipc.h delete mode 100644 src/coreclr/inc/getproductversionnumber.h rename src/coreclr/inc/{MSCOREE.IDL => mscoree.idl} (100%) delete mode 100644 src/coreclr/md/compiler/mdperf.cpp delete mode 100644 src/coreclr/md/compiler/mdperf.h delete mode 100644 src/coreclr/nativeaot/Runtime/rhcommon.h delete mode 100644 src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/hpitinterlock.s delete mode 100644 src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/notes.txt delete mode 100644 src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/readme.txt delete mode 100644 src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/sparcinterloc.s diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IException.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IException.cs deleted file mode 100644 index 3f2d78d1f58..00000000000 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/IException.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/*============================================================================= -** -** Interface: _Exception -** -** -** Purpose: COM backwards compatibility with v1 Exception -** object layout. -** -** -=============================================================================*/ - -namespace System.Runtime.InteropServices { - using System; - using System.Reflection; - using System.Runtime.Serialization; - - [Guid("b36b5c63-42ef-38bc-a07e-0b34c98f164a")] - [InterfaceType(ComInterfaceType.InterfaceIsDual)] - [CLSCompliant(false)] - internal interface _Exception - { - // - // This method is intentionally included in CoreCLR to make Exception.get_InnerException "newslot virtual final". - // Some phone apps include MEF from desktop Silverlight. MEF's ComposablePartException depends on implicit interface - // implementations of get_InnerException to be provided by the base class. It works only if Exception.get_InnerException - // is virtual. - // - Exception? InnerException { - get; - } - } -} diff --git a/src/coreclr/debug/debug-pal/unix/diagnosticsipc.cpp b/src/coreclr/debug/debug-pal/unix/diagnosticsipc.cpp deleted file mode 100644 index 556f81c2e96..00000000000 --- a/src/coreclr/debug/debug-pal/unix/diagnosticsipc.cpp +++ /dev/null @@ -1,423 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include -#include -#include -#include -#include -#include -#include -#include "diagnosticsipc.h" -#include "processdescriptor.h" - -#if __GNUC__ - #include -#else - #include -#endif // __GNUC__ - -IpcStream::DiagnosticsIpc::DiagnosticsIpc(const int serverSocket, sockaddr_un *const pServerAddress, ConnectionMode mode) : - mode(mode), - _serverSocket(serverSocket), - _pServerAddress(new sockaddr_un), - _isClosed(false), - _isListening(false) -{ - _ASSERTE(_pServerAddress != nullptr); - _ASSERTE(pServerAddress != nullptr); - - if (_pServerAddress == nullptr || pServerAddress == nullptr) - return; - memcpy(_pServerAddress, pServerAddress, sizeof(sockaddr_un)); -} - -IpcStream::DiagnosticsIpc::~DiagnosticsIpc() -{ - Close(); - delete _pServerAddress; -} - -IpcStream::DiagnosticsIpc *IpcStream::DiagnosticsIpc::Create(const char *const pIpcName, ConnectionMode mode, ErrorCallback callback) -{ - sockaddr_un serverAddress{}; - serverAddress.sun_family = AF_UNIX; - - if (pIpcName != nullptr) - { - int chars = snprintf(serverAddress.sun_path, sizeof(serverAddress.sun_path), "%s", pIpcName); - _ASSERTE(chars > 0 && (unsigned int)chars < sizeof(serverAddress.sun_path)); - } - else - { - // generate the default socket name in TMP Path - const ProcessDescriptor pd = ProcessDescriptor::FromCurrentProcess(); - PAL_GetTransportName( - sizeof(serverAddress.sun_path), - serverAddress.sun_path, - "dotnet-diagnostic", - pd.m_Pid, - pd.m_ApplicationGroupId, - "socket"); - } - - if (mode == ConnectionMode::CONNECT) - return new IpcStream::DiagnosticsIpc(-1, &serverAddress, ConnectionMode::CONNECT); - -#if defined(__APPLE__) || defined(__FreeBSD__) - mode_t prev_mask = umask(~(S_IRUSR | S_IWUSR)); // This will set the default permission bit to 600 -#endif // __APPLE__ - - const int serverSocket = ::socket(AF_UNIX, SOCK_STREAM, 0); - if (serverSocket == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); -#if defined(__APPLE__) || defined(__FreeBSD__) - umask(prev_mask); -#endif // __APPLE__ - _ASSERTE(!"Failed to create diagnostics IPC socket."); - return nullptr; - } - -#if !(defined(__APPLE__) || defined(__FreeBSD__)) - if (fchmod(serverSocket, S_IRUSR | S_IWUSR) == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); - _ASSERTE(!"Failed to set permissions on diagnostics IPC socket."); - return nullptr; - } -#endif // __APPLE__ - - const int fSuccessBind = ::bind(serverSocket, (sockaddr *)&serverAddress, sizeof(serverAddress)); - if (fSuccessBind == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); - _ASSERTE(fSuccessBind != -1); - - const int fSuccessClose = ::close(serverSocket); - _ASSERTE(fSuccessClose != -1); - -#if defined(__APPLE__) || defined(__FreeBSD__) - umask(prev_mask); -#endif // __APPLE__ - - return nullptr; - } - -#if defined(__APPLE__) || defined(__FreeBSD__) - umask(prev_mask); -#endif // __APPLE__ - - return new IpcStream::DiagnosticsIpc(serverSocket, &serverAddress, mode); -} - -bool IpcStream::DiagnosticsIpc::Listen(ErrorCallback callback) -{ - _ASSERTE(mode == ConnectionMode::LISTEN); - if (mode != ConnectionMode::LISTEN) - { - if (callback != nullptr) - callback("Cannot call Listen on a client connection", -1); - return false; - } - - if (_isListening) - return true; - - const int fSuccessfulListen = ::listen(_serverSocket, /* backlog */ 255); - if (fSuccessfulListen == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); - _ASSERTE(fSuccessfulListen != -1); - - const int fSuccessUnlink = ::unlink(_pServerAddress->sun_path); - _ASSERTE(fSuccessUnlink != -1); - - const int fSuccessClose = ::close(_serverSocket); - _ASSERTE(fSuccessClose != -1); - return false; - } - else - { - _isListening = true; - return true; - } -} - -IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback) -{ - _ASSERTE(mode == ConnectionMode::LISTEN); - _ASSERTE(_isListening); - - sockaddr_un from; - socklen_t fromlen = sizeof(from); - const int clientSocket = ::accept(_serverSocket, (sockaddr *)&from, &fromlen); - if (clientSocket == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); - return nullptr; - } - - return new IpcStream(clientSocket, mode); -} - -IpcStream *IpcStream::DiagnosticsIpc::Connect(ErrorCallback callback) -{ - _ASSERTE(mode == ConnectionMode::CONNECT); - - sockaddr_un clientAddress{}; - clientAddress.sun_family = AF_UNIX; - const int clientSocket = ::socket(AF_UNIX, SOCK_STREAM, 0); - if (clientSocket == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); - return nullptr; - } - - // We don't expect this to block since this is a Unix Domain Socket. `connect` may block until the - // TCP handshake is complete for TCP/IP sockets, but UDS don't use TCP. `connect` will return even if - // the server hasn't called `accept`. - if (::connect(clientSocket, (struct sockaddr *)_pServerAddress, sizeof(*_pServerAddress)) < 0) - { - if (callback != nullptr) - callback(strerror(errno), errno); - - const bool fCloseSuccess = ::close(clientSocket) == 0; - if (!fCloseSuccess && callback != nullptr) - callback(strerror(errno), errno); - return nullptr; - } - - return new IpcStream(clientSocket, ConnectionMode::CONNECT); -} - -int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_t nHandles, int32_t timeoutMs, ErrorCallback callback) -{ - // prepare the pollfd structs - pollfd *pollfds = new pollfd[nHandles]; - for (uint32_t i = 0; i < nHandles; i++) - { - rgIpcPollHandles[i].revents = 0; // ignore any values in revents - int fd = -1; - if (rgIpcPollHandles[i].pIpc != nullptr) - { - // SERVER - _ASSERTE(rgIpcPollHandles[i].pIpc->mode == ConnectionMode::LISTEN); - fd = rgIpcPollHandles[i].pIpc->_serverSocket; - } - else - { - // CLIENT - _ASSERTE(rgIpcPollHandles[i].pStream != nullptr); - fd = rgIpcPollHandles[i].pStream->_clientSocket; - } - - pollfds[i].fd = fd; - pollfds[i].events = POLLIN; - } - - int retval = poll(pollfds, nHandles, timeoutMs); - - // Check results - if (retval < 0) - { - // If poll() returns with an error, including one due to an interrupted call, the fds - // array will be unmodified and the global variable errno will be set to indicate the error. - // - POLL(2) - if (callback != nullptr) - callback(strerror(errno), errno); - delete[] pollfds; - return -1; - } - else if (retval == 0) - { - // we timed out - delete[] pollfds; - return 0; - } - - for (uint32_t i = 0; i < nHandles; i++) - { - if (pollfds[i].revents != 0) - { - if (callback != nullptr) - callback("IpcStream::DiagnosticsIpc::Poll - poll revents", (uint32_t)pollfds[i].revents); - // error check FIRST - if (pollfds[i].revents & POLLHUP) - { - // check for hangup first because a closed socket - // will technically meet the requirements for POLLIN - // i.e., a call to recv/read won't block - rgIpcPollHandles[i].revents = (uint8_t)PollEvents::HANGUP; - } - else if ((pollfds[i].revents & (POLLERR|POLLNVAL))) - { - if (callback != nullptr) - callback("Poll error", (uint32_t)pollfds[i].revents); - rgIpcPollHandles[i].revents = (uint8_t)PollEvents::ERR; - } - else if (pollfds[i].revents & (POLLIN|POLLPRI)) - { - rgIpcPollHandles[i].revents = (uint8_t)PollEvents::SIGNALED; - } - else - { - rgIpcPollHandles[i].revents = (uint8_t)PollEvents::UNKNOWN; - if (callback != nullptr) - callback("unknown poll response", (uint32_t)pollfds[i].revents); - } - } - } - - delete[] pollfds; - return 1; -} - -void IpcStream::DiagnosticsIpc::Close(bool isShutdown, ErrorCallback callback) -{ - if (_isClosed) - return; - _isClosed = true; - - if (_serverSocket != -1) - { - // only close the socket if not shutting down, let the OS handle it in that case - if (!isShutdown && ::close(_serverSocket) == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); - _ASSERTE(!"Failed to close unix domain socket."); - } - - // N.B. - it is safe to unlink the unix domain socket file while the server - // is still alive: - // "The usual UNIX close-behind semantics apply; the socket can be unlinked - // at any time and will be finally removed from the file system when the last - // reference to it is closed." - unix(7) man page - Unlink(callback); - } -} - -// This helps remove the socket from the filesystem when the runtime exits. -// See: http://man7.org/linux/man-pages/man7/unix.7.html#NOTES -void IpcStream::DiagnosticsIpc::Unlink(ErrorCallback callback) -{ - const int fSuccessUnlink = ::unlink(_pServerAddress->sun_path); - if (fSuccessUnlink == -1) - { - if (callback != nullptr) - callback(strerror(errno), errno); - _ASSERTE(!"Failed to unlink server address."); - } -} - -IpcStream::~IpcStream() -{ - Close(); -} - -void IpcStream::Close(ErrorCallback) -{ - if (_clientSocket != -1) - { - Flush(); - - const int fSuccessClose = ::close(_clientSocket); - _ASSERTE(fSuccessClose != -1); - _clientSocket = -1; - } -} - -bool IpcStream::Read(void *lpBuffer, const uint32_t nBytesToRead, uint32_t &nBytesRead, const int32_t timeoutMs) -{ - _ASSERTE(lpBuffer != nullptr); - - if (timeoutMs != InfiniteTimeout) - { - pollfd pfd; - pfd.fd = _clientSocket; - pfd.events = POLLIN; - int retval = poll(&pfd, 1, timeoutMs); - if (retval <= 0 || !(pfd.revents & POLLIN)) - { - // timeout or error - return false; - } - // else fallthrough - } - - uint8_t *lpBufferCursor = (uint8_t*)lpBuffer; - ssize_t currentBytesRead = 0; - ssize_t totalBytesRead = 0; - bool fSuccess = true; - while (fSuccess && nBytesToRead - totalBytesRead > 0) - { - currentBytesRead = ::recv(_clientSocket, lpBufferCursor, nBytesToRead - totalBytesRead, 0); - fSuccess = currentBytesRead != 0; - if (!fSuccess) - break; - totalBytesRead += currentBytesRead; - lpBufferCursor += currentBytesRead; - } - - if (!fSuccess) - { - // TODO: Add error handling. - } - - nBytesRead = static_cast(totalBytesRead); - return fSuccess; -} - -bool IpcStream::Write(const void *lpBuffer, const uint32_t nBytesToWrite, uint32_t &nBytesWritten, const int32_t timeoutMs) -{ - _ASSERTE(lpBuffer != nullptr); - - if (timeoutMs != InfiniteTimeout) - { - pollfd pfd; - pfd.fd = _clientSocket; - pfd.events = POLLOUT; - int retval = poll(&pfd, 1, timeoutMs); - if (retval <= 0 || !(pfd.revents & POLLOUT)) - { - // timeout or error - return false; - } - // else fallthrough - } - - uint8_t *lpBufferCursor = (uint8_t*)lpBuffer; - ssize_t currentBytesWritten = 0; - ssize_t totalBytesWritten = 0; - bool fSuccess = true; - while (fSuccess && nBytesToWrite - totalBytesWritten > 0) - { - currentBytesWritten = ::send(_clientSocket, lpBufferCursor, nBytesToWrite - totalBytesWritten, 0); - fSuccess = currentBytesWritten != -1; - if (!fSuccess) - break; - lpBufferCursor += currentBytesWritten; - totalBytesWritten += currentBytesWritten; - } - - if (!fSuccess) - { - // TODO: Add error handling. - } - - nBytesWritten = static_cast(totalBytesWritten); - return fSuccess; -} - -bool IpcStream::Flush() const -{ - // fsync - http://man7.org/linux/man-pages/man2/fsync.2.html ??? - return true; -} diff --git a/src/coreclr/debug/debug-pal/win/diagnosticsipc.cpp b/src/coreclr/debug/debug-pal/win/diagnosticsipc.cpp deleted file mode 100644 index fe7828daf78..00000000000 --- a/src/coreclr/debug/debug-pal/win/diagnosticsipc.cpp +++ /dev/null @@ -1,548 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include -#include -#include -#include "diagnosticsipc.h" - -#define _ASSERTE assert - -IpcStream::DiagnosticsIpc::DiagnosticsIpc(const char(&namedPipeName)[MaxNamedPipeNameLength], ConnectionMode mode) : - mode(mode), - _isListening(false) -{ - memcpy(_pNamedPipeName, namedPipeName, sizeof(_pNamedPipeName)); - memset(&_oOverlap, 0, sizeof(OVERLAPPED)); -} - -IpcStream::DiagnosticsIpc::~DiagnosticsIpc() -{ - Close(); -} - -IpcStream::DiagnosticsIpc *IpcStream::DiagnosticsIpc::Create(const char *const pIpcName, ConnectionMode mode, ErrorCallback callback) -{ - char namedPipeName[MaxNamedPipeNameLength]{}; - int nCharactersWritten = -1; - - if (pIpcName != nullptr) - { - nCharactersWritten = sprintf_s( - namedPipeName, - sizeof(namedPipeName), - "\\\\.\\pipe\\%s", - pIpcName); - } - else - { - nCharactersWritten = sprintf_s( - namedPipeName, - sizeof(namedPipeName), - "\\\\.\\pipe\\dotnet-diagnostic-%d", - ::GetCurrentProcessId()); - } - - if (nCharactersWritten == -1) - { - if (callback != nullptr) - callback("Failed to generate the named pipe name", nCharactersWritten); - _ASSERTE(nCharactersWritten != -1); - return nullptr; - } - - return new IpcStream::DiagnosticsIpc(namedPipeName, mode); -} - -bool IpcStream::DiagnosticsIpc::Listen(ErrorCallback callback) -{ - _ASSERTE(mode == ConnectionMode::LISTEN); - if (mode != ConnectionMode::LISTEN) - { - if (callback != nullptr) - callback("Cannot call Listen on a client connection", -1); - return false; - } - - if (_isListening) - return true; - - const uint32_t nInBufferSize = 16 * 1024; - const uint32_t nOutBufferSize = 16 * 1024; - _hPipe = ::CreateNamedPipeA( - _pNamedPipeName, // pipe name - PIPE_ACCESS_DUPLEX | // read/write access - FILE_FLAG_OVERLAPPED, // async listening - PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS, // message type pipe, message-read and blocking mode - PIPE_UNLIMITED_INSTANCES, // max. instances - nOutBufferSize, // output buffer size - nInBufferSize, // input buffer size - 0, // default client time-out - NULL); // default security attribute - - if (_hPipe == INVALID_HANDLE_VALUE) - { - if (callback != nullptr) - callback("Failed to create an instance of a named pipe.", ::GetLastError()); - return false; - } - - HANDLE hOverlapEvent = CreateEvent(NULL, true, false, NULL); - if (hOverlapEvent == NULL) - { - if (callback != nullptr) - callback("Failed to create overlap event", ::GetLastError()); - ::CloseHandle(_hPipe); - _hPipe = INVALID_HANDLE_VALUE; - return false; - } - _oOverlap.hEvent = hOverlapEvent; - - BOOL fSuccess = ::ConnectNamedPipe(_hPipe, &_oOverlap) != 0; - if (!fSuccess) - { - const DWORD errorCode = ::GetLastError(); - switch (errorCode) - { - case ERROR_IO_PENDING: - // There was a pending connection that can be waited on (will happen in poll) - case ERROR_PIPE_CONNECTED: - // Occurs when a client connects before the function is called. - // In this case, there is a connection between client and - // server, even though the function returned zero. - break; - - default: - if (callback != nullptr) - callback("A client process failed to connect.", errorCode); - ::CloseHandle(_hPipe); - _hPipe = INVALID_HANDLE_VALUE; - ::CloseHandle(_oOverlap.hEvent); - _oOverlap.hEvent = INVALID_HANDLE_VALUE; - memset(&_oOverlap, 0, sizeof(OVERLAPPED)); // clear the overlapped objects state - return false; - } - } - - _isListening = true; - return true; -} - -IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback) -{ - _ASSERTE(_isListening); - _ASSERTE(mode == ConnectionMode::LISTEN); - - DWORD dwDummy = 0; - IpcStream *pStream = nullptr; - bool fSuccess = GetOverlappedResult( - _hPipe, // handle - &_oOverlap, // overlapped - &dwDummy, // throw-away dword - true); // wait till event signals - - if (!fSuccess) - { - if (callback != nullptr) - callback("Failed to GetOverlappedResults for NamedPipe server", ::GetLastError()); - // close the pipe (cleaned up and reset below) - ::CloseHandle(_hPipe); - } - else - { - // create new IpcStream using handle (passes ownership to pStream) - pStream = new IpcStream(_hPipe, ConnectionMode::LISTEN); - } - - // reset the server - _hPipe = INVALID_HANDLE_VALUE; - _isListening = false; - ::CloseHandle(_oOverlap.hEvent); - memset(&_oOverlap, 0, sizeof(OVERLAPPED)); // clear the overlapped objects state - fSuccess = Listen(callback); - if (!fSuccess) - { - delete pStream; - pStream = nullptr; - } - - return pStream; -} - -IpcStream *IpcStream::DiagnosticsIpc::Connect(ErrorCallback callback) -{ - _ASSERTE(mode == ConnectionMode::CONNECT); - if (mode != ConnectionMode::CONNECT) - { - if (callback != nullptr) - callback("Cannot call connect on a server connection", 0); - return nullptr; - } - - HANDLE hPipe = ::CreateFileA( - _pNamedPipeName, // pipe name - PIPE_ACCESS_DUPLEX, // read/write access - 0, // no sharing - NULL, // default security attributes - OPEN_EXISTING, // opens existing pipe - FILE_FLAG_OVERLAPPED, // Overlapped - NULL); // no template file - - if (hPipe == INVALID_HANDLE_VALUE) - { - if (callback != nullptr) - callback("Failed to connect to named pipe.", ::GetLastError()); - return nullptr; - } - - return new IpcStream(hPipe, mode); -} - -void IpcStream::DiagnosticsIpc::Close(bool isShutdown, ErrorCallback callback) -{ - // don't attempt cleanup on shutdown and let the OS handle it - if (isShutdown) - { - if (callback != nullptr) - callback("Closing without cleaning underlying handles", 100); - return; - } - - if (_hPipe != INVALID_HANDLE_VALUE) - { - if (mode == DiagnosticsIpc::ConnectionMode::LISTEN) - { - const BOOL fSuccessDisconnectNamedPipe = ::DisconnectNamedPipe(_hPipe); - _ASSERTE(fSuccessDisconnectNamedPipe != 0); - if (fSuccessDisconnectNamedPipe != 0 && callback != nullptr) - callback("Failed to disconnect NamedPipe", ::GetLastError()); - } - - const BOOL fSuccessCloseHandle = ::CloseHandle(_hPipe); - _ASSERTE(fSuccessCloseHandle != 0); - if (fSuccessCloseHandle != 0 && callback != nullptr) - callback("Failed to close pipe handle", ::GetLastError()); - } - - if (_oOverlap.hEvent != INVALID_HANDLE_VALUE) - { - const BOOL fSuccessCloseEvent = ::CloseHandle(_oOverlap.hEvent); - _ASSERTE(fSuccessCloseEvent != 0); - if (fSuccessCloseEvent != 0 && callback != nullptr) - callback("Failed to close overlap event handle", ::GetLastError()); - } -} - -IpcStream::IpcStream(HANDLE hPipe, DiagnosticsIpc::ConnectionMode mode) : - _hPipe(hPipe), - _mode(mode) -{ - memset(&_oOverlap, 0, sizeof(OVERLAPPED)); - _oOverlap.hEvent = CreateEvent(NULL, true, false, NULL); -} - -IpcStream::~IpcStream() -{ - Close(); -} - -void IpcStream::Close(ErrorCallback callback) -{ - if (_hPipe != INVALID_HANDLE_VALUE) - { - Flush(); - - if (_mode == DiagnosticsIpc::ConnectionMode::LISTEN) - { - const BOOL fSuccessDisconnectNamedPipe = ::DisconnectNamedPipe(_hPipe); - _ASSERTE(fSuccessDisconnectNamedPipe != 0); - if (fSuccessDisconnectNamedPipe != 0 && callback != nullptr) - callback("Failed to disconnect NamedPipe", ::GetLastError()); - } - - const BOOL fSuccessCloseHandle = ::CloseHandle(_hPipe); - _ASSERTE(fSuccessCloseHandle != 0); - if (fSuccessCloseHandle != 0 && callback != nullptr) - callback("Failed to close pipe handle", ::GetLastError()); - } - - if (_oOverlap.hEvent != INVALID_HANDLE_VALUE) - { - const BOOL fSuccessCloseEvent = ::CloseHandle(_oOverlap.hEvent); - _ASSERTE(fSuccessCloseEvent != 0); - if (fSuccessCloseEvent != 0 && callback != nullptr) - callback("Failed to close overlapped event handle", ::GetLastError()); - } -} - -int32_t IpcStream::DiagnosticsIpc::Poll(IpcPollHandle *rgIpcPollHandles, uint32_t nHandles, int32_t timeoutMs, ErrorCallback callback) -{ - // load up an array of handles - HANDLE *pHandles = new HANDLE[nHandles]; - for (uint32_t i = 0; i < nHandles; i++) - { - rgIpcPollHandles[i].revents = 0; // ignore any inputs on revents - if (rgIpcPollHandles[i].pIpc != nullptr) - { - // SERVER - _ASSERTE(rgIpcPollHandles[i].pIpc->mode == DiagnosticsIpc::ConnectionMode::LISTEN); - pHandles[i] = rgIpcPollHandles[i].pIpc->_oOverlap.hEvent; - } - else - { - // CLIENT - bool fSuccess = false; - DWORD dwDummy = 0; - if (!rgIpcPollHandles[i].pStream->_isTestReading) - { - // check for data by doing an asynchronous 0 byte read. - // This will signal if the pipe closes (hangup) or the server - // sends new data - fSuccess = ::ReadFile( - rgIpcPollHandles[i].pStream->_hPipe, // handle - nullptr, // null buffer - 0, // read 0 bytes - &dwDummy, // dummy variable - &rgIpcPollHandles[i].pStream->_oOverlap); // overlap object to use - rgIpcPollHandles[i].pStream->_isTestReading = true; - if (!fSuccess) - { - DWORD error = ::GetLastError(); - switch (error) - { - case ERROR_IO_PENDING: - pHandles[i] = rgIpcPollHandles[i].pStream->_oOverlap.hEvent; - break; - case ERROR_PIPE_NOT_CONNECTED: - // hangup - rgIpcPollHandles[i].revents = (uint8_t)PollEvents::HANGUP; - delete[] pHandles; - return -1; - default: - if (callback != nullptr) - callback("0 byte async read on client connection failed", error); - delete[] pHandles; - return -1; - } - } - else - { - // there's already data to be read - pHandles[i] = rgIpcPollHandles[i].pStream->_oOverlap.hEvent; - } - } - else - { - pHandles[i] = rgIpcPollHandles[i].pStream->_oOverlap.hEvent; - } - } - } - - // call wait for multiple obj - DWORD dwWait = WaitForMultipleObjects( - nHandles, // count - pHandles, // handles - false, // Don't wait-all - timeoutMs); - - if (dwWait == WAIT_TIMEOUT) - { - // we timed out - delete[] pHandles; - return 0; - } - - if (dwWait == WAIT_FAILED) - { - // we errored - if (callback != nullptr) - callback("WaitForMultipleObjects failed", ::GetLastError()); - delete[] pHandles; - return -1; - } - - // determine which of the streams signaled - DWORD index = dwWait - WAIT_OBJECT_0; - // error check the index - if (index < 0 || index > (nHandles - 1)) - { - // check if we abandoned something - DWORD abandonedIndex = dwWait - WAIT_ABANDONED_0; - if (abandonedIndex > 0 || abandonedIndex < (nHandles - 1)) - { - rgIpcPollHandles[abandonedIndex].revents = (uint8_t)IpcStream::DiagnosticsIpc::PollEvents::HANGUP; - delete[] pHandles; - return -1; - } - else - { - if (callback != nullptr) - callback("WaitForMultipleObjects failed", ::GetLastError()); - delete[] pHandles; - return -1; - } - } - - // Set revents depending on what signaled the stream - if (rgIpcPollHandles[index].pIpc == nullptr) - { - // CLIENT - // check if the connection got hung up - DWORD dwDummy = 0; - bool fSuccess = GetOverlappedResult(rgIpcPollHandles[index].pStream->_hPipe, - &rgIpcPollHandles[index].pStream->_oOverlap, - &dwDummy, - true); - rgIpcPollHandles[index].pStream->_isTestReading = false; - if (!fSuccess) - { - DWORD error = ::GetLastError(); - if (error == ERROR_PIPE_NOT_CONNECTED || error == ERROR_BROKEN_PIPE) - rgIpcPollHandles[index].revents = (uint8_t)IpcStream::DiagnosticsIpc::PollEvents::HANGUP; - else - { - if (callback != nullptr) - callback("Client connection error", error); - rgIpcPollHandles[index].revents = (uint8_t)IpcStream::DiagnosticsIpc::PollEvents::ERR; - delete[] pHandles; - return -1; - } - } - else - { - rgIpcPollHandles[index].revents = (uint8_t)IpcStream::DiagnosticsIpc::PollEvents::SIGNALED; - } - } - else - { - // SERVER - rgIpcPollHandles[index].revents = (uint8_t)IpcStream::DiagnosticsIpc::PollEvents::SIGNALED; - } - - delete[] pHandles; - return 1; -} - -bool IpcStream::Read(void *lpBuffer, const uint32_t nBytesToRead, uint32_t &nBytesRead, const int32_t timeoutMs) -{ - _ASSERTE(lpBuffer != nullptr); - - DWORD nNumberOfBytesRead = 0; - LPOVERLAPPED overlap = &_oOverlap; - bool fSuccess = ::ReadFile( - _hPipe, // handle to pipe - lpBuffer, // buffer to receive data - nBytesToRead, // size of buffer - &nNumberOfBytesRead, // number of bytes read - overlap) != 0; // overlapped I/O - - if (!fSuccess) - { - DWORD dwError = GetLastError(); - - // if we're waiting infinitely, only make one syscall - if (timeoutMs == InfiniteTimeout && dwError == ERROR_IO_PENDING) - { - fSuccess = GetOverlappedResult(_hPipe, // pipe - overlap, // overlapped - &nNumberOfBytesRead, // out actual number of bytes read - true) != 0; // block until async IO completes - } - else if (dwError == ERROR_IO_PENDING) - { - // Wait on overlapped IO event (triggers when async IO is complete regardless of success) - // or timeout - DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs); - if (dwWait == WAIT_OBJECT_0) - { - // async IO compelted, get the result - fSuccess = GetOverlappedResult(_hPipe, // pipe - overlap, // overlapped - &nNumberOfBytesRead, // out actual number of bytes read - true) != 0; // block until async IO completes - } - else - { - // We either timed out or something else went wrong. - // For any error, attempt to cancel IO and ensure the cancel happened - if (CancelIoEx(_hPipe, overlap) != 0) - { - // check if the async write beat the cancellation - fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesRead, true) != 0; - // Failure here isn't recoverable, so return as such - } - } - } - // error is unrecoverable, so return as such - } - - nBytesRead = static_cast(nNumberOfBytesRead); - return fSuccess; -} - -bool IpcStream::Write(const void *lpBuffer, const uint32_t nBytesToWrite, uint32_t &nBytesWritten, const int32_t timeoutMs) -{ - _ASSERTE(lpBuffer != nullptr); - - DWORD nNumberOfBytesWritten = 0; - LPOVERLAPPED overlap = &_oOverlap; - bool fSuccess = ::WriteFile( - _hPipe, // handle to pipe - lpBuffer, // buffer to write from - nBytesToWrite, // number of bytes to write - &nNumberOfBytesWritten, // number of bytes written - overlap) != 0; // overlapped I/O - - if (!fSuccess) - { - DWORD dwError = GetLastError(); - - // if we're waiting infinitely, only make one syscall - if (timeoutMs == InfiniteTimeout && dwError == ERROR_IO_PENDING) - { - fSuccess = GetOverlappedResult(_hPipe, // pipe - overlap, // overlapped - &nNumberOfBytesWritten, // out actual number of bytes written - true) != 0; // block until async IO completes - } - else if (dwError == ERROR_IO_PENDING) - { - // Wait on overlapped IO event (triggers when async IO is complete regardless of success) - // or timeout - DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs); - if (dwWait == WAIT_OBJECT_0) - { - // async IO compelted, get the result - fSuccess = GetOverlappedResult(_hPipe, // pipe - overlap, // overlapped - &nNumberOfBytesWritten, // out actual number of bytes written - true) != 0; // block until async IO completes - } - else - { - // We either timed out or something else went wrong. - // For any error, attempt to cancel IO and ensure the cancel happened - if (CancelIoEx(_hPipe, overlap) != 0) - { - // check if the async write beat the cancellation - fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesWritten, true) != 0; - // Failure here isn't recoverable, so return as such - } - } - } - // error is unrecoverable, so return as such - } - - nBytesWritten = static_cast(nNumberOfBytesWritten); - return fSuccess; -} - -bool IpcStream::Flush() const -{ - const bool fSuccess = ::FlushFileBuffers(_hPipe) != 0; - if (!fSuccess) - { - // TODO: Add error handling. - } - return fSuccess; -} diff --git a/src/coreclr/debug/inc/diagnosticsipc.h b/src/coreclr/debug/inc/diagnosticsipc.h deleted file mode 100644 index 49f1dd74991..00000000000 --- a/src/coreclr/debug/inc/diagnosticsipc.h +++ /dev/null @@ -1,149 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#ifndef __DIAGNOSTICS_IPC_H__ -#define __DIAGNOSTICS_IPC_H__ - -#include - -#ifdef TARGET_UNIX - struct sockaddr_un; -#else - #include -#endif /* TARGET_UNIX */ - -typedef void (*ErrorCallback)(const char *szMessage, uint32_t code); - -class IpcStream final -{ - friend class IpcStreamFactory; -public: - static constexpr int32_t InfiniteTimeout = -1; - ~IpcStream(); - bool Read(void *lpBuffer, const uint32_t nBytesToRead, uint32_t &nBytesRead, const int32_t timeoutMs = IpcStream::InfiniteTimeout); - bool Write(const void *lpBuffer, const uint32_t nBytesToWrite, uint32_t &nBytesWritten, const int32_t timeoutMs = IpcStream::InfiniteTimeout); - bool Flush() const; - void Close(ErrorCallback callback = nullptr); - - class DiagnosticsIpc final - { - friend class IpcStreamFactory; - public: - enum ConnectionMode - { - CONNECT, - LISTEN - }; - - enum class PollEvents : uint8_t - { - NONE = 0x00, // no events - SIGNALED = 0x01, // ready for use - HANGUP = 0x02, // connection remotely closed - ERR = 0x04, // error - UNKNOWN = 0x80 // unknown state - }; - - // The bookkeeping struct used for polling on server and client structs - struct IpcPollHandle - { - // Only one of these will be non-null, treat as a union - DiagnosticsIpc *pIpc; - IpcStream *pStream; - - // contains some set of PollEvents - // will be set by Poll - // Any values here are ignored by Poll - uint8_t revents; - - // a cookie assignable by upstream users for additional bookkeeping - void *pUserData; - }; - - // Poll - // Parameters: - // - IpcPollHandle * rgpIpcPollHandles: Array of IpcPollHandles to poll - // - uint32_t nHandles: The number of handles to poll - // - int32_t timeoutMs: The timeout in milliseconds for the poll (-1 == infinite) - // Returns: - // int32_t: -1 on error, 0 on timeout, >0 on successful poll - // Remarks: - // Check the events returned in revents for each IpcPollHandle to find the signaled handle. - // Signaled DiagnosticsIpcs can call Accept() without blocking. - // Signaled IpcStreams can call Read(...) without blocking. - // The caller is responsible for cleaning up "hung up" connections. - static int32_t Poll(IpcPollHandle *rgIpcPollHandles, uint32_t nHandles, int32_t timeoutMs, ErrorCallback callback = nullptr); - - ConnectionMode mode; - - ~DiagnosticsIpc(); - - // Creates an IPC object - static DiagnosticsIpc *Create(const char *const pIpcName, ConnectionMode mode, ErrorCallback callback = nullptr); - - // puts the DiagnosticsIpc into Listening Mode - // Re-entrant safe - bool Listen(ErrorCallback callback = nullptr); - - // produces a connected stream from a server-mode DiagnosticsIpc. Blocks until a connection is available. - IpcStream *Accept(ErrorCallback callback = nullptr); - - // Connect to a server and returns a connected stream - IpcStream *Connect(ErrorCallback callback = nullptr); - - // Closes an open IPC. - // Only attempts minimal cleanup if isShutdown==true, i.e., unlinks Unix Domain Socket on Linux, no-op on Windows - void Close(bool isShutdown = false, ErrorCallback callback = nullptr); - - private: - -#ifdef TARGET_UNIX - const int _serverSocket; - sockaddr_un *const _pServerAddress; - bool _isClosed; - - DiagnosticsIpc(const int serverSocket, sockaddr_un *const pServerAddress, ConnectionMode mode = ConnectionMode::LISTEN); - - // Used to unlink the socket so it can be removed from the filesystem - // when the last reference to it is closed. - void Unlink(ErrorCallback callback = nullptr); -#else - static const uint32_t MaxNamedPipeNameLength = 256; - char _pNamedPipeName[MaxNamedPipeNameLength]; // https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-createnamedpipea - HANDLE _hPipe = INVALID_HANDLE_VALUE; - OVERLAPPED _oOverlap = {}; - - DiagnosticsIpc(const char(&namedPipeName)[MaxNamedPipeNameLength], ConnectionMode mode = ConnectionMode::LISTEN); -#endif /* TARGET_UNIX */ - - bool _isListening; - - DiagnosticsIpc() = delete; - DiagnosticsIpc(const DiagnosticsIpc &src) = delete; - DiagnosticsIpc(DiagnosticsIpc &&src) = delete; - DiagnosticsIpc &operator=(const DiagnosticsIpc &rhs) = delete; - DiagnosticsIpc &&operator=(DiagnosticsIpc &&rhs) = delete; - }; - -private: -#ifdef TARGET_UNIX - int _clientSocket = -1; - IpcStream(int clientSocket, DiagnosticsIpc::ConnectionMode mode = DiagnosticsIpc::ConnectionMode::LISTEN) - : _clientSocket(clientSocket), _mode(mode) {} -#else - HANDLE _hPipe = INVALID_HANDLE_VALUE; - OVERLAPPED _oOverlap = {}; - BOOL _isTestReading = false; // used to check whether we are already doing a 0-byte read to test for data - IpcStream(HANDLE hPipe, DiagnosticsIpc::ConnectionMode mode = DiagnosticsIpc::ConnectionMode::LISTEN); -#endif /* TARGET_UNIX */ - - DiagnosticsIpc::ConnectionMode _mode; - - IpcStream() = delete; - IpcStream(const IpcStream &src) = delete; - IpcStream(IpcStream &&src) = delete; - IpcStream &operator=(const IpcStream &rhs) = delete; - IpcStream &&operator=(IpcStream &&rhs) = delete; -}; - -#endif // __DIAGNOSTICS_IPC_H__ diff --git a/src/coreclr/inc/getproductversionnumber.h b/src/coreclr/inc/getproductversionnumber.h deleted file mode 100644 index 068ed784930..00000000000 --- a/src/coreclr/inc/getproductversionnumber.h +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -// GetProductVersionNumber.h -// -// Helper function to retrieve the file version number of a file. -// -// ====================================================================================== - - - -#ifndef __GetProductVersionNumber_h__ -#define __GetProductVersionNumber_h__ - -#include "contract.h" -#include "sstring.h" -#include "holder.h" -#include "ex.h" - -//--------------------------------------------------------------------------------------- -// -// Given the full path to an image, return the product version number. -// -// Arguments: -// szFullPath - full path to the image -// pdwVersionMS - out parameter; return the most significant 4 bytes of the version number according to -// the VS_FIXEDFILEINFO convention -// pdwVersionLS - out parameter; return the least significant 4 bytes of the version number according to -// the VS_FIXEDFILEINFO convention -// -// Notes: -// Throws on error - -void inline GetProductVersionNumber(SString &szFullPath, DWORD * pdwVersionMS, DWORD * pdwVersionLS) -{ - WRAPPER_NO_CONTRACT; -#ifndef TARGET_UNIX - - DWORD dwDummy = 0; - DWORD dwFileInfoSize = 0; - - // Get the size of all of the file version information. - dwFileInfoSize = GetFileVersionInfoSize(szFullPath, &dwDummy); - if (dwFileInfoSize == 0) - { - ThrowLastError(); - } - - // Create the buffer to store the file information. - NewHolder pbFileInfo(new BYTE[dwFileInfoSize]); - - // Actually retrieve the file version information. - if (!GetFileVersionInfo(szFullPath, NULL, dwFileInfoSize, pbFileInfo)) - { - ThrowLastError(); - } - - // Now retrieve only the relevant version information, which will be returned in a VS_FIXEDFILEINFO. - UINT uVersionInfoSize = 0; - VS_FIXEDFILEINFO * pVersionInfo = NULL; - - if (!VerQueryValue(pbFileInfo, W("\\"), reinterpret_cast(&pVersionInfo), &uVersionInfoSize)) - { - ThrowLastError(); - } - _ASSERTE(uVersionInfoSize == sizeof(VS_FIXEDFILEINFO)); - - *pdwVersionMS = pVersionInfo->dwProductVersionMS; - *pdwVersionLS = pVersionInfo->dwProductVersionLS; -#else - *pdwVersionMS = 0; - *pdwVersionLS = 0; -#endif // TARGET_UNIX -} - -#endif // __GetProductVersionNumber_h__ diff --git a/src/coreclr/inc/MSCOREE.IDL b/src/coreclr/inc/mscoree.idl similarity index 100% rename from src/coreclr/inc/MSCOREE.IDL rename to src/coreclr/inc/mscoree.idl diff --git a/src/coreclr/md/compiler/CMakeLists.txt b/src/coreclr/md/compiler/CMakeLists.txt index 3ef387534a4..2182d0ebf4c 100644 --- a/src/coreclr/md/compiler/CMakeLists.txt +++ b/src/coreclr/md/compiler/CMakeLists.txt @@ -37,7 +37,6 @@ set(MDCOMPILER_HEADERS disp.h filtermanager.h importhelper.h - mdperf.h mdutil.h regmeta.h ) diff --git a/src/coreclr/md/compiler/assemblymd.cpp b/src/coreclr/md/compiler/assemblymd.cpp index 1282109db30..7372e4cbe29 100644 --- a/src/coreclr/md/compiler/assemblymd.cpp +++ b/src/coreclr/md/compiler/assemblymd.cpp @@ -44,7 +44,6 @@ STDMETHODIMP RegMeta::GetAssemblyProps( // S_OK or error. mda, ppbPublicKey, pcbPublicKey, pulHashAlgId, szName, cchName, pchName, pMetaData, pdwAssemblyFlags)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mda) == mdtAssembly && RidFromToken(mda)); @@ -83,7 +82,6 @@ STDMETHODIMP RegMeta::GetAssemblyProps( // S_OK or error. IfFailGo(pMiniMd->getNameOfAssembly(pRecord, szName, cchName, pchName)); ErrExit: - STOP_MD_PERF(GetAssemblyProps); END_ENTRYPOINT_NOTHROW; @@ -116,7 +114,6 @@ STDMETHODIMP RegMeta::GetAssemblyRefProps( // S_OK or error. mdar, ppbPublicKeyOrToken, pcbPublicKeyOrToken, szName, cchName, pchName, pMetaData, ppbHashValue, pdwAssemblyRefFlags)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mdar) == mdtAssemblyRef && RidFromToken(mdar)); @@ -148,7 +145,6 @@ STDMETHODIMP RegMeta::GetAssemblyRefProps( // S_OK or error. IfFailGo(pMiniMd->getNameOfAssemblyRef(pRecord, szName, cchName, pchName)); ErrExit: - STOP_MD_PERF(GetAssemblyRefProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -176,7 +172,6 @@ STDMETHODIMP RegMeta::GetFileProps( // S_OK or error. LOG((LOGMD, "RegMeta::GetFileProps(%#08x, %#08x, %#08x, %#08x, %#08x, %#08x, %#08x)\n", mdf, szName, cchName, pchName, ppbHashValue, pcbHashValue, pdwFileFlags)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mdf) == mdtFile && RidFromToken(mdf)); @@ -195,7 +190,6 @@ STDMETHODIMP RegMeta::GetFileProps( // S_OK or error. } ErrExit: - STOP_MD_PERF(GetFileProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -225,7 +219,6 @@ STDMETHODIMP RegMeta::GetExportedTypeProps( // S_OK or error. mdct, szName, cchName, pchName, ptkImplementation, ptkTypeDef, pdwExportedTypeFlags)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mdct) == mdtExportedType && RidFromToken(mdct)); @@ -273,7 +266,6 @@ STDMETHODIMP RegMeta::GetExportedTypeProps( // S_OK or error. } ErrExit: - STOP_MD_PERF(GetExportedTypeProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -304,7 +296,6 @@ STDMETHODIMP RegMeta::GetManifestResourceProps( // S_OK or error. ptkImplementation, pdwOffset, pdwResourceFlags)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mdmr) == mdtManifestResource && RidFromToken(mdmr)); @@ -321,7 +312,6 @@ STDMETHODIMP RegMeta::GetManifestResourceProps( // S_OK or error. IfFailGo(pMiniMd->getNameOfManifestResource(pRecord, szName, cchName, pchName)); ErrExit: - STOP_MD_PERF(GetManifestResourceProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -346,7 +336,6 @@ STDMETHODIMP RegMeta::EnumAssemblyRefs( // S_OK or error LOG((LOGMD, "MD RegMeta::EnumAssemblyRefs(%#08x, %#08x, %#08x, %#08x)\n", phEnum, rAssemblyRefs, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); @@ -373,7 +362,6 @@ STDMETHODIMP RegMeta::EnumAssemblyRefs( // S_OK or error ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); - STOP_MD_PERF(EnumAssemblyRefs); END_ENTRYPOINT_NOTHROW; @@ -398,7 +386,6 @@ STDMETHODIMP RegMeta::EnumFiles( // S_OK or error LOG((LOGMD, "MD RegMeta::EnumFiles(%#08x, %#08x, %#08x, %#08x)\n", phEnum, rFiles, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); if (*ppmdEnum == 0) @@ -424,7 +411,6 @@ STDMETHODIMP RegMeta::EnumFiles( // S_OK or error ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); - STOP_MD_PERF(EnumFiles); END_ENTRYPOINT_NOTHROW; return hr; @@ -449,7 +435,6 @@ STDMETHODIMP RegMeta::EnumExportedTypes( // S_OK or error LOG((LOGMD, "MD RegMeta::EnumExportedTypes(%#08x, %#08x, %#08x, %#08x)\n", phEnum, rExportedTypes, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); if (*ppmdEnum == 0) @@ -497,7 +482,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumExportedTypes); END_ENTRYPOINT_NOTHROW; return hr; @@ -522,7 +506,6 @@ STDMETHODIMP RegMeta::EnumManifestResources( // S_OK or error LOG((LOGMD, "MD RegMeta::EnumManifestResources(%#08x, %#08x, %#08x, %#08x)\n", phEnum, rManifestResources, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); if (*ppmdEnum == 0) @@ -548,7 +531,6 @@ STDMETHODIMP RegMeta::EnumManifestResources( // S_OK or error ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); - STOP_MD_PERF(EnumManifestResources); END_ENTRYPOINT_NOTHROW; return hr; @@ -566,7 +548,6 @@ STDMETHODIMP RegMeta::GetAssemblyFromScope( // S_OK or error BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "MD RegMeta::GetAssemblyFromScope(%#08x)\n", ptkAssembly)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(ptkAssembly); @@ -580,7 +561,6 @@ STDMETHODIMP RegMeta::GetAssemblyFromScope( // S_OK or error IfFailGo( CLDB_E_RECORD_NOTFOUND ); } ErrExit: - STOP_MD_PERF(GetAssemblyFromScope); END_ENTRYPOINT_NOTHROW; return hr; @@ -604,7 +584,6 @@ STDMETHODIMP RegMeta::FindExportedTypeByName( // S_OK or error LOG((LOGMD, "MD RegMeta::FindExportedTypeByName(%S, %#08x, %#08x)\n", MDSTR(szName), tkEnclosingType, ptkExportedType)); - START_MD_PERF(); LOCKREAD(); @@ -627,7 +606,6 @@ STDMETHODIMP RegMeta::FindExportedTypeByName( // S_OK or error tkEnclosingType, ptkExportedType)); ErrExit: - STOP_MD_PERF(FindExportedTypeByName); END_ENTRYPOINT_NOTHROW; return hr; @@ -650,7 +628,6 @@ STDMETHODIMP RegMeta::FindManifestResourceByName( // S_OK or error LOG((LOGMD, "MD RegMeta::FindManifestResourceByName(%S, %#08x)\n", MDSTR(szName), ptkManifestResource)); - START_MD_PERF(); LOCKREAD(); @@ -684,7 +661,6 @@ STDMETHODIMP RegMeta::FindManifestResourceByName( // S_OK or error IfFailGo( CLDB_E_RECORD_NOTFOUND ); ErrExit: - STOP_MD_PERF(FindManifestResourceByName); END_ENTRYPOINT_NOTHROW; return hr; @@ -708,14 +684,12 @@ STDMETHODIMP RegMeta::FindAssembliesByName( // S_OK or error LOG((LOGMD, "RegMeta::FindAssembliesByName(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", szAppBase, szPrivateBin, szAssemblyName, ppIUnk, cMax, pcAssemblies)); - START_MD_PERF(); // No need to lock this function. It is going through fusion to find the matching Assemblies by name IfFailGo(COR_E_NOTSUPPORTED); ErrExit: - STOP_MD_PERF(FindAssembliesByName); END_ENTRYPOINT_NOTHROW; return hr; diff --git a/src/coreclr/md/compiler/assemblymd_emit.cpp b/src/coreclr/md/compiler/assemblymd_emit.cpp index 32d8f63f038..6eeb0bcb125 100644 --- a/src/coreclr/md/compiler/assemblymd_emit.cpp +++ b/src/coreclr/md/compiler/assemblymd_emit.cpp @@ -47,7 +47,6 @@ STDMETHODIMP RegMeta::DefineAssembly( // S_OK or error. pbPublicKey, cbPublicKey, ulHashAlgId, MDSTR(szName), pMetaData, dwAssemblyFlags, pma)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(szName && pMetaData && pma); @@ -95,7 +94,6 @@ STDMETHODIMP RegMeta::DefineAssembly( // S_OK or error. ErrExit: - STOP_MD_PERF(DefineAssembly); END_ENTRYPOINT_NOTHROW; return hr; @@ -128,7 +126,6 @@ STDMETHODIMP RegMeta::DefineAssemblyRef( // S_OK or error. pbPublicKeyOrToken, cbPublicKeyOrToken, MDSTR(szName), pMetaData, pbHashValue, cbHashValue, dwAssemblyRefFlags, pmar)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -187,7 +184,6 @@ STDMETHODIMP RegMeta::DefineAssemblyRef( // S_OK or error. ErrExit: SetCallerExternal(); - STOP_MD_PERF(DefineAssemblyRef); END_ENTRYPOINT_NOTHROW; return hr; @@ -213,7 +209,6 @@ STDMETHODIMP RegMeta::DefineFile( // S_OK or error. LOG((LOGMD, "RegMeta::DefineFile(%S, %#08x, %#08x, %#08x, %#08x)\n", MDSTR(szName), pbHashValue, cbHashValue, dwFileFlags, pmf)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -260,7 +255,6 @@ STDMETHODIMP RegMeta::DefineFile( // S_OK or error. IfFailGo(_SetFileProps(*pmf, pbHashValue, cbHashValue, dwFileFlags)); ErrExit: - STOP_MD_PERF(DefineFile); END_ENTRYPOINT_NOTHROW; return hr; @@ -290,7 +284,6 @@ STDMETHODIMP RegMeta::DefineExportedType( // S_OK or error. MDSTR(szName), tkImplementation, tkTypeDef, dwExportedTypeFlags, pmct)); - START_MD_PERF(); LOCKWRITE(); // Validate name for prefix. @@ -360,7 +353,6 @@ STDMETHODIMP RegMeta::DefineExportedType( // S_OK or error. dwExportedTypeFlags)); ErrExit: - STOP_MD_PERF(DefineExportedType); END_ENTRYPOINT_NOTHROW; return hr; @@ -386,7 +378,6 @@ STDMETHODIMP RegMeta::DefineManifestResource( // S_OK or error. LOG((LOGMD, "RegMeta::DefineManifestResource(%S, %#08x, %#08x, %#08x, %#08x)\n", MDSTR(szName), tkImplementation, dwOffset, dwResourceFlags, pmmr)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -439,7 +430,6 @@ STDMETHODIMP RegMeta::DefineManifestResource( // S_OK or error. ErrExit: - STOP_MD_PERF(DefineManifestResource); END_ENTRYPOINT_NOTHROW; return hr; @@ -466,7 +456,6 @@ STDMETHODIMP RegMeta::SetAssemblyProps( // S_OK or error. LOG((LOGMD, "RegMeta::SetAssemblyProps(%#08x, %#08x, %#08x, %#08x %S, %#08x, %#08x)\n", ma, pbPublicKey, cbPublicKey, ulHashAlgId, MDSTR(szName), pMetaData, dwAssemblyFlags)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -474,7 +463,6 @@ STDMETHODIMP RegMeta::SetAssemblyProps( // S_OK or error. IfFailGo(_SetAssemblyProps(ma, pbPublicKey, cbPublicKey, ulHashAlgId, szName, pMetaData, dwAssemblyFlags)); ErrExit: - STOP_MD_PERF(SetAssemblyProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -503,7 +491,6 @@ STDMETHODIMP RegMeta::SetAssemblyRefProps( // S_OK or error. ar, pbPublicKeyOrToken, cbPublicKeyOrToken, MDSTR(szName), pMetaData, pbHashValue, cbHashValue, dwAssemblyRefFlags)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -519,7 +506,6 @@ STDMETHODIMP RegMeta::SetAssemblyRefProps( // S_OK or error. dwAssemblyRefFlags)); ErrExit: - STOP_MD_PERF(SetAssemblyRefProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -543,7 +529,6 @@ STDMETHODIMP RegMeta::SetFileProps( // S_OK or error. LOG((LOGMD, "RegMeta::SetFileProps(%#08x, %#08x, %#08x, %#08x)\n", file, pbHashValue, cbHashValue, dwFileFlags)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -552,7 +537,6 @@ STDMETHODIMP RegMeta::SetFileProps( // S_OK or error. ErrExit: - STOP_MD_PERF(SetFileProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -575,14 +559,12 @@ STDMETHODIMP RegMeta::SetExportedTypeProps( // S_OK or error. LOG((LOGMD, "RegMeta::SetExportedTypeProps(%#08x, %#08x, %#08x, %#08x)\n", ct, tkImplementation, tkTypeDef, dwExportedTypeFlags)); - START_MD_PERF(); LOCKWRITE(); IfFailGo( _SetExportedTypeProps( ct, tkImplementation, tkTypeDef, dwExportedTypeFlags) ); ErrExit: - STOP_MD_PERF(SetExportedTypeProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -609,14 +591,12 @@ STDMETHODIMP RegMeta::SetManifestResourceProps(// S_OK or error. TypeFromToken(tkImplementation) == mdtAssemblyRef || tkImplementation == mdTokenNil); - START_MD_PERF(); LOCKWRITE(); IfFailGo( _SetManifestResourceProps( mr, tkImplementation, dwOffset, dwResourceFlags) ); ErrExit: - STOP_MD_PERF(SetManifestResourceProps); END_ENTRYPOINT_NOTHROW; return hr; diff --git a/src/coreclr/md/compiler/custattr_emit.cpp b/src/coreclr/md/compiler/custattr_emit.cpp index 6d5d01135ce..d1462dc74b9 100644 --- a/src/coreclr/md/compiler/custattr_emit.cpp +++ b/src/coreclr/md/compiler/custattr_emit.cpp @@ -16,7 +16,6 @@ #include "rwutil.h" #include "mdlog.h" #include "importhelper.h" -#include "mdperf.h" #include "posterror.h" #include "cahlprinternal.h" #include "custattr.h" @@ -712,7 +711,6 @@ STDMETHODIMP RegMeta::DefineCustomAttribute( LOG((LOGMD, "RegMeta::DefineCustomAttribute(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", tkOwner, tkCtor, pCustomAttribute, cbCustomAttribute, pcv)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(TypeFromToken(tkCtor) == mdtMethodDef || TypeFromToken(tkCtor) == mdtMemberRef); @@ -825,7 +823,6 @@ STDMETHODIMP RegMeta::DefineCustomAttribute( IfFailGo(UpdateENCLog(TokenFromRid(iRecord, mdtCustomAttribute))); ErrExit: - STOP_MD_PERF(DefineCustomAttribute); END_ENTRYPOINT_NOTHROW; return hr; @@ -849,7 +846,6 @@ STDMETHODIMP RegMeta::SetCustomAttributeValue( // Return code. CustomAttributeRec *pRecord = NULL;// Existing custom Attribute record. - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -863,7 +859,6 @@ STDMETHODIMP RegMeta::SetCustomAttributeValue( // Return code. IfFailGo(UpdateENCLog(tkAttr)); ErrExit: - STOP_MD_PERF(SetCustomAttributeValue); END_ENTRYPOINT_NOTHROW; return hr; diff --git a/src/coreclr/md/compiler/custattr_import.cpp b/src/coreclr/md/compiler/custattr_import.cpp index 5313634b2c7..c7b40c1981f 100644 --- a/src/coreclr/md/compiler/custattr_import.cpp +++ b/src/coreclr/md/compiler/custattr_import.cpp @@ -16,7 +16,6 @@ #include "rwutil.h" #include "mdlog.h" #include "importhelper.h" -#include "mdperf.h" #include "posterror.h" #include "cahlprinternal.h" #include "custattr.h" @@ -71,7 +70,6 @@ STDMETHODIMP RegMeta::GetCustomAttributeByName( // S_OK or error. int iLen; // A length. CMiniMdRW *pMiniMd = NULL; - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -83,7 +81,6 @@ STDMETHODIMP RegMeta::GetCustomAttributeByName( // S_OK or error. ErrExit: - STOP_MD_PERF(GetCustomAttributeByName); END_ENTRYPOINT_NOTHROW; return hr; @@ -114,7 +111,6 @@ STDMETHODIMP RegMeta::EnumCustomAttributes( LOG((LOGMD, "RegMeta::EnumCustomAttributes(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, tk, tkType, rCustomAttributes, cMax, pcCustomAttributes)); - START_MD_PERF(); LOCKREAD(); if ( *ppmdEnum == 0 ) @@ -230,7 +226,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumCustomAttributes); END_ENTRYPOINT_NOTHROW; return hr; @@ -253,7 +248,6 @@ STDMETHODIMP RegMeta::GetCustomAttributeProps( CMiniMdRW *pMiniMd; - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(cv) == mdtCustomAttribute); @@ -276,7 +270,6 @@ STDMETHODIMP RegMeta::GetCustomAttributeProps( ErrExit: - STOP_MD_PERF(GetCustomAttributeProps); END_ENTRYPOINT_NOTHROW; return hr; diff --git a/src/coreclr/md/compiler/emit.cpp b/src/coreclr/md/compiler/emit.cpp index 1397eb2d29e..7c4208ba7db 100644 --- a/src/coreclr/md/compiler/emit.cpp +++ b/src/coreclr/md/compiler/emit.cpp @@ -48,7 +48,6 @@ STDMETHODIMP RegMeta::DefineMethod( // S_OK or error. LOG((LOGMD, "MD: RegMeta::DefineMethod(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", td, MDSTR(szName), dwMethodFlags, pvSigBlob, cbSigBlob, ulCodeRVA, dwImplFlags, pmd)); - START_MD_PERF(); LOCKWRITE(); @@ -132,7 +131,6 @@ STDMETHODIMP RegMeta::DefineMethod( // S_OK or error. ErrExit: SetCallerExternal(); - STOP_MD_PERF(DefineMethod); END_ENTRYPOINT_NOTHROW; return hr; @@ -159,7 +157,6 @@ STDMETHODIMP RegMeta::DefineMethodImpl( // S_OK or error. LOG((LOGMD, "MD RegMeta::DefineMethodImpl(0x%08x, 0x%08x, 0x%08x)\n", td, tkBody, tkDecl)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -198,7 +195,6 @@ STDMETHODIMP RegMeta::DefineMethodImpl( // S_OK or error. IfFailGo(UpdateENCLog2(TBL_MethodImpl, iMethodImplRec)); ErrExit: - STOP_MD_PERF(DefineMethodImpl); END_ENTRYPOINT_NOTHROW; return hr; @@ -224,7 +220,6 @@ STDMETHODIMP RegMeta::SetMethodImplFlags( // [IN] S_OK or error. LOG((LOGMD, "MD RegMeta::SetMethodImplFlags(0x%08x, 0x%08x)\n", md, dwImplFlags)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(TypeFromToken(md) == mdtMethodDef && dwImplFlags != UINT32_MAX); @@ -236,7 +231,6 @@ STDMETHODIMP RegMeta::SetMethodImplFlags( // [IN] S_OK or error. IfFailGo(UpdateENCLog(md)); ErrExit: - STOP_MD_PERF(SetMethodImplFlags); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -263,7 +257,6 @@ STDMETHODIMP RegMeta::SetFieldRVA( // [IN] S_OK or error. LOG((LOGMD, "MD RegMeta::SetFieldRVA(0x%08x, 0x%08x)\n", fd, ulRVA)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(TypeFromToken(fd) == mdtFieldDef); @@ -297,7 +290,6 @@ STDMETHODIMP RegMeta::SetFieldRVA( // [IN] S_OK or error. IfFailGo(UpdateENCLog2(TBL_FieldRVA, iFieldRVA)); ErrExit: - STOP_MD_PERF(SetFieldRVA); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -397,7 +389,6 @@ STDMETHODIMP RegMeta::DefineTypeRefByName( // S_OK or error. LOG((LOGMD, "MD RegMeta::DefineTypeRefByName(0x%08x, %S, 0x%08x)\n", tkResolutionScope, MDSTR(szName), ptr)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -406,7 +397,6 @@ STDMETHODIMP RegMeta::DefineTypeRefByName( // S_OK or error. IfFailGo(_DefineTypeRef(tkResolutionScope, szName, TRUE, ptr)); ErrExit: - STOP_MD_PERF(DefineTypeRefByName); END_ENTRYPOINT_NOTHROW; return hr; @@ -449,7 +439,6 @@ STDMETHODIMP RegMeta::DefineImportType( // S_OK or error. pAssemImport, pbHashValue, cbHashValue, pImport, tdImport, pAssemEmit, ptr)); - START_MD_PERF(); LOCKWRITE(); @@ -487,7 +476,6 @@ ErrExit: pImport2MDCommon->Release(); if (pAssemImportMDCommon) pAssemImportMDCommon->Release(); - STOP_MD_PERF(DefineImportType); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -517,7 +505,6 @@ STDMETHODIMP RegMeta::DefineMemberRef( // S_OK or error LOG((LOGMD, "MD RegMeta::DefineMemberRef(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n", tkImport, MDSTR(szName), pvSigBlob, cbSigBlob, pmr)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -579,7 +566,6 @@ STDMETHODIMP RegMeta::DefineMemberRef( // S_OK or error ErrExit: - STOP_MD_PERF(DefineMemberRef); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -611,7 +597,6 @@ STDMETHODIMP RegMeta::DefineImportMember( // S_OK or error. " 0x%08x, 0x%08x, 0x%08x)\n", pAssemImport, pbHashValue, cbHashValue, pImport, mbMember, pAssemEmit, tkImport, pmr)); - START_MD_PERF(); // No need to lock this function. All the functions that it calls are public APIs. @@ -696,7 +681,6 @@ STDMETHODIMP RegMeta::DefineImportMember( // S_OK or error. pmr)); ErrExit: - STOP_MD_PERF(DefineImportMember); END_ENTRYPOINT_NOTHROW; return hr; @@ -727,7 +711,6 @@ STDMETHODIMP RegMeta::DefineEvent( LOG((LOGMD, "MD RegMeta::DefineEvent(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", td, szEvent, dwEventFlags, tkEventType, mdAddOn, mdRemoveOn, mdFire, rmdOtherMethods, pmdEvent)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -748,7 +731,6 @@ STDMETHODIMP RegMeta::DefineEvent( IfFailGo(UpdateENCLog(*pmdEvent)); ErrExit: - STOP_MD_PERF(DefineEvent); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -777,7 +759,6 @@ STDMETHODIMP RegMeta::SetClassLayout( LOG((LOGMD, "MD RegMeta::SetClassLayout(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", td, dwPackSize, rFieldOffsets, ulClassSize)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -804,7 +785,6 @@ STDMETHODIMP RegMeta::SetClassLayout( ErrExit: - STOP_MD_PERF(SetClassLayout); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -918,7 +898,6 @@ STDMETHODIMP RegMeta::DeleteClassLayout( ULONG index; LOG((LOGMD, "MD RegMeta::DeleteClassLayout(0x%08x)\n", td)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -965,7 +944,6 @@ STDMETHODIMP RegMeta::DeleteClassLayout( } } ErrExit: - STOP_MD_PERF(DeleteClassLayout); END_ENTRYPOINT_NOTHROW; return hr; #else //!FEATURE_METADATA_EMIT_ALL @@ -991,7 +969,6 @@ STDMETHODIMP RegMeta::SetFieldMarshal( LOG((LOGMD, "MD RegMeta::SetFieldMarshal(0x%08x, 0x%08x, 0x%08x)\n", tk, pvNativeType, cbNativeType)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -999,7 +976,6 @@ STDMETHODIMP RegMeta::SetFieldMarshal( hr = _SetFieldMarshal(tk, pvNativeType, cbNativeType); ErrExit: - STOP_MD_PERF(SetFieldMarshal); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -1078,7 +1054,6 @@ STDMETHODIMP RegMeta::DeleteFieldMarshal( LOG((LOGMD, "MD RegMeta::DeleteFieldMarshal(0x%08x)\n", tk)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -1121,7 +1096,6 @@ STDMETHODIMP RegMeta::DeleteFieldMarshal( IfFailGo(UpdateENCLog2(TBL_FieldMarshal, iFieldMarshRec)); ErrExit: - STOP_MD_PERF(DeleteFieldMarshal); END_ENTRYPOINT_NOTHROW; return hr; #else //!FEATURE_METADATA_EMIT_ALL @@ -1146,7 +1120,6 @@ STDMETHODIMP RegMeta::DefinePermissionSet( LOG((LOGMD, "MD RegMeta::DefinePermissionSet(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", tk, dwAction, pvPermission, cbPermission, ppm)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -1154,7 +1127,6 @@ STDMETHODIMP RegMeta::DefinePermissionSet( IfFailGo(_DefinePermissionSet(tk, dwAction, pvPermission, cbPermission, ppm)); ErrExit: - STOP_MD_PERF(DefinePermissionSet); END_ENTRYPOINT_NOTHROW; return hr; #else //!FEATURE_METADATA_EMIT_ALL @@ -1234,7 +1206,6 @@ HRESULT RegMeta::_DefinePermissionSet( IfFailGo(UpdateENCLog(tkPerm)); ErrExit: - STOP_MD_PERF(DefinePermissionSet); return hr; #else //!FEATURE_METADATA_EMIT_ALL return E_NOTIMPL; @@ -1259,7 +1230,6 @@ STDMETHODIMP RegMeta::SetRVA( // [IN] S_OK or error. LOG((LOGMD, "MD RegMeta::SetRVA(0x%08x, 0x%08x)\n", md, ulRVA)); - START_MD_PERF(); LOCKWRITE(); @@ -1267,7 +1237,6 @@ STDMETHODIMP RegMeta::SetRVA( // [IN] S_OK or error. IfFailGo(_SetRVA(md, ulRVA, UINT32_MAX)); // 0xbaad ErrExit: - STOP_MD_PERF(SetRVA); END_ENTRYPOINT_NOTHROW; return hr; @@ -1293,7 +1262,6 @@ STDMETHODIMP RegMeta::GetTokenFromSig( // [IN] S_OK or error. LOG((LOGMD, "MD RegMeta::GetTokenFromSig(0x%08x, 0x%08x, 0x%08x)\n", pvSig, cbSig, pmsig)); - START_MD_PERF(); LOCKWRITE(); @@ -1303,7 +1271,6 @@ STDMETHODIMP RegMeta::GetTokenFromSig( // [IN] S_OK or error. IfFailGo(_GetTokenFromSig(pvSig, cbSig, pmsig)); ErrExit: - STOP_MD_PERF(GetTokenFromSig); END_ENTRYPOINT_NOTHROW; return hr; @@ -1325,7 +1292,6 @@ STDMETHODIMP RegMeta::DefineModuleRef( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "MD RegMeta::DefineModuleRef(%S, 0x%08x)\n", MDSTR(szName), pmur)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -1333,7 +1299,6 @@ STDMETHODIMP RegMeta::DefineModuleRef( // S_OK or error. hr = _DefineModuleRef(szName, pmur); ErrExit: - STOP_MD_PERF(DefineModuleRef); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -1411,7 +1376,6 @@ STDMETHODIMP RegMeta::SetParent( // S_OK or error. LOG((LOGMD, "MD RegMeta::SetParent(0x%08x, 0x%08x)\n", mr, tk)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(TypeFromToken(mr) == mdtMemberRef); @@ -1433,7 +1397,6 @@ STDMETHODIMP RegMeta::SetParent( // S_OK or error. ErrExit: - STOP_MD_PERF(SetParent); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -1459,7 +1422,6 @@ STDMETHODIMP RegMeta::GetTokenFromTypeSpec( // [IN] S_OK or error. LOG((LOGMD, "MD RegMeta::GetTokenFromTypeSpec(0x%08x, 0x%08x, 0x%08x)\n", pvSig, cbSig, ptypespec)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(ptypespec); @@ -1497,7 +1459,6 @@ STDMETHODIMP RegMeta::GetTokenFromTypeSpec( // [IN] S_OK or error. ErrExit: - STOP_MD_PERF(GetTokenFromTypeSpec); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -1530,7 +1491,6 @@ STDMETHODIMP RegMeta::DefineUserString( // S_OK or error. LOG((LOGMD, "MD RegMeta::DefineUserString(0x%08x, 0x%08x, 0x%08x)\n", szString, cchString, pstk)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -1561,7 +1521,6 @@ STDMETHODIMP RegMeta::DefineUserString( // S_OK or error. ErrExit: END_ENTRYPOINT_NOTHROW; - STOP_MD_PERF(DefineUserString); return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER } // RegMeta::DefineUserString @@ -1584,7 +1543,6 @@ STDMETHODIMP RegMeta::DeleteToken( BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "MD RegMeta::DeleteToken(0x%08x)\n", tkObj)); - START_MD_PERF(); LOCKWRITE(); if (!IsValidToken(tkObj)) @@ -1744,7 +1702,6 @@ STDMETHODIMP RegMeta::DeleteToken( ErrExit: - STOP_MD_PERF(DeleteToken); END_ENTRYPOINT_NOTHROW; return hr; @@ -1771,7 +1728,6 @@ STDMETHODIMP RegMeta::SetTypeDefProps( // S_OK or error. LOG((LOGMD, "RegMeta::SetTypeDefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", td, dwTypeDefFlags, tkExtends, rtkImplements)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -1780,7 +1736,6 @@ STDMETHODIMP RegMeta::SetTypeDefProps( // S_OK or error. ErrExit: - STOP_MD_PERF(SetTypeDefProps); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -1808,7 +1763,6 @@ STDMETHODIMP RegMeta::DefineNestedType( // S_OK or error. LOG((LOGMD, "RegMeta::DefineNestedType(%S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", MDSTR(szTypeDef), dwTypeDefFlags, tkExtends, rtkImplements, tdEncloser, ptd)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -1820,7 +1774,6 @@ STDMETHODIMP RegMeta::DefineNestedType( // S_OK or error. tkExtends, rtkImplements, tdEncloser, ptd)); ErrExit: - STOP_MD_PERF(DefineNestedType); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -1850,7 +1803,6 @@ STDMETHODIMP RegMeta::DefineGenericParam( // S_OK or error. LOG((LOGMD, "RegMeta::DefineGenericParam(0x%08x, %d, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n", tkOwner, ulParamSeq, dwParamFlags, szName, reserved, rtkConstraints, pgp)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -1918,7 +1870,6 @@ ErrExit: if(pgp != NULL) *pgp = tkRet; - STOP_MD_PERF(DefineGenericParam); END_ENTRYPOINT_NOTHROW; @@ -1945,7 +1896,6 @@ STDMETHODIMP RegMeta::SetGenericParamProps( // S_OK or error. LOG((LOGMD, "RegMeta::SetGenericParamProps(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n", gp, dwParamFlags,szName,reserved,rtkConstraints)); - START_MD_PERF(); if (reserved != 0) IfFailGo(META_E_BAD_INPUT_PARAMETER); @@ -1966,7 +1916,6 @@ STDMETHODIMP RegMeta::SetGenericParamProps( // S_OK or error. hr = META_E_BAD_INPUT_PARAMETER; ErrExit: - STOP_MD_PERF(SetGenericParamProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -2062,7 +2011,6 @@ STDMETHODIMP RegMeta::GetReferencedTypeSysTables( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::GetReferencedTypeSysTables()\n")); - START_MD_PERF(); ULONG64 refTablesBitVector = 0; ULONG count = 0; @@ -2097,7 +2045,6 @@ STDMETHODIMP RegMeta::GetReferencedTypeSysTables( // S_OK or error. } ErrExit: - STOP_MD_PERF(GetReferencedTypeSysTables); END_ENTRYPOINT_NOTHROW; return hr; @@ -2119,12 +2066,10 @@ STDMETHODIMP RegMeta::DefinePdbStream( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::DefinePdbStream()\n")); - START_MD_PERF(); IfFailGo(m_pStgdb->m_pPdbHeap->SetData(pdbStream)); ErrExit: - STOP_MD_PERF(DefinePdbStream); END_ENTRYPOINT_NOTHROW; return hr; @@ -2160,7 +2105,6 @@ STDMETHODIMP RegMeta::DefineDocument( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::DefineDocument(%s)\n", docName)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -2232,7 +2176,6 @@ ErrExit: if (partsIndexes != NULL) delete[] partsIndexes; - STOP_MD_PERF(DefineDocument); END_ENTRYPOINT_NOTHROW; return hr; @@ -2255,7 +2198,6 @@ STDMETHODIMP RegMeta::DefineSequencePoints( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::DefineSequencePoints()\n")); - START_MD_PERF(); LOCKWRITE(); @@ -2272,7 +2214,6 @@ STDMETHODIMP RegMeta::DefineSequencePoints( // S_OK or error. MethodDebugInformationRec::COL_SequencePoints, pMethodDbgInfo, sequencePtsBlob, sequencePtsBlobSize)); ErrExit: - STOP_MD_PERF(DefineSequencePoints); END_ENTRYPOINT_NOTHROW; return hr; @@ -2298,7 +2239,6 @@ STDMETHODIMP RegMeta::DefineLocalScope( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::DefineLocalScope()\n")); - START_MD_PERF(); LOCKWRITE(); @@ -2318,7 +2258,6 @@ STDMETHODIMP RegMeta::DefineLocalScope( // S_OK or error. m_pStgdb->m_MiniMd.SetSorted(TBL_LocalScope, true); ErrExit: - STOP_MD_PERF(DefineLocalScope); END_ENTRYPOINT_NOTHROW; return hr; @@ -2342,7 +2281,6 @@ STDMETHODIMP RegMeta::DefineLocalVariable( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::DefineLocalVariable(%s)\n", name)); - START_MD_PERF(); LOCKWRITE(); @@ -2359,7 +2297,6 @@ STDMETHODIMP RegMeta::DefineLocalVariable( // S_OK or error. *locVarToken = TokenFromRid(localVariableRecord, mdtLocalVariable); ErrExit: - STOP_MD_PERF(DefineLocalVariable); END_ENTRYPOINT_NOTHROW; return hr; @@ -2389,7 +2326,6 @@ STDMETHODIMP RegMeta::DefineMethodSpec( // S_OK or error LOG((LOGMD, "MD RegMeta::DefineMethodSpec(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", tkImport, pvSigBlob, cbSigBlob, pmi)); - START_MD_PERF(); LOCKWRITE(); // See if this version of the metadata can do Generics @@ -2451,7 +2387,6 @@ STDMETHODIMP RegMeta::DefineMethodSpec( // S_OK or error ErrExit: - STOP_MD_PERF(DefineMethodSpec); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -2475,7 +2410,6 @@ STDMETHODIMP RegMeta::SetMethodProps( // S_OK or error. LOG((LOGMD, "RegMeta::SetMethodProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", md, dwMethodFlags, ulCodeRVA, dwImplFlags)); - START_MD_PERF(); LOCKWRITE(); if (dwMethodFlags != UINT32_MAX) @@ -2489,7 +2423,6 @@ STDMETHODIMP RegMeta::SetMethodProps( // S_OK or error. ErrExit: - STOP_MD_PERF(SetMethodProps); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -2516,7 +2449,6 @@ STDMETHODIMP RegMeta::SetEventProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::SetEventProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", ev, dwEventFlags, tkEventType, mdAddOn, mdRemoveOn, mdFire, rmdOtherMethods)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -2526,7 +2458,6 @@ STDMETHODIMP RegMeta::SetEventProps( // S_OK or error. ErrExit: - STOP_MD_PERF(SetEventProps); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -2552,7 +2483,6 @@ STDMETHODIMP RegMeta::SetPermissionSetProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::SetPermissionSetProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", tk, dwAction, pvPermission, cbPermission, ppm)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -2570,7 +2500,6 @@ STDMETHODIMP RegMeta::SetPermissionSetProps( // S_OK or error. IfFailGo(_SetPermissionSetProps(tkPerm, dwAction, pvPermission, cbPermission)); ErrExit: - STOP_MD_PERF(SetPermissionSetProps); END_ENTRYPOINT_NOTHROW; return hr; #else //!FEATURE_METADATA_EMIT_ALL @@ -2596,7 +2525,6 @@ STDMETHODIMP RegMeta::DefinePinvokeMap( // Return code. LOG((LOGMD, "MD RegMeta::DefinePinvokeMap(0x%08x, 0x%08x, %S, 0x%08x)\n", tk, dwMappingFlags, MDSTR(szImportName), mrImportDLL)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -2605,7 +2533,6 @@ STDMETHODIMP RegMeta::DefinePinvokeMap( // Return code. ErrExit: - STOP_MD_PERF(DefinePinvokeMap); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -2724,7 +2651,6 @@ STDMETHODIMP RegMeta::SetPinvokeMap( // Return code. LOG((LOGMD, "MD RegMeta::SetPinvokeMap(0x%08x, 0x%08x, %S, 0x%08x)\n", tk, dwMappingFlags, MDSTR(szImportName), mrImportDLL)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -2753,7 +2679,6 @@ STDMETHODIMP RegMeta::SetPinvokeMap( // Return code. ErrExit: - STOP_MD_PERF(SetPinvokeMap); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -2774,7 +2699,6 @@ STDMETHODIMP RegMeta::DeletePinvokeMap( // Return code. RID iRecord; LOG((LOGMD, "MD RegMeta::DeletePinvokeMap(0x%08x)\n", tk)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -2817,7 +2741,6 @@ STDMETHODIMP RegMeta::DeletePinvokeMap( // Return code. IfFailGo(UpdateENCLog2(TBL_ImplMap, iRecord)); ErrExit: - STOP_MD_PERF(DeletePinvokeMap); END_ENTRYPOINT_NOTHROW; return hr; #else //!FEATURE_METADATA_EMIT_ALL @@ -2854,7 +2777,6 @@ HRESULT RegMeta::DefineField( // S_OK or error. LOG((LOGMD, "MD: RegMeta::DefineField(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", td, MDSTR(szName), dwFieldFlags, pvSigBlob, cbSigBlob, dwCPlusTypeFlag, pValue, cchValue, pmd)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(pmd); @@ -2940,7 +2862,6 @@ HRESULT RegMeta::DefineField( // S_OK or error. ErrExit: SetCallerExternal(); - STOP_MD_PERF(DefineField); END_ENTRYPOINT_NOTHROW; @@ -2983,7 +2904,6 @@ HRESULT RegMeta::DefineProperty( td, szProperty, dwPropFlags, pvSig, cbSig, dwCPlusTypeFlag, pValue, cchValue, mdSetter, mdGetter, rmdOtherMethods, pmdProp)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -3057,7 +2977,6 @@ HRESULT RegMeta::DefineProperty( ErrExit: SetCallerExternal(); - STOP_MD_PERF(DefineProperty); END_ENTRYPOINT_NOTHROW; @@ -3091,7 +3010,6 @@ HRESULT RegMeta::DefineParam( LOG((LOGMD, "MD RegMeta::DefineParam(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", md, ulParamSeq, MDSTR(szName), dwParamFlags, dwCPlusTypeFlag, pValue, cchValue, ppd)); - START_MD_PERF(); LOCKWRITE(); _ASSERTE(TypeFromToken(md) == mdtMethodDef && md != mdMethodDefNil && @@ -3143,7 +3061,6 @@ ErrExit: END_ENTRYPOINT_NOTHROW; SetCallerExternal(); - STOP_MD_PERF(DefineParam); return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER } // RegMeta::DefineParam @@ -3168,7 +3085,6 @@ HRESULT RegMeta::SetFieldProps( // S_OK or error. LOG((LOGMD, "MD: RegMeta::SetFieldProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", fd, dwFieldFlags, dwCPlusTypeFlag, pValue, cchValue)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -3185,7 +3101,6 @@ HRESULT RegMeta::SetFieldProps( // S_OK or error. ErrExit: - STOP_MD_PERF(SetFieldProps); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -3215,7 +3130,6 @@ HRESULT RegMeta::SetPropertyProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::SetPropertyProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", pr, dwPropFlags, dwCPlusTypeFlag, pValue, cchValue, mdSetter, mdGetter, rmdOtherMethods)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -3224,7 +3138,6 @@ HRESULT RegMeta::SetPropertyProps( // S_OK or error. ErrExit: - STOP_MD_PERF(SetPropertyProps); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER @@ -3251,7 +3164,6 @@ HRESULT RegMeta::SetParamProps( // Return code. LOG((LOGMD, "MD RegMeta::SetParamProps(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", pd, MDSTR(szName), dwParamFlags, dwCPlusTypeFlag, pValue, cchValue)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -3260,7 +3172,6 @@ HRESULT RegMeta::SetParamProps( // Return code. ErrExit: - STOP_MD_PERF(SetParamProps); END_ENTRYPOINT_NOTHROW; return hr; #endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER diff --git a/src/coreclr/md/compiler/import.cpp b/src/coreclr/md/compiler/import.cpp index b50a5b3d42a..a19a1e68499 100644 --- a/src/coreclr/md/compiler/import.cpp +++ b/src/coreclr/md/compiler/import.cpp @@ -19,7 +19,6 @@ #include "corpriv.h" #include "importhelper.h" #include "mdlog.h" -#include "mdperf.h" #include "stgio.h" //***************************************************************************** @@ -49,7 +48,6 @@ STDMETHODIMP RegMeta::EnumMembers( // S_OK, S_FALSE, or error. LOG((LOGMD, "MD RegMeta::EnumMembers(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, cl, rMembers, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); if ( *ppmdEnum == 0 ) @@ -105,7 +103,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumMembers); END_ENTRYPOINT_NOTHROW; @@ -142,7 +139,6 @@ STDMETHODIMP RegMeta::EnumMembersWithName( // S_OK, S_FALSE, or error. LOG((LOGMD, "MD RegMeta::EnumMembersWithName(0x%08x, 0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, cl, MDSTR(szName), rMembers, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); if ( *ppmdEnum == 0 ) @@ -226,7 +222,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumMembersWithName); END_ENTRYPOINT_NOTHROW; return hr; @@ -257,7 +252,6 @@ STDMETHODIMP RegMeta::EnumMethods( - START_MD_PERF(); LOCKREAD(); if ( *ppmdEnum == 0 ) @@ -322,7 +316,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumMethods); END_ENTRYPOINT_NOTHROW; return hr; @@ -362,7 +355,6 @@ STDMETHODIMP RegMeta::EnumMethodsWithName( // S_OK, S_FALSE, or error. - START_MD_PERF(); LOCKREAD(); @@ -426,7 +418,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumMethodsWithName); END_ENTRYPOINT_NOTHROW; return hr; @@ -458,7 +449,6 @@ RegMeta::EnumFields( LOG((LOGMD, "MD RegMeta::EnumFields(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, td, rFields, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); if (*ppmdEnum == NULL) @@ -523,7 +513,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumFields); END_ENTRYPOINT_NOTHROW; return hr; @@ -562,7 +551,6 @@ STDMETHODIMP RegMeta::EnumFieldsWithName( // S_OK, S_FALSE, or error. - START_MD_PERF(); LOCKREAD(); if ( *ppmdEnum == 0 ) @@ -624,7 +612,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumFieldsWithName); END_ENTRYPOINT_NOTHROW; return hr; @@ -653,7 +640,6 @@ STDMETHODIMP RegMeta::EnumParams( // S_OK, S_FALSE, or error. LOG((LOGMD, "MD RegMeta::EnumParams(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, mb, rParams, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); @@ -696,7 +682,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumParams); END_ENTRYPOINT_NOTHROW; return hr; @@ -729,7 +714,6 @@ STDMETHODIMP RegMeta::EnumMemberRefs( // S_OK, S_FALSE, or error. - START_MD_PERF(); LOCKREAD(); if ( *ppmdEnum == 0 ) @@ -772,7 +756,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumMemberRefs); END_ENTRYPOINT_NOTHROW; @@ -806,7 +789,6 @@ STDMETHODIMP RegMeta::EnumMethodImpls( // S_OK, S_FALSE, or error - START_MD_PERF(); LOCKREAD(); HENUMInternal::ZeroEnum(&hEnum); @@ -851,7 +833,6 @@ ErrExit: HENUMInternal::DestroyEnum(pEnum); HENUMInternal::ClearEnum(&hEnum); - STOP_MD_PERF(EnumMethodImpls); END_ENTRYPOINT_NOTHROW; return hr; @@ -887,7 +868,6 @@ STDMETHODIMP RegMeta::EnumPermissionSets( // S_OK, S_FALSE, or error. LOG((LOGMD, "MD RegMeta::EnumPermissionSets(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, tk, dwActions, rPermission, cMax, pcTokens)); - START_MD_PERF(); LOCKREAD(); if ( *ppmdEnum == 0 ) @@ -971,7 +951,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumPermissionSets); END_ENTRYPOINT_NOTHROW; return hr; @@ -996,7 +975,6 @@ STDMETHODIMP RegMeta::FindMember( LOG((LOGMD, "MD RegMeta::FindMember(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n", td, MDSTR(szName), pvSigBlob, cbSigBlob, pmb)); - START_MD_PERF(); // Don't lock this function. All of the functions that it calls are public APIs. keep it that way. @@ -1019,7 +997,6 @@ STDMETHODIMP RegMeta::FindMember( pmb) ); } ErrExit: - STOP_MD_PERF(FindMember); END_ENTRYPOINT_NOTHROW; return hr; @@ -1048,7 +1025,6 @@ STDMETHODIMP RegMeta::FindMethod( LOG((LOGMD, "MD RegMeta::FindMethod(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n", td, MDSTR(szName), pvSigBlob, cbSigBlob, pmb)); - START_MD_PERF(); LOCKREAD(); if (szName == NULL) @@ -1066,7 +1042,6 @@ STDMETHODIMP RegMeta::FindMethod( pmb)); ErrExit: - STOP_MD_PERF(FindMethod); END_ENTRYPOINT_NOTHROW; return hr; @@ -1093,7 +1068,6 @@ RegMeta::FindField( LOG((LOGMD, "MD RegMeta::FindField(0x%08x, %S, 0x%08x, 0x%08x, 0x%08x)\n", td, MDSTR(szName), pvSigBlob, cbSigBlob, pmb)); - START_MD_PERF(); LOCKREAD(); if (szName == NULL) @@ -1113,7 +1087,6 @@ RegMeta::FindField( pmb)); ErrExit: - STOP_MD_PERF(FindField); END_ENTRYPOINT_NOTHROW; return hr; @@ -1144,7 +1117,6 @@ STDMETHODIMP RegMeta::FindMemberRef( - START_MD_PERF(); // @todo: Can this causing building hash table? If so, should this consider the write lock? LOCKREAD(); @@ -1162,7 +1134,6 @@ STDMETHODIMP RegMeta::FindMemberRef( ErrExit: - STOP_MD_PERF(FindMemberRef); END_ENTRYPOINT_NOTHROW; return hr; @@ -1196,7 +1167,6 @@ STDMETHODIMP RegMeta::GetMethodProps( - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mb) == mdtMethodDef); @@ -1245,7 +1215,6 @@ STDMETHODIMP RegMeta::GetMethodProps( } ErrExit: - STOP_MD_PERF(GetMethodProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -1276,7 +1245,6 @@ STDMETHODIMP RegMeta::GetMemberRefProps( // S_OK or error. - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mr) == mdtMemberRef); @@ -1312,7 +1280,6 @@ STDMETHODIMP RegMeta::GetMemberRefProps( // S_OK or error. ErrExit: - STOP_MD_PERF(GetMemberRefProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -1342,7 +1309,6 @@ STDMETHODIMP RegMeta::EnumProperties( // S_OK, S_FALSE, or error. LOG((LOGMD, "MD RegMeta::EnumProperties(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, td, rProperties, cMax, pcProperties)); - START_MD_PERF(); LOCKREAD(); if (IsNilToken(td)) @@ -1422,7 +1388,6 @@ ErrExit: HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumProperties); END_ENTRYPOINT_NOTHROW; return hr; @@ -1453,7 +1418,6 @@ STDMETHODIMP RegMeta::EnumEvents( // S_OK, S_FALSE, or error. LOG((LOGMD, "MD RegMeta::EnumEvents(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, td, rEvents, cMax, pcEvents)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(td) == mdtTypeDef); @@ -1524,7 +1488,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumEvents); END_ENTRYPOINT_NOTHROW; return hr; @@ -1562,7 +1525,6 @@ STDMETHODIMP RegMeta::GetEventProps( // S_OK, S_FALSE, or error. ev, pClass, MDSTR(szEvent), cchEvent, pchEvent, pdwEventFlags, ptkEventType, pmdAddOn, pmdRemoveOn, pmdFire, rmdOtherMethod, cMax, pcOtherMethod)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(ev) == mdtEvent); @@ -1637,7 +1599,6 @@ STDMETHODIMP RegMeta::GetEventProps( // S_OK, S_FALSE, or error. ErrExit: HENUMInternal::ClearEnum(&hEnum); - STOP_MD_PERF(GetEventProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -1667,7 +1628,6 @@ STDMETHODIMP RegMeta::EnumMethodSemantics( // S_OK, S_FALSE, or error. LOG((LOGMD, "MD RegMeta::EnumMethodSemantics(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, mb, rEventProp, cMax, pcEventProp)); - START_MD_PERF(); LOCKREAD(); @@ -1703,7 +1663,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumMethodSemantics); END_ENTRYPOINT_NOTHROW; return hr; @@ -1733,7 +1692,6 @@ STDMETHODIMP RegMeta::GetMethodSemantics( // S_OK, S_FALSE, or error. - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mb) == mdtMethodDef); @@ -1759,7 +1717,6 @@ STDMETHODIMP RegMeta::GetMethodSemantics( // S_OK, S_FALSE, or error. ErrExit: HENUMInternal::ClearEnum(&hEnum); - STOP_MD_PERF(GetMethodSemantics); END_ENTRYPOINT_NOTHROW; return hr; @@ -1792,7 +1749,6 @@ STDMETHODIMP RegMeta::GetClassLayout( LOG((LOGMD, "MD RegMeta::GetClassLayout(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", td, pdwPackSize, rFieldOffset, cMax, pcFieldOffset, pulClassSize)); - START_MD_PERF(); LOCKREAD(); IfFailGo(pMiniMd->FindClassLayoutHelper(td, &ridClassLayout)); @@ -1875,7 +1831,6 @@ STDMETHODIMP RegMeta::GetClassLayout( hr = CLDB_E_RECORD_NOTFOUND; ErrExit: - STOP_MD_PERF(GetClassLayout); END_ENTRYPOINT_NOTHROW; return hr; @@ -1905,7 +1860,6 @@ STDMETHODIMP RegMeta::GetFieldMarshal( LOG((LOGMD, "MD RegMeta::GetFieldMarshal(0x%08x, 0x%08x, 0x%08x)\n", tk, ppvNativeType, pcbNativeType)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(tk) == mdtParamDef || TypeFromToken(tk) == mdtFieldDef); @@ -1922,7 +1876,6 @@ STDMETHODIMP RegMeta::GetFieldMarshal( IfFailGo(pMiniMd->getNativeTypeOfFieldMarshal(pFieldMarshalRec, ppvNativeType, pcbNativeType)); ErrExit: - STOP_MD_PERF(GetFieldMarshal); END_ENTRYPOINT_NOTHROW; return hr; @@ -1948,7 +1901,6 @@ RegMeta::GetRVA( LOG((LOGMD, "MD RegMeta::GetRVA(0x%08x, 0x%08x, 0x%08x)\n", tk, pulCodeRVA, pdwImplFlags)); - START_MD_PERF(); LOCKREAD(); if (TypeFromToken(tk) == mdtMethodDef) @@ -2004,7 +1956,6 @@ RegMeta::GetRVA( } } ErrExit: - STOP_MD_PERF(GetRVA); END_ENTRYPOINT_NOTHROW; return hr; @@ -2031,7 +1982,6 @@ STDMETHODIMP RegMeta::GetPermissionSetProps( CMiniMdRW *pMiniMd = NULL; DeclSecurityRec *pRecord = NULL; - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -2052,7 +2002,6 @@ STDMETHODIMP RegMeta::GetPermissionSetProps( ErrExit: - STOP_MD_PERF(GetPermissionSetProps); END_ENTRYPOINT_NOTHROW; return hr; } // STDMETHODIMP RegMeta::GetPermissionSetProps() @@ -2087,7 +2036,6 @@ STDMETHODIMP RegMeta::GetSigFromToken( // S_OK or error. - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(mdSig) == mdtSignature); @@ -2099,7 +2047,6 @@ STDMETHODIMP RegMeta::GetSigFromToken( // S_OK or error. ErrExit: - STOP_MD_PERF(GetSigFromToken); END_ENTRYPOINT_NOTHROW; return hr; @@ -2126,7 +2073,6 @@ STDMETHODIMP RegMeta::GetModuleRefProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetModuleRefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", mur, szName, cchName, pchName)); - START_MD_PERF(); LOCKREAD(); IfFailGo(pMiniMd->GetModuleRefRecord(RidFromToken(mur), &pModuleRefRec)); @@ -2141,7 +2087,6 @@ STDMETHODIMP RegMeta::GetModuleRefProps( // S_OK or error. ErrExit: - STOP_MD_PERF(GetModuleRefProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -2168,7 +2113,6 @@ STDMETHODIMP RegMeta::EnumModuleRefs( // S_OK or error. LOG((LOGMD, "MD RegMeta::EnumModuleRefs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, rModuleRefs, cMax, pcModuleRefs)); - START_MD_PERF(); LOCKREAD(); if (*ppmdEnum == NULL) @@ -2197,7 +2141,6 @@ STDMETHODIMP RegMeta::EnumModuleRefs( // S_OK or error. ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); - STOP_MD_PERF(EnumModuleRefs); END_ENTRYPOINT_NOTHROW; return hr; @@ -2224,7 +2167,6 @@ STDMETHODIMP RegMeta::GetTypeSpecFromToken( // S_OK or error. - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(typespec) == mdtTypeSpec); @@ -2235,7 +2177,6 @@ STDMETHODIMP RegMeta::GetTypeSpecFromToken( // S_OK or error. ErrExit: - STOP_MD_PERF(GetTypeSpecFromToken); END_ENTRYPOINT_NOTHROW; return hr; } // STDMETHODIMP RegMeta::GetTypeSpecFromToken() @@ -2269,7 +2210,6 @@ STDMETHODIMP RegMeta::GetNameFromToken( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetNameFromToken(0x%08x, 0x%08x)\n", tk, pszUtf8NamePtr)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(pszUtf8NamePtr); @@ -2293,7 +2233,6 @@ STDMETHODIMP RegMeta::GetNameFromToken( // S_OK or error. ErrExit: - STOP_MD_PERF(GetNameFromToken); END_ENTRYPOINT_NOTHROW; @@ -2328,7 +2267,6 @@ STDMETHODIMP RegMeta::EnumUnresolvedMethods( // S_OK or error. LOG((LOGMD, "MD RegMeta::EnumUnresolvedMethods(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, rMethods, cMax, pcTokens)); - START_MD_PERF(); // take the write lock. Because we should have not have two EnumUnresolvedMethods being called at the // same time. Ref to Def map may be calculated incorrectly. @@ -2437,7 +2375,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumUnresolvedMethods); END_ENTRYPOINT_NOTHROW; return hr; @@ -2465,7 +2402,6 @@ STDMETHODIMP RegMeta::GetUserString( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetUserString(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", stk, wszString, cchStringSize, pcchStringSize)); - START_MD_PERF(); LOCKREAD(); // Get the string data. @@ -2512,7 +2448,6 @@ STDMETHODIMP RegMeta::GetUserString( // S_OK or error. } ErrExit: - STOP_MD_PERF(GetUserString); END_ENTRYPOINT_NOTHROW; return hr; } // RegMeta::GetUserString @@ -2538,7 +2473,6 @@ STDMETHODIMP RegMeta::GetPinvokeMap( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetPinvokeMap(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", tk, pdwMappingFlags, szImportName, cchImportName, pchImportName, pmrImportDLL)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(tk) == mdtFieldDef || @@ -2560,7 +2494,6 @@ STDMETHODIMP RegMeta::GetPinvokeMap( // S_OK or error. if (szImportName || pchImportName) IfFailGo(m_pStgdb->m_MiniMd.getImportNameOfImplMap(pRecord, szImportName, cchImportName, pchImportName)); ErrExit: - STOP_MD_PERF(GetPinvokeMap); END_ENTRYPOINT_NOTHROW; return hr; @@ -2585,7 +2518,6 @@ STDMETHODIMP RegMeta::EnumSignatures( // S_OK or error. LOG((LOGMD, "MD RegMeta::EnumSignatures(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, rSignatures, cmax, pcSignatures)); - START_MD_PERF(); LOCKREAD(); if (*ppsigEnum == NULL) @@ -2614,7 +2546,6 @@ STDMETHODIMP RegMeta::EnumSignatures( // S_OK or error. ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppsigEnum); - STOP_MD_PERF(EnumSignatures); END_ENTRYPOINT_NOTHROW; return hr; @@ -2640,7 +2571,6 @@ STDMETHODIMP RegMeta::EnumTypeSpecs( // S_OK or error. LOG((LOGMD, "MD RegMeta::EnumTypeSpecs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, rTypeSpecs, cmax, pcTypeSpecs)); - START_MD_PERF(); LOCKREAD(); if (*ppEnum == NULL) @@ -2669,7 +2599,6 @@ STDMETHODIMP RegMeta::EnumTypeSpecs( // S_OK or error. ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppEnum); - STOP_MD_PERF(EnumTypeSpecs); END_ENTRYPOINT_NOTHROW; return hr; @@ -2695,7 +2624,6 @@ STDMETHODIMP RegMeta::EnumUserStrings( // S_OK or error. LOG((LOGMD, "MD RegMeta::EnumUserStrings(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, rStrings, cmax, pcStrings)); - START_MD_PERF(); LOCKREAD(); if (*ppEnum == NULL) @@ -2748,7 +2676,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumUserStrings); END_ENTRYPOINT_NOTHROW; return hr; @@ -2771,7 +2698,6 @@ STDMETHODIMP RegMeta::GetParamForMethodIndex( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetParamForMethodIndex(0x%08x, 0x%08x, 0x%08x)\n", md, ulParamSeq, ppd)); - START_MD_PERF(); LOCKREAD(); _ASSERTE((TypeFromToken(md) == mdtMethodDef) && (ulParamSeq != UINT32_MAX) && (ppd != NULL)); @@ -2779,7 +2705,6 @@ STDMETHODIMP RegMeta::GetParamForMethodIndex( // S_OK or error. IfFailGo(_FindParamOfMethod(md, ulParamSeq, ppd)); ErrExit: - STOP_MD_PERF(GetParamForMethodIndex); END_ENTRYPOINT_NOTHROW; return hr; @@ -2813,7 +2738,6 @@ HRESULT RegMeta::GetMemberProps( - START_MD_PERF(); _ASSERTE(TypeFromToken(mb) == mdtMethodDef || TypeFromToken(mb) == mdtFieldDef); @@ -2851,7 +2775,6 @@ HRESULT RegMeta::GetMemberProps( pchValue) ); } ErrExit: - STOP_MD_PERF(GetMemberProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -2884,7 +2807,6 @@ HRESULT RegMeta::GetFieldProps( fd, pClass, szField, cchField, pchField, pdwAttr, ppvSigBlob, pcbSigBlob, pdwCPlusTypeFlag, ppValue, pchValue)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(fd) == mdtFieldDef); @@ -2963,7 +2885,6 @@ HRESULT RegMeta::GetFieldProps( } ErrExit: - STOP_MD_PERF(GetFieldProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -3009,7 +2930,6 @@ HRESULT RegMeta::GetPropertyProps( // S_OK, S_FALSE, or error. - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(prop) == mdtProperty); @@ -3132,7 +3052,6 @@ HRESULT RegMeta::GetPropertyProps( // S_OK, S_FALSE, or error. ErrExit: HENUMInternal::ClearEnum(&hEnum); - STOP_MD_PERF(GetPropertyProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -3164,7 +3083,6 @@ HRESULT RegMeta::GetParamProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetParamProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", pd, pmd, pulSequence, szName, cchName, pchName, pdwAttr, pdwCPlusTypeFlag, ppValue, pchValue)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(pd) == mdtParamDef); @@ -3226,7 +3144,6 @@ HRESULT RegMeta::GetParamProps( // S_OK or error. IfFailGo( pMiniMd->getNameOfParam(pParamRec, szName, cchName, pchName) ); ErrExit: - STOP_MD_PERF(GetParamProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -3257,7 +3174,6 @@ HRESULT RegMeta::GetGenericParamProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetGenericParamProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", rd, pulSequence, pdwAttr, ptOwner, reserved, szName, cchName, pchName)); - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -3285,7 +3201,6 @@ HRESULT RegMeta::GetGenericParamProps( // S_OK or error. hr = META_E_BAD_INPUT_PARAMETER; ErrExit: - STOP_MD_PERF(GetGenericParamProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -3310,7 +3225,6 @@ HRESULT RegMeta::GetGenericParamConstraintProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetGenericParamConstraintProps(0x%08x, 0x%08x, 0x%08x)\n", rd, ptGenericParam, ptkConstraintType)); - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -3333,7 +3247,6 @@ HRESULT RegMeta::GetGenericParamConstraintProps( // S_OK or error. hr = META_E_BAD_INPUT_PARAMETER; ErrExit: - STOP_MD_PERF(GetGenericParamConstraintProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -3357,7 +3270,6 @@ HRESULT RegMeta::GetMethodSpecProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetMethodSpecProps(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", mi, tkParent, ppvSigBlob, pcbSigBlob)); - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -3389,7 +3301,6 @@ HRESULT RegMeta::GetMethodSpecProps( // S_OK or error. ErrExit: - STOP_MD_PERF(GetMethodSpecProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -3409,7 +3320,6 @@ HRESULT RegMeta::GetPEKind( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetPEKind(0x%08x, 0x%08x)\n",pdwPEKind,pdwMachine)); - START_MD_PERF(); LOCKREAD(); @@ -3420,7 +3330,6 @@ HRESULT RegMeta::GetPEKind( // S_OK or error. ErrExit: - STOP_MD_PERF(GetPEKind); END_ENTRYPOINT_NOTHROW; return hr; } // HRESULT RegMeta::GetPEKind() @@ -3445,7 +3354,6 @@ HRESULT RegMeta::GetVersionString( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetVersionString(0x%08x, 0x%08x, 0x%08x)\n",pwzBuf,cchBufSize,pchBufSize)); - START_MD_PERF(); LOCKREAD(); if (m_pStgdb->m_pvMd != NULL) @@ -3478,7 +3386,6 @@ HRESULT RegMeta::GetVersionString( // S_OK or error. ErrExit: - STOP_MD_PERF(GetVersionString); END_ENTRYPOINT_NOTHROW; return hr; } // HRESULT RegMeta::GetVersionString() @@ -3502,7 +3409,6 @@ HRESULT RegMeta::GetNestedClassProps( // S_OK or error. LOG((LOGMD, "MD RegMeta::GetNestedClassProps(0x%08x, 0x%08x)\n", tdNestedClass, ptdEnclosingClass)); - START_MD_PERF(); LOCKREAD(); // If not a typedef -- return error. @@ -3527,7 +3433,6 @@ HRESULT RegMeta::GetNestedClassProps( // S_OK or error. *ptdEnclosingClass = pMiniMd->getEnclosingClassOfNestedClass(pRecord); ErrExit: - STOP_MD_PERF(GetNestedClassProps); END_ENTRYPOINT_NOTHROW; return hr; diff --git a/src/coreclr/md/compiler/mdperf.cpp b/src/coreclr/md/compiler/mdperf.cpp deleted file mode 100644 index 016b28d9a4c..00000000000 --- a/src/coreclr/md/compiler/mdperf.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// MDperf.cpp -// - -// -// This file provides Compiler Support functionality in metadata. -//***************************************************************************** - -#include "stdafx.h" - -#include "mdperf.h" - -#ifdef FEATURE_METADATA_PERF_STATS - -//----------------------------------------------------------------------------- -// Global array containing the name of the APIs. This is shared across -// all instances of MDCompilerPerf. -//----------------------------------------------------------------------------- -char g_szNameOfAPI[LAST_MD_API][API_NAME_STR_SIZE]; - -//----------------------------------------------------------------------------- -// Constructor. Initialize counters to 0. Initialize names of MD APIs. -//----------------------------------------------------------------------------- -MDCompilerPerf::MDCompilerPerf() -{ - // Initialize counters - for (int idx=0; idx < LAST_MD_API; idx++) - { - MDPerfStats[idx].dwCalledNumTimes = 0; - MDPerfStats[idx].dwQueryPerfCycles = 0; - } - -#undef MD_FUNC -#define MD_FUNC(MDTag)\ - strncpy(g_szNameOfAPI[MDTag ## _ENUM], #MDTag, API_NAME_STR_SIZE-1); - - MD_COMPILER_PERF_TABLE; // Relies on the MD_FUNC defined above. -} - -MDCompilerPerf::~MDCompilerPerf() - { - // Output the stats and cleanup. - MetaDataPerfReport (); - } - -//----------------------------------------------------------------------------- -// Output stats. TODO: grow this into stats for per fautomation -//----------------------------------------------------------------------------- -void MDCompilerPerf::MetaDataPerfReport () -{ - LARGE_INTEGER freqVal; - DWORD totalCalls=0, totalCycles=0; - - if (!QueryPerformanceFrequency(&freqVal)) - { - printf("Perf counters not supported\n"); - return; - } - - for (int idx=0; idx < LAST_MD_API; idx++) - { - totalCalls += MDPerfStats[idx].dwCalledNumTimes; - totalCycles += MDPerfStats[idx].dwQueryPerfCycles; - } - - if (!(totalCalls && totalCycles && freqVal.QuadPart)) - { - // if any of above is 0 then things don't look good. - printf("No data gathered ...\n"); - return; - } - - printf("\n%-32.32s %-16.16s %-16.16s %-16.16s\n", "API Name", "# Calls", "Cycles", "Time (msec)"); - for (idx=0; idx < LAST_MD_API; idx++) - { - if(MDPerfStats[idx].dwCalledNumTimes != 0) - printf( "%-32.32s %-9d [%3.2d%%] %-16d %-8.2f [%3.2d%%]\n", - g_szNameOfAPI[idx], - MDPerfStats[idx].dwCalledNumTimes, - (MDPerfStats[idx].dwCalledNumTimes*100)/totalCalls, - MDPerfStats[idx].dwQueryPerfCycles, - ((float)MDPerfStats[idx].dwQueryPerfCycles*1000)/(float)freqVal.QuadPart, - (MDPerfStats[idx].dwQueryPerfCycles*100)/totalCycles); - } - printf( "%-32.32s %-9d [100%%] %-16d %-8.2f [100%%]\n\n", - "Total Stats", - totalCalls, - totalCycles, - ((float)totalCycles*1000)/(float)freqVal.QuadPart); - -} - -#endif //FEATURE_METADATA_PERF_STATS diff --git a/src/coreclr/md/compiler/mdperf.h b/src/coreclr/md/compiler/mdperf.h deleted file mode 100644 index b7726b36e32..00000000000 --- a/src/coreclr/md/compiler/mdperf.h +++ /dev/null @@ -1,241 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -//***************************************************************************** -// Mdperf.h -// - -// -//***************************************************************************** - -#ifndef __MDCOMPILERPERF_H__ -#define __MDCOMPILERPERF_H__ - -//#define FEATURE_METADATA_PERF_STATS - -#ifdef FEATURE_METADATA_PERF_STATS - -// Avoid dynamic allocs to display the API names. -#define API_NAME_STR_SIZE 80 - -//----------------------------------------------------------------------------- -// In order to add instrumentation for an API, two changes have to be made. -// One, add the API name in the table below (MD_TABLE). -// Second, add two lines of code (shown below) in the implementation -// of the API itself. e.g. -// RegMeta::MyNewMetataDataAPI(...) -// { -// LOG(...); -// START_MD_PERF(); // <------ add this line as is. -// .... -// // API implementation -// ErrExit: -// STOP_MD_PERF(RegMeta_MyNewMetaDataAPI); // <---------- add this line with the appropriate name -// return (hr); -// ] -// -//----------------------------------------------------------------------------- -#define MD_COMPILER_PERF_TABLE\ - MD_FUNC(SaveToMemory)\ - MD_FUNC(DefineMethod)\ - MD_FUNC(DefineMethodImpl)\ - MD_FUNC(SetRVA)\ - MD_FUNC(DefineTypeRefByName)\ - MD_FUNC(DefineImportType)\ - MD_FUNC(DefineMemberRef)\ - MD_FUNC(DefineImportMember)\ - MD_FUNC(DefineEvent)\ - MD_FUNC(SetClassLayout)\ - MD_FUNC(DeleteClassLayout)\ - MD_FUNC(SetFieldMarshal)\ - MD_FUNC(DeleteFieldMarshal)\ - MD_FUNC(DefinePermissionSet)\ - MD_FUNC(SetMemberIndex)\ - MD_FUNC(GetTokenFromSig)\ - MD_FUNC(DefineModuleRef)\ - MD_FUNC(SetParent)\ - MD_FUNC(GetTokenFromTypeSpec)\ - MD_FUNC(DefineUserString)\ - MD_FUNC(DeleteToken)\ - MD_FUNC(SetTypeDefProps)\ - MD_FUNC(DefineNestedType)\ - MD_FUNC(SetMethodProps)\ - MD_FUNC(SetEventProps)\ - MD_FUNC(SetPermissionSetProps)\ - MD_FUNC(DefinePinvokeMap)\ - MD_FUNC(SetPinvokeMap)\ - MD_FUNC(DeletePinvokeMap)\ - MD_FUNC(DefineField)\ - MD_FUNC(DefineProperty)\ - MD_FUNC(DefineParam)\ - MD_FUNC(SetFieldProps)\ - MD_FUNC(SetPropertyProps)\ - MD_FUNC(SetParamProps)\ - MD_FUNC(EnumMembers)\ - MD_FUNC(EnumMembersWithName)\ - MD_FUNC(EnumMethods)\ - MD_FUNC(EnumMethodsWithName)\ - MD_FUNC(EnumFields)\ - MD_FUNC(EnumFieldsWithName)\ - MD_FUNC(EnumParams)\ - MD_FUNC(EnumMemberRefs)\ - MD_FUNC(EnumMethodImpls)\ - MD_FUNC(EnumPermissionSets)\ - MD_FUNC(FindMember)\ - MD_FUNC(FindMethod)\ - MD_FUNC(FindField)\ - MD_FUNC(FindMemberRef)\ - MD_FUNC(GetMethodProps)\ - MD_FUNC(GetMemberRefProps)\ - MD_FUNC(EnumProperties)\ - MD_FUNC(EnumEvents)\ - MD_FUNC(GetEventProps)\ - MD_FUNC(EnumMethodSemantics)\ - MD_FUNC(GetMethodSemantics)\ - MD_FUNC(GetClassLayout)\ - MD_FUNC(GetFieldMarshal)\ - MD_FUNC(GetRVA)\ - MD_FUNC(GetPermissionSetProps)\ - MD_FUNC(GetSigFromToken)\ - MD_FUNC(GetModuleRefProps)\ - MD_FUNC(EnumModuleRefs)\ - MD_FUNC(GetTypeSpecFromToken)\ - MD_FUNC(GetNameFromToken)\ - MD_FUNC(EnumUnresolvedMethods)\ - MD_FUNC(GetUserString)\ - MD_FUNC(GetPinvokeMap)\ - MD_FUNC(EnumSignatures)\ - MD_FUNC(EnumTypeSpecs)\ - MD_FUNC(EnumUserStrings)\ - MD_FUNC(GetParamForMethodIndex)\ - MD_FUNC(GetMemberProps)\ - MD_FUNC(GetFieldProps)\ - MD_FUNC(GetPropertyProps)\ - MD_FUNC(GetParamProps)\ - MD_FUNC(SetModuleProps)\ - MD_FUNC(Save)\ - MD_FUNC(SaveToStream)\ - MD_FUNC(GetSaveSize)\ - MD_FUNC(Merge)\ - MD_FUNC(DefineCustomAttribute)\ - MD_FUNC(SetCustomAttributeValue)\ - MD_FUNC(DefineSecurityAttributeSet)\ - MD_FUNC(UnmarkAll)\ - MD_FUNC(MarkToken)\ - MD_FUNC(IsTokenMarked)\ - MD_FUNC(DefineTypeDef)\ - MD_FUNC(SetHandler)\ - MD_FUNC(CountEnum)\ - MD_FUNC(ResetEnum)\ - MD_FUNC(EnumTypeDefs)\ - MD_FUNC(EnumInterfaceImpls)\ - MD_FUNC(EnumTypeRefs)\ - MD_FUNC(FindTypeDefByName)\ - MD_FUNC(FindTypeDefByGUID)\ - MD_FUNC(GetScopeProps)\ - MD_FUNC(GetModuleFromScope)\ - MD_FUNC(GetTypeDefProps)\ - MD_FUNC(GetInterfaceImplProps)\ - MD_FUNC(GetCustomAttributeByName)\ - MD_FUNC(GetTypeRefProps)\ - MD_FUNC(ResolveTypeRef)\ - MD_FUNC(EnumCustomAttributes)\ - MD_FUNC(GetCustomAttributeProps)\ - MD_FUNC(FindTypeRef)\ - MD_FUNC(RefToDefOptimization)\ - MD_FUNC(DefineAssembly)\ - MD_FUNC(DefineAssemblyRef)\ - MD_FUNC(DefineFile)\ - MD_FUNC(DefineExportedType)\ - MD_FUNC(DefineManifestResource)\ - MD_FUNC(DefineExecutionLocation)\ - MD_FUNC(SetAssemblyProps)\ - MD_FUNC(SetAssemblyRefProps)\ - MD_FUNC(SetFileProps)\ - MD_FUNC(SetExportedTypeProps)\ - MD_FUNC(GetAssemblyProps)\ - MD_FUNC(GetAssemblyRefProps)\ - MD_FUNC(GetFileProps)\ - MD_FUNC(GetExportedTypeProps)\ - MD_FUNC(GetManifestResourceProps)\ - MD_FUNC(EnumAssemblyRefs)\ - MD_FUNC(EnumFiles)\ - MD_FUNC(EnumExportedTypes)\ - MD_FUNC(EnumManifestResources)\ - MD_FUNC(EnumExecutionLocations)\ - MD_FUNC(GetAssemblyFromScope)\ - MD_FUNC(FindExportedTypeByName)\ - MD_FUNC(FindManifestResourceByName)\ - MD_FUNC(FindAssembliesByName)\ - MD_FUNC(SetGenericPars)\ - MD_FUNC(DefineGenericParam)\ - MD_FUNC(SetGenericParamProps)\ - MD_FUNC(EnumGenericParamConstraints)\ - MD_FUNC(GetGenericParamProps)\ - MD_FUNC(GetGenericParamConstraintProps)\ - MD_FUNC(GetPEKind)\ - MD_FUNC(GetVersionString)\ - MD_FUNC(GetAssemblyUnification) - -//----------------------------------------------------------------------------- -// Create an enum of all the API names. This is the index to access the APIs. -//----------------------------------------------------------------------------- -#undef MD_FUNC -#define MD_FUNC(MDTag)\ - MDTag ## _ENUM, - -typedef enum _MDAPIs -{ - MD_COMPILER_PERF_TABLE - LAST_MD_API -} MDApis; - -//----------------------------------------------------------------------------- -// Declare the struct which contais all the interesting stats for a particular -// API call. -//----------------------------------------------------------------------------- -typedef struct _MDAPIPerfData -{ - DWORD dwQueryPerfCycles; // # of cycles spent in this call - DWORD dwCalledNumTimes; // # of times this API was called -} MDAPIPerfData; - - -//----------------------------------------------------------------------------- -// MDCompilerPerf -//----------------------------------------------------------------------------- -class MDCompilerPerf -{ -public: - MDCompilerPerf(); - ~MDCompilerPerf(); - -private: - MDAPIPerfData MDPerfStats[LAST_MD_API]; - - void MetaDataPerfReport (); -}; - -// Note that this macro declares a local var. -#define START_MD_PERF()\ - LARGE_INTEGER __startVal;\ - QueryPerformanceCounter(&__startVal); - -#undef MD_FUNC -#define MD_FUNC(MDTag)\ - MDTag ## _ENUM - -// Note that this macro uses the local var startVal declared in START_MD_PERF() -#define STOP_MD_PERF(MDTag)\ - LARGE_INTEGER __stopVal;\ - QueryPerformanceCounter(&__stopVal);\ - m_MDCompilerPerf.MDPerfStats[MD_FUNC(MDTag)].dwCalledNumTimes++;\ - m_MDCompilerPerf.MDPerfStats[MD_FUNC(MDTag)].dwQueryPerfCycles += (DWORD)(__stopVal.QuadPart - __startVal.QuadPart); - -#else //!FEATURE_METADATA_PERF_STATS - -#define START_MD_PERF() -#define STOP_MD_PERF(MDTag) - -#endif //!FEATURE_METADATA_PERF_STATS - -#endif // __MDCOMPILERPERF_H__ diff --git a/src/coreclr/md/compiler/regmeta.cpp b/src/coreclr/md/compiler/regmeta.cpp index 25279297573..d4a74bd9c2e 100644 --- a/src/coreclr/md/compiler/regmeta.cpp +++ b/src/coreclr/md/compiler/regmeta.cpp @@ -17,7 +17,6 @@ #include "mdlog.h" #include "importhelper.h" #include "filtermanager.h" -#include "mdperf.h" #include "switches.h" #include "posterror.h" #include "stgio.h" diff --git a/src/coreclr/md/compiler/regmeta.h b/src/coreclr/md/compiler/regmeta.h index 8a2ef8b4386..5a0b1773c54 100644 --- a/src/coreclr/md/compiler/regmeta.h +++ b/src/coreclr/md/compiler/regmeta.h @@ -17,10 +17,7 @@ #include #include "../inc/mdlog.h" #include "utsem.h" - #include "rwutil.h" -#include "mdperf.h" - #include "sigparser.h" class FilterManager; @@ -2037,10 +2034,6 @@ private: LONG m_cRef; // Ref count. IUnknown *m_pFreeThreadedMarshaler; // FreeThreadedMarshaler -#ifdef FEATURE_METADATA_PERF_STATS - MDCompilerPerf m_MDCompilerPerf; // Compiler perf object to store all stats. -#endif - // If true, cached in list of global scopes. This is very dangerous because it may allow // unpredictable state sharing between seemingly unrelated dispensers. bool m_bCached; diff --git a/src/coreclr/md/compiler/regmeta_compilersupport.cpp b/src/coreclr/md/compiler/regmeta_compilersupport.cpp index b2d635530b8..e65d3c37eca 100644 --- a/src/coreclr/md/compiler/regmeta_compilersupport.cpp +++ b/src/coreclr/md/compiler/regmeta_compilersupport.cpp @@ -17,7 +17,6 @@ #include "mdlog.h" #include "importhelper.h" #include "filtermanager.h" -#include "mdperf.h" #include "switches.h" #include "posterror.h" #include "stgio.h" diff --git a/src/coreclr/md/compiler/regmeta_emit.cpp b/src/coreclr/md/compiler/regmeta_emit.cpp index 7fd689df573..1b03550699c 100644 --- a/src/coreclr/md/compiler/regmeta_emit.cpp +++ b/src/coreclr/md/compiler/regmeta_emit.cpp @@ -20,7 +20,6 @@ #include "mdlog.h" #include "importhelper.h" #include "filtermanager.h" -#include "mdperf.h" #include "switches.h" #include "posterror.h" #include "stgio.h" @@ -58,7 +57,6 @@ STDMETHODIMP RegMeta::SetModuleProps( // S_OK or error. LOG((LOGMD, "RegMeta::SetModuleProps(%S)\n", MDSTR(szName))); - START_MD_PERF() LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -77,7 +75,6 @@ STDMETHODIMP RegMeta::SetModuleProps( // S_OK or error. ErrExit: - STOP_MD_PERF(SetModuleProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -95,7 +92,6 @@ STDMETHODIMP RegMeta::Save( // S_OK or error. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::Save(%S, 0x%08x)\n", MDSTR(szFile), dwSaveFlags)); - START_MD_PERF() LOCKWRITE(); // Check reserved param.. @@ -119,7 +115,6 @@ STDMETHODIMP RegMeta::Save( // S_OK or error. ErrExit: - STOP_MD_PERF(Save); END_ENTRYPOINT_NOTHROW; return hr; @@ -139,13 +134,11 @@ STDMETHODIMP RegMeta::SaveToStream( // S_OK or error. LOCKWRITE(); LOG((LOGMD, "RegMeta::SaveToStream(0x%08x, 0x%08x)\n", pIStream, dwSaveFlags)); - START_MD_PERF() IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); hr = _SaveToStream(pIStream, dwSaveFlags); - STOP_MD_PERF(SaveToStream); #if defined(_DEBUG) if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_MD_RegMetaDump)) @@ -200,7 +193,6 @@ STDMETHODIMP RegMeta::SaveToMemory( // S_OK or error. LOG((LOGMD, "MD RegMeta::SaveToMemory(0x%08x, 0x%08x)\n", pbData, cbData)); - START_MD_PERF(); #ifdef _DEBUG ULONG cbActual; // Size of the real data. @@ -219,7 +211,6 @@ STDMETHODIMP RegMeta::SaveToMemory( // S_OK or error. ErrExit: if (pStream) pStream->Release(); - STOP_MD_PERF(SaveToMemory); END_ENTRYPOINT_NOTHROW; return (hr); @@ -239,7 +230,6 @@ STDMETHODIMP RegMeta::GetSaveSize( // S_OK or error. FilterTable *ft = NULL; LOG((LOGMD, "RegMeta::GetSaveSize(0x%08x, 0x%08x)\n", fSave, pdwSaveSize)); - START_MD_PERF(); LOCKWRITE(); ft = m_pStgdb->m_MiniMd.GetFilterTable(); @@ -284,7 +274,6 @@ STDMETHODIMP RegMeta::GetSaveSize( // S_OK or error. hr = m_pStgdb->GetSaveSize(fSave, (UINT32 *)pdwSaveSize, m_ReorderingOptions); ErrExit: - STOP_MD_PERF(GetSaveSize); END_ENTRYPOINT_NOTHROW; @@ -314,7 +303,6 @@ HRESULT RegMeta::UnmarkAll() LOG((LOGMD, "RegMeta::UnmarkAll\n")); - START_MD_PERF(); LOCKWRITE(); #if 0 @@ -429,7 +417,6 @@ HRESULT RegMeta::UnmarkAll() } ErrExit: - STOP_MD_PERF(UnmarkAll); END_ENTRYPOINT_NOTHROW; @@ -475,7 +462,6 @@ STDMETHODIMP RegMeta::MarkToken( // Return code. BEGIN_ENTRYPOINT_NOTHROW; // LOG((LOGMD, "RegMeta::MarkToken(0x%08x)\n", tk)); - START_MD_PERF(); LOCKWRITE(); if (m_pStgdb->m_MiniMd.GetFilterTable() == NULL || m_pFilterManager == NULL) @@ -551,7 +537,6 @@ STDMETHODIMP RegMeta::MarkToken( // Return code. } ErrExit: - STOP_MD_PERF(MarkToken); END_ENTRYPOINT_NOTHROW; return hr; @@ -574,7 +559,6 @@ HRESULT RegMeta::IsTokenMarked( FilterTable *pFilter = NULL; LOG((LOGMD, "RegMeta::IsTokenMarked(0x%08x)\n", tk)); - START_MD_PERF(); LOCKREAD(); pFilter = m_pStgdb->m_MiniMd.GetFilterTable(); @@ -635,7 +619,6 @@ HRESULT RegMeta::IsTokenMarked( } ErrExit: - STOP_MD_PERF(IsTokenMarked); END_ENTRYPOINT_NOTHROW; return hr; @@ -660,7 +643,6 @@ STDMETHODIMP RegMeta::DefineTypeDef( // S_OK or error. LOG((LOGMD, "RegMeta::DefineTypeDef(%S, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", MDSTR(szTypeDef), dwTypeDefFlags, tkExtends, rtkImplements, ptd)); - START_MD_PERF(); LOCKWRITE(); IfFailGo(m_pStgdb->m_MiniMd.PreUpdate()); @@ -670,7 +652,6 @@ STDMETHODIMP RegMeta::DefineTypeDef( // S_OK or error. IfFailGo(_DefineTypeDef(szTypeDef, dwTypeDefFlags, tkExtends, rtkImplements, mdTokenNil, ptd)); ErrExit: - STOP_MD_PERF(DefineTypeDef); END_ENTRYPOINT_NOTHROW; @@ -691,7 +672,6 @@ STDMETHODIMP RegMeta::SetHandler( // S_OK. IMapToken *pIMap = NULL; LOG((LOGMD, "RegMeta::SetHandler(0x%08x)\n", pUnk)); - START_MD_PERF(); LOCKWRITE(); m_pHandler = pUnk; @@ -708,7 +688,6 @@ STDMETHODIMP RegMeta::SetHandler( // S_OK. ErrExit: - STOP_MD_PERF(SetHandler); END_ENTRYPOINT_NOTHROW; return hr; @@ -817,7 +796,6 @@ HRESULT RegMeta::RefToDefOptimization() - START_MD_PERF(); // the Ref to Def map is still up-to-date if (IsMemberDefDirty() == false && IsTypeDefDirty() == false && m_hasOptimizedRefToDef == true) @@ -960,7 +938,6 @@ HRESULT RegMeta::RefToDefOptimization() SetTypeDefDirty(false); m_hasOptimizedRefToDef = true; ErrExit: - STOP_MD_PERF(RefToDefOptimization); return hr; } // RegMeta::RefToDefOptimization diff --git a/src/coreclr/md/compiler/regmeta_import.cpp b/src/coreclr/md/compiler/regmeta_import.cpp index 490097962ee..77f6c4a547d 100644 --- a/src/coreclr/md/compiler/regmeta_import.cpp +++ b/src/coreclr/md/compiler/regmeta_import.cpp @@ -20,7 +20,6 @@ #include "mdlog.h" #include "importhelper.h" #include "filtermanager.h" -#include "mdperf.h" #include "switches.h" #include "posterror.h" #include "stgio.h" @@ -96,7 +95,6 @@ HRESULT CountEnum( // No need to lock this function. LOG((LOGMD, "RegMeta::CountEnum(0x%08x, 0x%08x)\n", hEnum, pulCount)); - START_MD_PERF(); _ASSERTE( pulCount ); @@ -116,7 +114,6 @@ HRESULT CountEnum( else *pulCount = pmdEnum->m_ulCount; ErrExit: - STOP_MD_PERF(CountEnum); return hr; } // ::CountEnum @@ -148,7 +145,6 @@ STDMETHODIMP RegMeta::ResetEnum( // No need to lock this function. LOG((LOGMD, "RegMeta::ResetEnum(0x%08x, 0x%08x)\n", hEnum, ulPos)); - START_MD_PERF(); if (pmdEnum == NULL) goto ErrExit; @@ -156,7 +152,6 @@ STDMETHODIMP RegMeta::ResetEnum( pmdEnum->u.m_ulCur = pmdEnum->u.m_ulStart + ulPos; ErrExit: - STOP_MD_PERF(ResetEnum); END_ENTRYPOINT_NOTHROW; return hr; } // RegMeta::ResetEnum @@ -179,7 +174,6 @@ STDMETHODIMP RegMeta::EnumTypeDefs( LOG((LOGMD, "RegMeta::EnumTypeDefs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, rTypeDefs, cMax, pcTypeDefs)); - START_MD_PERF(); LOCKREAD(); @@ -229,7 +223,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumTypeDefs); END_ENTRYPOINT_NOTHROW; @@ -259,7 +252,6 @@ STDMETHODIMP RegMeta::EnumInterfaceImpls( LOG((LOGMD, "RegMeta::EnumInterfaceImpls(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, td, rImpls, cMax, pcImpls)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(td) == mdtTypeDef); @@ -306,7 +298,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumInterfaceImpls); END_ENTRYPOINT_NOTHROW; @@ -331,7 +322,6 @@ STDMETHODIMP RegMeta::EnumGenericParams(HCORENUM *phEnum, mdToken tkOwner, LOG((LOGMD, "RegMeta::EnumGenericParams(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, tkOwner, rTokens, cMaxTokens, pcTokens)); - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -400,7 +390,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumGenericPars); END_ENTRYPOINT_NOTHROW; return hr; @@ -427,7 +416,6 @@ STDMETHODIMP RegMeta::EnumMethodSpecs( LOG((LOGMD, "RegMeta::EnumMethodSpecs(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, tkOwner, rTokens, cMaxTokens, pcTokens)); - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -504,7 +492,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumMethodSpecs); END_ENTRYPOINT_NOTHROW; return hr; @@ -531,7 +518,6 @@ STDMETHODIMP RegMeta::EnumGenericParamConstraints( LOG((LOGMD, "RegMeta::EnumGenericParamConstraints(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, tkOwner, rTokens, cMaxTokens, pcTokens)); - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -592,7 +578,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); HENUMInternal::DestroyEnum(pEnum); - STOP_MD_PERF(EnumGenericParamConstraints); END_ENTRYPOINT_NOTHROW; return hr; @@ -619,7 +604,6 @@ STDMETHODIMP RegMeta::EnumTypeRefs( LOG((LOGMD, "RegMeta::EnumTypeRefs(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, rTypeRefs, cMax, pcTypeRefs)); - START_MD_PERF(); LOCKREAD(); if ( pEnum == 0 ) @@ -641,7 +625,6 @@ ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); - STOP_MD_PERF(EnumTypeRefs); END_ENTRYPOINT_NOTHROW; return hr; @@ -660,7 +643,6 @@ STDMETHODIMP RegMeta::FindTypeDefByName(// S_OK or error. LOG((LOGMD, "{%08x} RegMeta::FindTypeDefByName(%S, 0x%08x, 0x%08x)\n", this, MDSTR(wzTypeDef), tkEnclosingClass, ptd)); - START_MD_PERF(); LOCKREAD(); @@ -688,7 +670,6 @@ STDMETHODIMP RegMeta::FindTypeDefByName(// S_OK or error. ptd); ErrExit: - STOP_MD_PERF(FindTypeDefByName); END_ENTRYPOINT_NOTHROW; return hr; @@ -713,7 +694,6 @@ STDMETHODIMP RegMeta::GetScopeProps( LOG((LOGMD, "RegMeta::GetScopeProps(%S, 0x%08x, 0x%08x, 0x%08x)\n", MDSTR(szName), cchName, pchName, pmvid)); - START_MD_PERF(); LOCKREAD(); // there is only one module record @@ -728,7 +708,6 @@ STDMETHODIMP RegMeta::GetScopeProps( IfFailGo( pMiniMd->getNameOfModule(pModuleRec, szName, cchName, pchName) ); ErrExit: - STOP_MD_PERF(GetScopeProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -744,7 +723,6 @@ STDMETHODIMP RegMeta::GetModuleFromScope(// S_OK. BEGIN_ENTRYPOINT_NOTHROW; LOG((LOGMD, "RegMeta::GetModuleFromScope(0x%08x)\n", pmd)); - START_MD_PERF(); _ASSERTE(pmd); @@ -752,7 +730,6 @@ STDMETHODIMP RegMeta::GetModuleFromScope(// S_OK. *pmd = TokenFromRid(1, mdtModule); - STOP_MD_PERF(GetModuleFromScope); END_ENTRYPOINT_NOTHROW; return hr; @@ -773,7 +750,6 @@ HRESULT RegMeta::IsGlobal( // S_OK ir error. mdToken tkParent; // Parent of field or method. LOG((LOGMD, "RegMeta::GetTokenForGlobalType(0x%08x, %08x)\n", tk, pbGlobal)); - //START_MD_PERF(); // No need to lock this function. @@ -812,7 +788,6 @@ HRESULT RegMeta::IsGlobal( // S_OK ir error. } ErrExit: - //STOP_MD_PERF(GetModuleFromScope); END_ENTRYPOINT_NOTHROW; return hr; @@ -841,7 +816,6 @@ RegMeta::GetTypeDefProps( LOG((LOGMD, "{%08x} RegMeta::GetTypeDefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", this, td, szTypeDef, cchTypeDef, pchTypeDef, pdwTypeDefFlags, ptkExtends)); - START_MD_PERF(); LOCKREAD(); if (TypeFromToken(td) != mdtTypeDef) @@ -922,7 +896,6 @@ RegMeta::GetTypeDefProps( ErrExit: END_ENTRYPOINT_NOTHROW; - STOP_MD_PERF(GetTypeDefProps); return hr; } // RegMeta::GetTypeDefProps @@ -946,7 +919,6 @@ STDMETHODIMP RegMeta::GetInterfaceImplProps( // S_OK or error. LOG((LOGMD, "RegMeta::GetInterfaceImplProps(0x%08x, 0x%08x, 0x%08x)\n", iiImpl, pClass, ptkIface)); - START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(iiImpl) == mdtInterfaceImpl); @@ -964,7 +936,6 @@ STDMETHODIMP RegMeta::GetInterfaceImplProps( // S_OK or error. } ErrExit: - STOP_MD_PERF(GetInterfaceImplProps); END_ENTRYPOINT_NOTHROW; return hr; @@ -992,7 +963,6 @@ RegMeta::GetTypeRefProps( LOG((LOGMD, "RegMeta::GetTypeRefProps(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", tr, ptkResolutionScope, szTypeRef, cchTypeRef, pchTypeRef)); - START_MD_PERF(); LOCKREAD(); if (TypeFromToken(tr) != mdtTypeRef) @@ -1060,7 +1030,6 @@ RegMeta::GetTypeRefProps( } ErrExit: - STOP_MD_PERF(GetTypeRefProps); END_ENTRYPOINT_NOTHROW; return hr; } // RegMeta::GetTypeRefProps @@ -1088,7 +1057,6 @@ STDMETHODIMP RegMeta::FindTypeRef( // S_OK or error. LOG((LOGMD, "RegMeta::FindTypeRef(0x%8x, %ls, 0x%08x)\n", tkResolutionScope, MDSTR(wzTypeName), ptk)); - START_MD_PERF(); LOCKREAD(); // Convert the name to UTF8. @@ -1103,7 +1071,6 @@ STDMETHODIMP RegMeta::FindTypeRef( // S_OK or error. ptk); ErrExit: - STOP_MD_PERF(FindTypeRef); END_ENTRYPOINT_NOTHROW; return hr; diff --git a/src/coreclr/md/compiler/regmeta_vm.cpp b/src/coreclr/md/compiler/regmeta_vm.cpp index 80746137bfb..0cd3e4ab90d 100644 --- a/src/coreclr/md/compiler/regmeta_vm.cpp +++ b/src/coreclr/md/compiler/regmeta_vm.cpp @@ -19,7 +19,6 @@ #include "mdlog.h" #include "importhelper.h" #include "filtermanager.h" -#include "mdperf.h" #include "switches.h" #include "posterror.h" #include "stgio.h" @@ -166,7 +165,6 @@ RegMeta::ResolveTypeRef( LOG((LOGMD, "{%08x} RegMeta::ResolveTypeRef(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", this, tr, riid, ppIScope, ptd)); - START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); @@ -189,7 +187,6 @@ RegMeta::ResolveTypeRef( *ppIScope = NULL; } - STOP_MD_PERF(ResolveTypeRef); hr = E_INVALIDARG; goto ErrExit; } @@ -198,7 +195,6 @@ RegMeta::ResolveTypeRef( { // Shortcut when we receive a TypeDef token *ptd = tr; - STOP_MD_PERF(ResolveTypeRef); hr = this->QueryInterface(riid, (void **)ppIScope); goto ErrExit; } @@ -233,7 +229,6 @@ RegMeta::ResolveTypeRef( IfFailGo(META_E_CANNOTRESOLVETYPEREF); ErrExit: - STOP_MD_PERF(ResolveTypeRef); END_ENTRYPOINT_NOTHROW; return hr; diff --git a/src/coreclr/nativeaot/Runtime/rhcommon.h b/src/coreclr/nativeaot/Runtime/rhcommon.h deleted file mode 100644 index 434f665aa86..00000000000 --- a/src/coreclr/nativeaot/Runtime/rhcommon.h +++ /dev/null @@ -1,16 +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 file is here because we share some common code with the CLR and that platform uses common.h as a -// precompiled header. Due to limitations on precompilation (a precompiled header must be included first -// and must not be preceded by any other preprocessor directive) we cannot conditionally include common.h, -// so the simplest solution is to maintain this empty header under Redhawk. -// - -// -// For our DAC build, we precompile gcrhenv.h because it is extremely large (~3MB of text). For non-DAC -// builds, we do not do this because the majority of the files have more constrained #includes. -// - -#include "stdint.h" diff --git a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/hpitinterlock.s b/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/hpitinterlock.s deleted file mode 100644 index 97d7c718ba7..00000000000 --- a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/hpitinterlock.s +++ /dev/null @@ -1,167 +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: - - interlock.s - -Abstract: - - Implementation of Interlocked functions (32 and 64 bits) for the HPUX/Itanium - platform. These functions are processor dependent. - See the i386 implementations for more information. - ---*/ - .file "interlock.s" - .section .text, "ax", "progbits" - .align 16 - .global InterlockedExchangeAdd# - .proc InterlockedExchangeAdd# -InterlockedExchangeAdd: - .body - ld4.nt1 r8 = [r32] - ;; -Iea10: - mov ar.ccv = r8 - add r15 = r33, r8 - mov r14 = r8 - ;; - cmpxchg4.acq r8 = [r32], r15, ar.ccv - ;; - cmp.ne p6,p7 = r8, r14 // check if the target changes? -(p6)br.cond.spnt.few Iea10 // if yes, go back to do it again -(p7)br.ret.sptk.clr b0 - ;; - .endp InterlockedExchangeAdd# - - .align 16 - .global InterlockedIncrement# - .proc InterlockedIncrement# -InterlockedIncrement: - .body - fetchadd4.acq r8 = [r32], 1 - ;; - adds r8 = 1, r8 - br.ret.sptk b0 - ;; - .endp InterlockedIncrement# - - .align 16 - .global InterlockedIncrement64# - .proc InterlockedIncrement64# -InterlockedIncrement64: - .body - fetchadd8.acq r8 = [r32], 1 - ;; - adds r8 = 1, r8 - br.ret.sptk b0 - ;; - .endp InterlockedIncrement64# - - .align 16 - .global InterlockedDecrement# - .proc InterlockedDecrement# -InterlockedDecrement: - .body - fetchadd4.acq r8 = [r32], -1 - ;; - adds r8 = -1, r8 - br.ret.sptk b0 - ;; - .endp InterlockedDecrement# - - .align 16 - .global InterlockedDecrement64# - .proc InterlockedDecrement64# -InterlockedDecrement64: - .body - fetchadd8.acq r8 = [r32], -1 - ;; - adds r8 = -1, r8 - br.ret.sptk b0 - ;; - .endp InterlockedDecrement64# - - .align 16 - .global InterlockedExchange# - .proc InterlockedExchange# -InterlockedExchange: - .body - mf - zxt4 r33 = r33 // sanitize the upper 32 bits - ;; - xchg4 r8 = [r32], r33 - br.ret.sptk b0 - ;; - .endp InterlockedExchange# - - .align 16 - .global InterlockedExchange64# - .proc InterlockedExchange64# -InterlockedExchange64: - .body - mf - xchg8 r8 = [r32], r33 - br.ret.sptk b0 - ;; - .endp InterlockedExchange64# - - .align 16 - .global InterlockedCompareExchange# - .proc InterlockedCompareExchange# -InterlockedCompareExchange: - .body - mf - zxt4 r33 = r33 // sanitize the upper 32 bits - zxt4 r34 = r34 // sanitize the upper 32 bits - ;; - mov ar.ccv = r34 - ;; - cmpxchg4.acq r8 = [r32], r33, ar.ccv - br.ret.sptk.clr b0 - ;; - .endp InterlockedCompareExchange# - - .align 16 - .global InterlockedCompareExchange64# - .proc InterlockedCompareExchange64# -InterlockedCompareExchange64: - .body - mf - mov ar.ccv = r34 - ;; - cmpxchg8.acq r8 = [r32], r33, ar.ccv - br.ret.sptk.clr b0 - ;; - .endp InterlockedCompareExchange64# - -/*++ - DBG_DebugBreak is extracted from DbgBreakPoint function - in debugstb.s from win64. ---*/ - BREAKPOINT_STOP = 0x80016 - .align 16 - .global DBG_DebugBreak# - .proc DBG_DebugBreak# -DBG_DebugBreak: - .body - flushrs - ;; - break.i BREAKPOINT_STOP - br.ret.sptk.clr b0 - ;; - .endp DBG_DebugBreak# - - .align 16 - .global MemoryBarrier# - .proc MemoryBarrier# -MemoryBarrier: - .body - mf - br.ret.sptk.clr b0 - ;; - .endp MemoryBarrier# diff --git a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/notes.txt b/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/notes.txt deleted file mode 100644 index 4882c3bd033..00000000000 --- a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/notes.txt +++ /dev/null @@ -1,15 +0,0 @@ -gcc -O2 -finline-functions -D_DEBUG -g -DFULL_CSIMPL -o ./obj/sun4u/critsecttest.o -c critsecttest.cpp -gcc -O2 -finline-functions -D_DEBUG -g -c -o ./obj/sun4u/cs.o cs.cpp -gcc -x assembler-with-cpp -c -Wa,-Av9 -o ./obj/sun4u/sparcinterloc.o sparcinterloc.s -gcc -lpthread -lrt -O2 -finline-functions -D_DEBUG -g -o ./obj/sun4u/critsecttest ./obj/sun4u/critsecttest.o ./obj/sun4u/cs.o ./obj/sun4u/sparcinterloc.o -gcc -O2 -finline-functions -D_DEBUG -g -DCXNG_CSIMPL -o ./obj/sun4u/cxngtest.o -c critsecttest.cpp -gcc -O2 -finline-functions -D_DEBUG -g -c -o ./obj/sun4u/cxng_critsect.o cxng_critsect.cpp -gcc -lpthread -lrt -O2 -finline-functions -D_DEBUG -g -o ./obj/sun4u/cxngtest ./obj/sun4u/cxngtest.o ./obj/sun4u/cxng_critsect.o ./obj/sun4u/sparcinterloc.o -gcc -O2 -finline-functions -D_DEBUG -g -DMTX_CSIMPL -o ./obj/sun4u/mtxtest.o -c critsecttest.cpp -gcc -O2 -finline-functions -D_DEBUG -g -c -o ./obj/sun4u/mtx_critsect.o mtx_critsect.cpp -gcc -lpthread -lrt -O2 -finline-functions -D_DEBUG -g -o ./obj/sun4u/mtxtest ./obj/sun4u/mtxtest.o ./obj/sun4u/mtx_critsect.o ./obj/sun4u/sparcinterloc.o -gcc -O2 -finline-functions -D_DEBUG -g -DRECMTX_CSIMPL -o ./obj/sun4u/recmtxtest.o -c critsecttest.cpp -gcc -O2 -finline-functions -D_DEBUG -g -c -o ./obj/sun4u/recmtx_critsect.o recmtx_critsect.cpp -gcc -lpthread -lrt -O2 -finline-functions -D_DEBUG -g -o ./obj/sun4u/recmtxtest ./obj/sun4u/recmtxtest.o ./obj/sun4u/recmtx_critsect.o ./obj/sun4u/sparcinterloc.o -gcc -O2 -finline-functions -D_DEBUG -g -DINLRECMTX_CSIMPL -o ./obj/sun4u/inlrecmtxtest.o -c critsecttest.cpp -gcc -lpthread -lrt -O2 -finline-functions -D_DEBUG -g -o ./obj/sun4u/inlrecmtxtest ./obj/sun4u/inlrecmtxtest.o ./obj/sun4u/sparcinterloc.o diff --git a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/readme.txt b/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/readme.txt deleted file mode 100644 index a407e9f8b58..00000000000 --- a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/readme.txt +++ /dev/null @@ -1,39 +0,0 @@ -To compile: - -For FReeBSD Platform use the following to compile: -gcc -pthread -lm -lgcc -lstdc++ -xc++ -Di386 pal_composite_native_cs.c - - --------------------------------------------------------- -For Solaris Platform use the following to compile: - gcc -lpthread -lm -lgcc -lstdc++ -xc++ -D__sparc__ -mimpure-text -shared -o critsect.so mtx_critsect.cpp interlock.s -gcc -lpthread -lm -lgcc -lstdc++ -xc++ -D__sparc__ pal_composite_native_cs.c - - -setenv LD_LIBRARY_PATH /usr/lib/lwp:/usr/local/lib:/usr/lib:/opt/sfw/lib:. - gcc -lpthread -lm -lgcc -lstdc++ -lcritsect -xc++ -D__sparc__ pal_composite_native_cs.c - gcc -lpthread -lm -lgcc -lstdc++ -xc++ -D__sparc__ -mimpure-text -shared -o critsect.so mtx_critsect.cpp - -(pts/2):{4}% ldd critsect.so - libpthread.so.1 => /usr/lib/libpthread.so.1 - libm.so.1 => /usr/lib/libm.so.1 - libstdc++.so.2.10.0 => /usr/local/lib/libstdc++.so.2.10.0 - libc.so.1 => /usr/lib/libc.so.1 - libdl.so.1 => /usr/lib/libdl.so.1 - libthread.so.1 => /usr/lib/libthread.so.1 - /usr/platform/SUNW,Serverblade1/lib/libc_psr.so.1 - - --------------------------------------------------------- -For HPUX Platform use the following to compile: -gcc -lpthread -mlp64 -lm -lgcc -lstdc++ -xc++ -D_HPUX_ -D__ia64__ pal_composite_native_cs.c - --------------------------------------------------------- -To execute: -./a.out [PROCESS_COUNT] [THREAD_COUNT] [REPEAT_COUNT] - - - ./a.out 1 32 1000000 4102406 - - - diff --git a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/sparcinterloc.s b/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/sparcinterloc.s deleted file mode 100644 index 20647c77818..00000000000 --- a/src/coreclr/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/sparcinterloc.s +++ /dev/null @@ -1,72 +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: - - interlock.s - -Abstract: - - Implementation of Interlocked functions for the SPARC - platform. These functions are processor dependent. - See the i386 implementations for more information. - - --*/ - - // A handy macro for declaring a public function - // The first argument is the function name. - #define ASMFUNC(n,typename); \ - .align 4 ; \ - .global n ; \ - .type n,typename ; \ -n: ; - - .text - ASMFUNC(InterlockedIncrement,#function) - ld [%o0], %o1 -loopI: - mov %o1, %o2 - add %o1, 1, %o1 - cas [%o0], %o2, %o1 - cmp %o2, %o1 - bne loopI - nop - retl - add %o1, 1, %o0 - - - ASMFUNC(InterlockedDecrement,#function) - ld [%o0], %o1 -loopD: - mov %o1, %o2 - sub %o1, 1, %o1 - cas [%o0], %o2, %o1 - cmp %o2, %o1 - bne loopD - nop - retl - sub %o1, 1, %o0 - - - ASMFUNC(InterlockedExchange,#function) - swap [%o0], %o1 - retl - mov %o1, %o0 - - ASMFUNC(InterlockedCompareExchange,#function) - cas [%o0], %o2, %o1 - retl - mov %o1, %o0 - - ASMFUNC(MemoryBarrier,#function) - // ROTORTODO: SPARC - retl - nop - - ASMFUNC(YieldProcessor,#function) - retl - nop diff --git a/src/mono/dlls/mscordbi/cordb-assembly.cpp b/src/mono/dlls/mscordbi/cordb-assembly.cpp index 16123d1ddd6..79ec72a16c4 100644 --- a/src/mono/dlls/mscordbi/cordb-assembly.cpp +++ b/src/mono/dlls/mscordbi/cordb-assembly.cpp @@ -21,7 +21,6 @@ #include #include "mdlog.h" -#include "mdperf.h" #include "regmeta.h" #include "ex.h" -- GitLab