File tree Expand file tree Collapse file tree 6 files changed +50
-1
lines changed Expand file tree Collapse file tree 6 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ set(NF_CoreCLR_SRCS
110110 corlib_native_System_Reflection_Binder.cpp
111111 corlib_native_System_Reflection_MemberInfo.cpp
112112 corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp
113+ corlib_native_System_Runtime_CompilerServices_Unsafe.cpp
113114 corlib_native_System_Runtime_Remoting_RemotingServices.cpp
114115 corlib_native_System_String.cpp
115116 corlib_native_System_Span_1.cpp
Original file line number Diff line number Diff line change 6060 <ClCompile Include =" corlib_native_System_Reflection_RuntimeMethodInfo.cpp" />
6161 <ClCompile Include =" corlib_native_System_RuntimeType.cpp" />
6262 <ClCompile Include =" corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp" />
63+ <ClCompile Include =" corlib_native_System_Runtime_CompilerServices_Unsafe.cpp" />
6364 <ClCompile Include =" corlib_native_System_Runtime_Remoting_RemotingServices.cpp" />
6465 <ClCompile Include =" corlib_native_System_Span_1.cpp" />
6566 <ClCompile Include =" corlib_native_System_String.cpp" />
Original file line number Diff line number Diff line change 179179 <ClCompile Include =" corlib_native_System_ReadOnlySpan_1.cpp" >
180180 <Filter >Source Files</Filter >
181181 </ClCompile >
182+ <ClCompile Include =" corlib_native_System_Runtime_CompilerServices_Unsafe.cpp" >
183+ <Filter >Source Files</Filter >
184+ </ClCompile >
182185 </ItemGroup >
183186</Project >
Original file line number Diff line number Diff line change @@ -278,6 +278,20 @@ static const CLR_RT_MethodHandler method_lookup[] =
278278 nullptr ,
279279 nullptr ,
280280 nullptr ,
281+ nullptr ,
282+ nullptr ,
283+ nullptr ,
284+ nullptr ,
285+ nullptr ,
286+ nullptr ,
287+ nullptr ,
288+ nullptr ,
289+ nullptr ,
290+ nullptr ,
291+ nullptr ,
292+ nullptr ,
293+ nullptr ,
294+ nullptr ,
281295 Library_corlib_native_System_BitConverter::get_IsLittleEndian___STATIC__BOOLEAN,
282296 Library_corlib_native_System_BitConverter::DoubleToInt64Bits___STATIC__I8__R8,
283297 Library_corlib_native_System_BitConverter::GetBytes___STATIC__SZARRAY_U1__BOOLEAN,
@@ -745,6 +759,7 @@ static const CLR_RT_MethodHandler method_lookup[] =
745759 Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers::RunClassConstructor___STATIC__VOID__SystemRuntimeTypeHandle,
746760 Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers::get_OffsetToStringData___STATIC__I4,
747761 Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers::IsReferenceOrContainsReferences___STATIC__BOOLEAN,
762+ Library_corlib_native_System_Runtime_CompilerServices_Unsafe::As___STATIC__GENERICTYPE__OBJECT,
748763 nullptr ,
749764 Library_corlib_native_System_Runtime_Remoting_RemotingServices::IsTransparentProxy___STATIC__BOOLEAN__OBJECT,
750765 nullptr ,
@@ -1573,7 +1588,7 @@ const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_mscorlib =
15731588
15741589#if (NANOCLR_REFLECTION == TRUE)
15751590
1576- 0xCF059C3B ,
1591+ 0x559086F3 ,
15771592
15781593#elif (NANOCLR_REFLECTION == FALSE)
15791594
Original file line number Diff line number Diff line change @@ -889,6 +889,15 @@ struct Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers
889889 bool & isRefContainsRefs );
890890};
891891
892+ #if (NANOCLR_REFLECTION == TRUE )
893+ struct Library_corlib_native_System_Runtime_CompilerServices_Unsafe
894+ {
895+ NANOCLR_NATIVE_DECLARE (As___STATIC__GENERICTYPE__OBJECT );
896+
897+ //--//
898+ };
899+ #endif
900+
892901struct Library_corlib_native_System_Runtime_Remoting_RemotingServices
893902{
894903 NANOCLR_NATIVE_DECLARE (IsTransparentProxy___STATIC__BOOLEAN__OBJECT );
Original file line number Diff line number Diff line change 1+ //
2+ // Copyright (c) .NET Foundation and Contributors
3+ // Portions Copyright (c) Microsoft Corporation. All rights reserved.
4+ // See LICENSE file in the project root for full license information.
5+ //
6+
7+ #include " CorLib.h"
8+
9+ HRESULT Library_corlib_native_System_Runtime_CompilerServices_Unsafe::As___STATIC__GENERICTYPE__OBJECT (
10+ CLR_RT_StackFrame &stack)
11+ {
12+ NANOCLR_HEADER ();
13+
14+ CLR_RT_HeapBlock &arg = stack.Arg0 ();
15+
16+ // Set the argument as the return value (ldarg.0; ret)
17+ stack.PushValueAndAssign (arg);
18+
19+ NANOCLR_NOCLEANUP_NOLABEL ();
20+ }
You can’t perform that action at this time.
0 commit comments