| 852 | } |
| 853 | |
| 854 | bool MAssembly::LoadCorlib() |
| 855 | { |
| 856 | if (IsLoaded()) |
| 857 | return false; |
| 858 | PROFILE_CPU(); |
| 859 | PROFILE_MEM(ScriptingCSharp); |
| 860 | #if TRACY_ENABLE |
| 861 | const StringAnsiView name("Corlib"); |
| 862 | ZoneText(*name, name.Length()); |
| 863 | #endif |
| 864 | |
| 865 | // Ensure to be unloaded |
| 866 | Unload(); |
| 867 | |
| 868 | // Start |
| 869 | Stopwatch stopwatch; |
| 870 | OnLoading(); |
| 871 | |
| 872 | // Load |
| 873 | { |
| 874 | static void* GetAssemblyByNamePtr = GetStaticMethodPointer(TEXT("GetAssemblyByName")); |
| 875 | _handle = CallStaticMethod<void*, const char*>(GetAssemblyByNamePtr, "System.Private.CoreLib"); |
| 876 | GetAssemblyName(_handle, _name, _fullname); |
| 877 | } |
| 878 | if (_handle == nullptr) |
| 879 | { |
| 880 | OnLoadFailed(); |
| 881 | return true; |
| 882 | } |
| 883 | _hasCachedClasses = false; |
| 884 | _canReload = false; |
| 885 | CachedAssemblyHandles.Add(_handle, this); |
| 886 | |
| 887 | // End |
| 888 | OnLoaded(stopwatch); |
| 889 | return false; |
| 890 | } |
| 891 | |
| 892 | bool MAssembly::LoadImage(const String& assemblyPath, const StringView& nativePath) |
| 893 | { |
nothing calls this directly
no test coverage detected