Skip to content

Commit bce11b8

Browse files
committed
Update mscorlib and interpreter sub-modules
***NO_CI***
1 parent 107d708 commit bce11b8

11 files changed

+64
-58
lines changed

native/nf-interpreter/src/CLR/CorLib/corlib_native_System_Reflection_Assembly.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
//
22
// Copyright (c) .NET Foundation and Contributors
33
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
44
// See LICENSE file in the project root for full license information.
@@ -15,7 +15,7 @@ HRESULT Library_corlib_native_System_Reflection_Assembly::get_FullName___STRING(
1515
CLR_RT_Assembly *assm;
1616
char buffer[NANOCLR_MAX_ASSEMBLY_NAME * 2];
1717
const CLR_RECORD_ASSEMBLY *header;
18-
CLR_RT_HeapBlock *hbAsm = stack.Arg0().Dereference();
18+
CLR_RT_HeapBlock *hbAsm = stack.This();
1919

2020
NANOCLR_CHECK_HRESULT(GetTypeDescriptor(*hbAsm, instance));
2121

@@ -53,7 +53,7 @@ HRESULT Library_corlib_native_System_Reflection_Assembly::GetType___SystemType__
5353
CLR_RT_HeapBlock *hbRef;
5454
CLR_RT_HeapBlock *hbObj;
5555
const char *szClass = stack.Arg1().RecoverString();
56-
CLR_RT_HeapBlock *hbAsm = stack.Arg0().Dereference();
56+
CLR_RT_HeapBlock *hbAsm = stack.This();
5757

5858
FAULT_ON_NULL(szClass);
5959
FAULT_ON_NULL(hbAsm);
@@ -80,7 +80,7 @@ HRESULT Library_corlib_native_System_Reflection_Assembly::GetTypes___SZARRAY_Sys
8080
NANOCLR_HEADER();
8181

8282
CLR_RT_Assembly_Instance assm;
83-
CLR_RT_HeapBlock *hbAsm = stack.Arg0().Dereference();
83+
CLR_RT_HeapBlock *hbAsm = stack.This();
8484

8585
NANOCLR_CHECK_HRESULT(GetTypeDescriptor(*hbAsm, assm));
8686

@@ -127,7 +127,7 @@ HRESULT Library_corlib_native_System_Reflection_Assembly::GetVersion___VOID__BYR
127127
else
128128
{
129129
CLR_RT_Assembly_Instance assm;
130-
CLR_RT_HeapBlock *hbAsm = stack.Arg0().Dereference();
130+
CLR_RT_HeapBlock *hbAsm = stack.This();
131131

132132
NANOCLR_CHECK_HRESULT(GetTypeDescriptor(*hbAsm, assm));
133133

@@ -149,7 +149,7 @@ HRESULT Library_corlib_native_System_Reflection_Assembly::GetManifestResourceNam
149149
NANOCLR_HEADER();
150150

151151
CLR_RT_Assembly_Instance assm;
152-
CLR_RT_HeapBlock *hbAsm = stack.Arg0().Dereference();
152+
CLR_RT_HeapBlock *hbAsm = stack.This();
153153

154154
NANOCLR_CHECK_HRESULT(GetTypeDescriptor(*hbAsm, assm));
155155

native/nf-interpreter/src/CLR/CorLib/corlib_native_System_Reflection_FieldInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ HRESULT Library_corlib_native_System_Reflection_FieldInfo::Initialize(
100100
{
101101
NATIVE_PROFILE_CLR_CORE();
102102
NANOCLR_HEADER();
103-
CLR_RT_HeapBlock *hbField = stack.Arg0().Dereference();
103+
CLR_RT_HeapBlock *hbField = stack.This();
104104

105105
if (CLR_RT_ReflectionDef_Index::Convert(*hbField, instFD) == false || instTD.InitializeFromField(instFD) == false)
106106
{
@@ -143,7 +143,7 @@ HRESULT Library_corlib_native_System_Reflection_FieldInfo::GetCustomAttributesNa
143143
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
144144

145145
// get the caller field
146-
callerField = stack.Arg0().Dereference();
146+
callerField = stack.This();
147147

148148
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_RuntimeFieldInfo::GetFieldDescriptor(
149149
stack,

native/nf-interpreter/src/CLR/CorLib/corlib_native_System_Reflection_MethodBase.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
//
1+
//
22
// Copyright (c) .NET Foundation and Contributors
33
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
44
// See LICENSE file in the project root for full license information.
55
//
6+
67
#include "CorLib.h"
78

9+
typedef Library_corlib_native_System_Reflection_ParameterInfo ParameterInfo;
10+
811
HRESULT Library_corlib_native_System_Reflection_MethodBase::get_Name___STRING(CLR_RT_StackFrame &stack)
912
{
1013
NATIVE_PROFILE_CLR_CORE();
1114
NANOCLR_HEADER();
1215

1316
CLR_RT_MethodDef_Instance md;
14-
CLR_RT_HeapBlock *hbMeth = stack.Arg0().Dereference();
17+
CLR_RT_HeapBlock *hbMeth = stack.This();
1518

1619
NANOCLR_CHECK_HRESULT(GetMethodDescriptor(stack, *hbMeth, md));
1720

@@ -27,7 +30,7 @@ HRESULT Library_corlib_native_System_Reflection_MethodBase::get_DeclaringType___
2730

2831
CLR_RT_MethodDef_Instance md;
2932
CLR_RT_TypeDef_Instance cls{};
30-
CLR_RT_HeapBlock *hbMeth = stack.Arg0().Dereference();
33+
CLR_RT_HeapBlock *hbMeth = stack.This();
3134

3235
NANOCLR_CHECK_HRESULT(GetMethodDescriptor(stack, *hbMeth, md));
3336

@@ -110,7 +113,7 @@ HRESULT Library_corlib_native_System_Reflection_MethodBase::Invoke___OBJECT__OBJ
110113
CLR_RT_HeapBlock_Array *pArray = stack.Arg2().DereferenceArray();
111114
CLR_RT_HeapBlock *args = NULL;
112115
int numArgs = 0;
113-
CLR_RT_HeapBlock *hbMeth = stack.Arg0().Dereference();
116+
CLR_RT_HeapBlock *hbMeth = stack.This();
114117

115118
NANOCLR_CHECK_HRESULT(GetMethodDescriptor(stack, *hbMeth, md));
116119

@@ -171,7 +174,7 @@ HRESULT Library_corlib_native_System_Reflection_MethodBase::CheckFlags(
171174

172175
CLR_RT_MethodDef_Instance md;
173176
bool fRes;
174-
CLR_RT_HeapBlock *hbMeth = stack.Arg0().Dereference();
177+
CLR_RT_HeapBlock *hbMeth = stack.This();
175178

176179
NANOCLR_CHECK_HRESULT(GetMethodDescriptor(stack, *hbMeth, md));
177180

@@ -206,9 +209,9 @@ HRESULT Library_corlib_native_System_Reflection_MethodBase::GetParametersNative_
206209

207210
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
208211

209-
CLR_RT_HeapBlock *hbMethodInfo = stack.Arg0().Dereference();
212+
CLR_RT_HeapBlock *hbMethodInfo = stack.This();
210213

211-
idx.m_data = hbMethodInfo[Library_corlib_native_System_Reflection_MethodBase::FIELD___token].NumericByRef().u4;
214+
idx.m_data = hbMethodInfo[FIELD___token].NumericByRef().u4;
212215
inst.InitializeFromIndex(idx);
213216

214217
// 1st pass: get the number of parameters
@@ -247,8 +250,7 @@ HRESULT Library_corlib_native_System_Reflection_MethodBase::GetParametersNative_
247250
hbObj = paramInfoElement->Dereference();
248251

249252
// get reference to the <ParameterInfo> instance
250-
CLR_RT_HeapBlock &paraTypeHB =
251-
hbObj[Library_corlib_native_System_Reflection_ParameterInfo::FIELD___parameterType];
253+
CLR_RT_HeapBlock &paraTypeHB = hbObj[ParameterInfo::FIELD___parameterType];
252254

253255
// create a new instance of the parameter type
254256
NANOCLR_CHECK_HRESULT(

native/nf-interpreter/src/CLR/CorLib/corlib_native_System_Reflection_RuntimeFieldInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeFieldInfo::get_Name___STR
99
{
1010
NATIVE_PROFILE_CLR_CORE();
1111
NANOCLR_HEADER();
12-
CLR_RT_HeapBlock *hbField = stack.Arg0().Dereference();
12+
CLR_RT_HeapBlock *hbField = stack.This();
1313

1414
CLR_RT_FieldDef_Instance fd;
1515
if (GetFieldDescriptor(stack, *hbField, fd) == false)
@@ -28,7 +28,7 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeFieldInfo::get_DeclaringT
2828

2929
CLR_RT_FieldDef_Instance fd;
3030
CLR_RT_TypeDef_Instance cls{};
31-
CLR_RT_HeapBlock *hbField = stack.Arg0().Dereference();
31+
CLR_RT_HeapBlock *hbField = stack.This();
3232

3333
if (GetFieldDescriptor(stack, *hbField, fd) == false)
3434
NANOCLR_SET_AND_LEAVE(CLR_E_NULL_REFERENCE);
@@ -56,7 +56,7 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeFieldInfo::get_FieldType_
5656

5757
CLR_RT_TypeDescriptor desc{};
5858
CLR_RT_FieldDef_Instance fd;
59-
CLR_RT_HeapBlock *hbField = stack.Arg0().Dereference();
59+
CLR_RT_HeapBlock *hbField = stack.This();
6060

6161
if (GetFieldDescriptor(stack, *hbField, fd) == false)
6262
NANOCLR_SET_AND_LEAVE(CLR_E_NULL_REFERENCE);

native/nf-interpreter/src/CLR/CorLib/corlib_native_System_Reflection_RuntimeMethodInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
//
22
// Copyright (c) .NET Foundation and Contributors
33
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
44
// See LICENSE file in the project root for full license information.
@@ -13,7 +13,7 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::get_ReturnTyp
1313
CLR_RT_MethodDef_Instance md;
1414
CLR_RT_SignatureParser parser{};
1515
CLR_RT_TypeDescriptor desc{};
16-
CLR_RT_HeapBlock *hbMeth = stack.Arg0().Dereference();
16+
CLR_RT_HeapBlock *hbMeth = stack.This();
1717

1818
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_MethodBase::GetMethodDescriptor(stack, *hbMeth, md));
1919

@@ -48,7 +48,7 @@ HRESULT Library_corlib_native_System_Reflection_RuntimeMethodInfo::GetCustomAttr
4848
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
4949

5050
// get the caller method
51-
callerMethod = stack.Arg0().Dereference();
51+
callerMethod = stack.This();
5252

5353
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_Reflection_MethodBase::GetMethodDescriptor(
5454
stack,

native/nf-interpreter/src/CLR/CorLib/corlib_native_System_RuntimeType.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
//
22
// Copyright (c) .NET Foundation and Contributors
33
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
44
// See LICENSE file in the project root for full license information.
@@ -11,7 +11,7 @@ HRESULT Library_corlib_native_System_RuntimeType::get_Assembly___SystemReflectio
1111
NANOCLR_HEADER();
1212

1313
CLR_RT_TypeDef_Instance td;
14-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
14+
CLR_RT_HeapBlock *hbType = stack.This();
1515

1616
NANOCLR_CHECK_HRESULT(GetTypeDescriptor(*hbType, td, NULL));
1717

@@ -33,7 +33,7 @@ HRESULT Library_corlib_native_System_RuntimeType::get_Name___STRING(CLR_RT_Stack
3333
{
3434
NATIVE_PROFILE_CLR_CORE();
3535
NANOCLR_HEADER();
36-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
36+
CLR_RT_HeapBlock *hbType = stack.This();
3737

3838
NANOCLR_CHECK_HRESULT(GetName(*hbType, false, stack.PushValueAndClear()));
3939

@@ -44,7 +44,7 @@ HRESULT Library_corlib_native_System_RuntimeType::get_FullName___STRING(CLR_RT_S
4444
{
4545
NATIVE_PROFILE_CLR_CORE();
4646
NANOCLR_HEADER();
47-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
47+
CLR_RT_HeapBlock *hbType = stack.This();
4848

4949
NANOCLR_CHECK_HRESULT(GetName(*hbType, true, stack.PushValueAndClear()));
5050

@@ -59,7 +59,7 @@ HRESULT Library_corlib_native_System_RuntimeType::get_BaseType___SystemType(CLR_
5959
CLR_RT_TypeDef_Instance td;
6060
CLR_UINT32 levels;
6161
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
62-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
62+
CLR_RT_HeapBlock *hbType = stack.This();
6363

6464
NANOCLR_CHECK_HRESULT(GetTypeDescriptor(*hbType, td, &levels));
6565

@@ -116,7 +116,7 @@ HRESULT Library_corlib_native_System_RuntimeType::GetInterfaces___SZARRAY_System
116116
CLR_RT_TypeDef_Instance td;
117117
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
118118
CLR_RT_HeapBlock *ptr = NULL;
119-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
119+
CLR_RT_HeapBlock *hbType = stack.This();
120120
int count = 0;
121121

122122
// 2-pass algorithm. 1. count the interfaces; 2. store the interfaces in an array
@@ -186,7 +186,7 @@ HRESULT Library_corlib_native_System_RuntimeType::GetElementType___SystemType(CL
186186
CLR_RT_TypeDescriptor desc{};
187187
CLR_RT_TypeDescriptor descSub;
188188
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
189-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
189+
CLR_RT_HeapBlock *hbType = stack.This();
190190

191191
NANOCLR_CHECK_HRESULT(desc.InitializeFromReflection(hbType->ReflectionDataConst()));
192192

@@ -272,7 +272,7 @@ HRESULT Library_corlib_native_System_RuntimeType::GetCustomAttributesNative___SZ
272272
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
273273

274274
// get the caller type
275-
callerType = stack.Arg0().Dereference();
275+
callerType = stack.This();
276276

277277
NANOCLR_CHECK_HRESULT(GetTypeDescriptor(*callerType, typeDefinition));
278278

native/nf-interpreter/src/CLR/CorLib/corlib_native_System_Type.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
//
1+
//
22
// Copyright (c) .NET Foundation and Contributors
33
// Portions Copyright (c) Microsoft Corporation. All rights reserved.
44
// See LICENSE file in the project root for full license information.
55
//
6+
67
#include "CorLib.h"
78

9+
typedef Library_corlib_native_System_Reflection_MethodBase MethodBase;
10+
811
HRESULT Library_corlib_native_System_Type::get_DeclaringType___SystemType(CLR_RT_StackFrame &stack)
912
{
1013
NATIVE_PROFILE_CLR_CORE();
1114
NANOCLR_HEADER();
1215

1316
CLR_RT_TypeDef_Instance td;
1417
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
15-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
18+
CLR_RT_HeapBlock *hbType = stack.This();
1619

1720
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_RuntimeType::GetTypeDescriptor(*hbType, td));
1821

@@ -50,7 +53,7 @@ HRESULT Library_corlib_native_System_Type::IsInstanceOfType___BOOLEAN__OBJECT(CL
5053

5154
CLR_RT_TypeDescriptor descTarget;
5255
CLR_RT_TypeDescriptor desc{};
53-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
56+
CLR_RT_HeapBlock *hbType = stack.This();
5457

5558
if (hbType->DataType() != DATATYPE_REFLECTION)
5659
NANOCLR_SET_AND_LEAVE(CLR_E_WRONG_TYPE);
@@ -248,7 +251,7 @@ HRESULT Library_corlib_native_System_Type::get_IsArray___BOOLEAN(CLR_RT_StackFra
248251
NANOCLR_HEADER();
249252

250253
CLR_RT_TypeDef_Instance td;
251-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
254+
CLR_RT_HeapBlock *hbType = stack.This();
252255

253256
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_RuntimeType::GetTypeDescriptor(*hbType, td));
254257

@@ -367,7 +370,7 @@ HRESULT Library_corlib_native_System_Type::CheckFlags(CLR_RT_StackFrame &stack,
367370

368371
CLR_RT_TypeDef_Instance td;
369372
bool fRes;
370-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
373+
CLR_RT_HeapBlock *hbType = stack.This();
371374

372375
NANOCLR_CHECK_HRESULT(Library_corlib_native_System_RuntimeType::GetTypeDescriptor(*hbType, td));
373376

@@ -405,7 +408,7 @@ HRESULT Library_corlib_native_System_Type::GetFields(
405408
CLR_RT_TypeDef_Instance td;
406409
CLR_RT_TypeDef_Instance tdArg;
407410
int iField;
408-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
411+
CLR_RT_HeapBlock *hbType = stack.This();
409412

410413
if (bindingFlags == c_BindingFlags_Default)
411414
bindingFlags = c_BindingFlags_DefaultLookup;
@@ -535,7 +538,7 @@ HRESULT Library_corlib_native_System_Type::GetMethods(
535538
CLR_RT_TypeDef_Instance tdArg;
536539
int iMethod;
537540
CLR_RT_HeapBlock &top = stack.PushValueAndClear();
538-
CLR_RT_HeapBlock *hbType = stack.Arg0().Dereference();
541+
CLR_RT_HeapBlock *hbType = stack.This();
539542
bool staticInstanceOnly = false;
540543

541544
if (bindingFlags == c_BindingFlags_Default)
@@ -671,8 +674,7 @@ HRESULT Library_corlib_native_System_Type::GetMethods(
671674
NANOCLR_CHECK_HRESULT(hbObj->SetReflection(idx));
672675

673676
// store token for type
674-
hbObj[Library_corlib_native_System_Reflection_MethodBase::FIELD___token].NumericByRef().u4 =
675-
idx.m_data;
677+
hbObj[MethodBase::FIELD___token].NumericByRef().u4 = idx.m_data;
676678
}
677679

678680
iMethod++;
@@ -765,8 +767,7 @@ HRESULT Library_corlib_native_System_Type::GetMethods(
765767
hbObj->SetReflection(inst);
766768

767769
// store token for type
768-
hbObj[Library_corlib_native_System_Reflection_MethodBase::FIELD___token].NumericByRef().u4 =
769-
inst.m_data;
770+
hbObj[MethodBase::FIELD___token].NumericByRef().u4 = inst.m_data;
770771
}
771772
}
772773

native/nf-interpreter/targets/ChibiOS/_common/Target_System_IO_FileSystem.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <hal.h>
77
#include <cmsis_os.h>
8-
#include <ff.h>
98
#include <target_storage_config.h>
109
#include <nanoHAL_System_IO_FileSystem.h>
1110
#include <Target_System_IO_FileSystem.h>

native/nf-interpreter/targets/ESP32/_nanoCLR/nanoFramework.Hardware.Esp32.Rmt/nanoFramework_hardware_esp32_rmt_native.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static const CLR_RT_MethodHandler method_lookup[] =
4848
NULL,
4949
NULL,
5050
NULL,
51+
NULL,
5152
Library_nanoFramework_hardware_esp32_rmt_native_nanoFramework_Hardware_Esp32_Rmt_ReceiverChannel::NativeRxInit___I4,
5253
Library_nanoFramework_hardware_esp32_rmt_native_nanoFramework_Hardware_Esp32_Rmt_ReceiverChannel::NativeRxStart___VOID__BOOLEAN,
5354
Library_nanoFramework_hardware_esp32_rmt_native_nanoFramework_Hardware_Esp32_Rmt_ReceiverChannel::NativeRxStop___VOID,
@@ -138,14 +139,17 @@ static const CLR_RT_MethodHandler method_lookup[] =
138139
Library_nanoFramework_hardware_esp32_rmt_native_nanoFramework_Hardware_Esp32_Rmt_TransmitterChannel::NativeTxSetIdleLevel___VOID__BOOLEAN,
139140
Library_nanoFramework_hardware_esp32_rmt_native_nanoFramework_Hardware_Esp32_Rmt_TransmitterChannel::NativeTxWriteItems___U4__SZARRAY_U1__BOOLEAN,
140141
Library_nanoFramework_hardware_esp32_rmt_native_nanoFramework_Hardware_Esp32_Rmt_TransmitterChannel::NativeTxDispose___VOID,
142+
NULL,
143+
NULL,
144+
NULL,
141145
};
142146

143147
const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Hardware_Esp32_Rmt =
144148
{
145149
"nanoFramework.Hardware.Esp32.Rmt",
146-
0xB97BFDE3,
150+
0x8ADAC728,
147151
method_lookup,
148-
{ 100, 0, 5, 0 }
152+
{ 100, 0, 5, 1 }
149153
};
150154

151155
// clang-format on

0 commit comments

Comments
 (0)