Skip to content

Commit fb9b90f

Browse files
committed
Update nf-interpreter to @bd0ee3cd972103b3669054d27e8ada4070938e5b
***NO_CI***
1 parent 89c1409 commit fb9b90f

16 files changed

+135
-41
lines changed

native/nf-interpreter/CMake/Modules/FindChibiOS_F0_HAL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ list(APPEND ChibiOSnfOverlay_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-ove
7070
list(APPEND ChibiOSnfOverlay_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
7171

7272
##########################################################################################################################
73-
# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
73+
# Add above ALL the source code file(s) low level driver specific for a series required for a new nanoFramework
7474
# overlay component that you are adding following the template below.
7575
#
7676
# list(APPEND CHIBIOS_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/src/<path-here>)

native/nf-interpreter/CMake/Modules/FindChibiOS_F4_HAL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/
8989
list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/QSPIv1/qspi_lld.c)
9090

9191
##########################################################################################################################
92-
# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
92+
# Add above ALL the source code file(s) low level driver specific for a series required for a new nanoFramework
9393
# overlay component that you are adding following the template below.
9494
#
9595
# list(APPEND CHIBIOS_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/src/<path-here>)

native/nf-interpreter/CMake/Modules/FindChibiOS_H7_HAL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/
8686
list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
8787

8888
##########################################################################################################################
89-
# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
89+
# Add above ALL the source code file(s) low level driver specific for a series required for a new nanoFramework
9090
# overlay component that you are adding following the template below.
9191
#
9292
# list(APPEND CHIBIOS_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/src/<path-here>)

native/nf-interpreter/CMake/Modules/FindChibiOS_L0_HAL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/
7474
list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/ONEWIREv1/onewire_lld.c)
7575

7676
##########################################################################################################################
77-
# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
77+
# Add above ALL the source code file(s) low level driver specific for a series required for a new nanoFramework
7878
# overlay component that you are adding following the template below.
7979
#
8080
# list(APPEND CHIBIOS_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/src/<path-here>)

native/nf-interpreter/CMake/Modules/FindChibiOS_L4_HAL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/
7676
list(APPEND CHIBIOS_HAL_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/ports/STM32/LLD/RNGv1/rng_lld.c)
7777

7878
##########################################################################################################################
79-
# Add above ALL the source code file(s) low level driver specif for a series required for a new nanoFramework
79+
# Add above ALL the source code file(s) low level driver specific for a series required for a new nanoFramework
8080
# overlay component that you are adding following the template below.
8181
#
8282
# list(APPEND CHIBIOS_SOURCES ${CMAKE_SOURCE_DIR}/targets/ChibiOS/_nf-overlay/os/hal/src/<path-here>)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ HRESULT Library_corlib_native_System_Exception::CreateInstance(
124124
if (FAILED(hr = g_CLR_RT_ExecutionEngine.NewObjectFromIndex(ref, cls)))
125125
{
126126
#if defined(NANOCLR_APPDOMAINS)
127-
ref.SetObjectReference(&g_CLR_RT_ExecutionEngine.GetCurrentAppDomain()->m_outOfMemoryException);
127+
ref.SetObjectReference(g_CLR_RT_ExecutionEngine.GetCurrentAppDomain()->m_outOfMemoryException);
128128
#else
129-
ref.SetObjectReference(&g_CLR_RT_ExecutionEngine.m_outOfMemoryException);
129+
ref.SetObjectReference(g_CLR_RT_ExecutionEngine.m_outOfMemoryException);
130130
#endif
131131

132132
hrIn = CLR_E_OUT_OF_MEMORY;

native/nf-interpreter/src/CLR/Core/Execution.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ HRESULT CLR_RT_ExecutionEngine::ExecutionEngine_Initialize()
9191
// CLR_RT_Thread* m_cctorThread;
9292
//
9393
#if !defined(NANOCLR_APPDOMAINS)
94-
m_globalLock = NULL; // CLR_RT_HeapBlock* m_globalLock;
95-
#endif //
94+
m_globalLock = NULL; // CLR_RT_HeapBlock* m_globalLock;
95+
m_outOfMemoryException = NULL; // CLR_RT_HeapBlock* m_outOfMemoryException;
96+
#endif
9697

9798
m_currentUICulture = NULL; // CLR_RT_HeapBlock* m_currentUICulture;
9899

@@ -449,6 +450,7 @@ void CLR_RT_ExecutionEngine::Relocate()
449450

450451
#if !defined(NANOCLR_APPDOMAINS)
451452
CLR_RT_GarbageCollector::Heap_Relocate((void **)&m_globalLock);
453+
CLR_RT_GarbageCollector::Heap_Relocate((void **)&m_outOfMemoryException);
452454
#endif
453455

454456
CLR_RT_GarbageCollector::Heap_Relocate((void **)&m_currentUICulture);

native/nf-interpreter/src/CLR/Core/GarbageCollector.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ void CLR_RT_GarbageCollector::Mark()
409409

410410
#if !defined(NANOCLR_APPDOMAINS)
411411
CheckSingleBlock_Force(g_CLR_RT_ExecutionEngine.m_globalLock);
412+
CheckSingleBlock_Force(g_CLR_RT_ExecutionEngine.m_outOfMemoryException);
412413
#endif
413414

414415
CheckSingleBlock_Force(g_CLR_RT_ExecutionEngine.m_currentUICulture);
@@ -686,6 +687,7 @@ void CLR_RT_GarbageCollector::AppDomain_Mark()
686687

687688
CheckSingleBlock_Force(appDomain->m_globalLock);
688689
CheckSingleBlock_Force(appDomain->m_strName);
690+
CheckSingleBlock_Force(appDomain->m_outOfMemoryException);
689691
}
690692
NANOCLR_FOREACH_NODE_END();
691693
}

