Change GetAppDomain to return AppDomain from the global static (#20910)
authorJan Vorlicek <janvorli@microsoft.com>
Tue, 13 Nov 2018 21:51:20 +0000 (22:51 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Nov 2018 21:51:20 +0000 (22:51 +0100)
commit89262cf66efe776a17c322efcbe896cc3073b446
tree1cee8eb56dcb1982766a0ae04c4ccc75e0d2273b
parente586793e0fbf0fa3d42e4519663ed2d977198a23
Change GetAppDomain to return AppDomain from the global static (#20910)

* Change GetAppDomain to return it from the global static

The current implementation of the GetAppDomain takes it from the TLS for
the current thread. But we only have one AppDomain in the system, so we
can change it to return just that one.
I have still left the ThreadLocalInfo.m_pAppDomain and its setter
present, because SOS uses that to access the AppDomain and the SOS needs
to be runtime versino agnostic.
This makes it to perform better for Unix where accessing TLS is not
trivial.

* Move the AppDomain instance pointer to own static

To enable access to the one and only AppDomain without unnecessary
indirections, I have moved the pointer out of the SystemDomain class.
src/vm/appdomain.cpp
src/vm/appdomain.hpp
src/vm/threads.h
src/vm/threads.inl