native/nf-interpreter/src/CLR/Core/GarbageCollector_Compaction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,10 @@ void CLR_RT_GarbageCollector::Heap_Relocate(void **ref)
582582
{
583583
destinationAddress = (void *)(dst + relocCurrent.m_offset);
584584

585+
#if defined(NANOCLR_PROFILE_NEW_ALLOCATIONS)
586+
g_CLR_PRF_Profiler.TrackObjectRelocation(*ref, destinationAddress);
587+
#endif
588+
585589
*ref = destinationAddress;
586590

587591
return;

native/nf-interpreter/src/CLR/Core/TypeSystem.cpp

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,7 @@ void CLR_RT_AppDomain::AppDomain_Initialize()
22462246
m_id = g_CLR_RT_ExecutionEngine.m_appDomainIdNext++;
22472247
m_globalLock = NULL;
22482248
m_strName = NULL;
2249+
m_outOfMemoryException = NULL;
22492250
m_appDomainAssemblyLastAccess = NULL;
22502251
}
22512252

@@ -2300,12 +2301,17 @@ HRESULT CLR_RT_AppDomain::LoadAssembly(CLR_RT_Assembly *assm)
23002301

23012302
// Preemptively allocate an out of memory exception.
23022303
// We can never get into a case where an out of memory exception cannot be thrown.
2304+
if (m_outOfMemoryException == NULL)
2305+
{
2306+
_ASSERTE(!strcmp(assm->m_szName, "mscorlib")); // always the first assembly to be loaded
23032307

2304-
_ASSERTE(!strcmp(assm->m_szName, "mscorlib")); // always the first assembly to be loaded
2308+
CLR_RT_HeapBlock exception;
23052309

2306-
NANOCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex(
2307-
m_outOfMemoryException,
2308-
g_CLR_RT_WellKnownTypes.m_OutOfMemoryException));
2310+
NANOCLR_CHECK_HRESULT(
2311+
g_CLR_RT_ExecutionEngine.NewObjectFromIndex(exception, g_CLR_RT_WellKnownTypes.m_OutOfMemoryException));
2312+
2313+
m_outOfMemoryException = exception.Dereference();
2314+
}
23092315

23102316
NANOCLR_CLEANUP();
23112317

@@ -2399,6 +2405,7 @@ void CLR_RT_AppDomain::Relocate()
23992405
NATIVE_PROFILE_CLR_CORE();
24002406
CLR_RT_GarbageCollector::Heap_Relocate((void **)&m_globalLock);
24012407
CLR_RT_GarbageCollector::Heap_Relocate((void **)&m_strName);
2408+
CLR_RT_GarbageCollector::Heap_Relocate((void **)&m_outOfMemoryException);
24022409
}
24032410

24042411
HRESULT CLR_RT_AppDomain::VerifyTypeIsLoaded(const CLR_RT_TypeDef_Index &idx)
@@ -4112,9 +4119,16 @@ HRESULT CLR_RT_TypeSystem::PrepareForExecution()
41124119

41134120
// Preemptively create an out of memory exception.
41144121
// We can never get into a case where an out of memory exception cannot be thrown.
4115-
NANOCLR_CHECK_HRESULT(g_CLR_RT_ExecutionEngine.NewObjectFromIndex(
4116-
g_CLR_RT_ExecutionEngine.m_outOfMemoryException,
4117-
g_CLR_RT_WellKnownTypes.m_OutOfMemoryException));
4122+
4123+
if (g_CLR_RT_ExecutionEngine.m_outOfMemoryException == NULL)
4124+
{
4125+
CLR_RT_HeapBlock exception;
4126+
4127+
NANOCLR_CHECK_HRESULT(
4128+
g_CLR_RT_ExecutionEngine.NewObjectFromIndex(exception, g_CLR_RT_WellKnownTypes.m_OutOfMemoryException));
4129+
4130+
g_CLR_RT_ExecutionEngine.m_outOfMemoryException = exception.Dereference();
4131+
}
41184132
#endif
41194133

41204134
// Load Runtime.Events to setup EventSink for other assemblies using it

0 commit comments

Comments
 (0)