Skip to content

Commit ba5fcde

Browse files
committed
fb
1 parent fa85372 commit ba5fcde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+96
-161
lines changed

src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,9 @@ public static Exception GetRuntimeException(ExceptionIDs id)
444444

445445
private enum HwExceptionCode : uint
446446
{
447-
STATUS_NULL_REFERENCE = 0x00000000u,
448-
STATUS_UNMANAGED_HELPER_NULL_REFERENCE = 0x00000042u,
449-
STATUS_THREAD_ABORT = 0x00000043u,
447+
STATUS_NATIVEAOT_NULL_REFERENCE = 0x00000000u,
448+
STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE = 0x00000042u,
449+
STATUS_NATIVEAOT_THREAD_ABORT = 0x00000043u,
450450

451451
STATUS_DATATYPE_MISALIGNMENT = 0x80000002u,
452452
STATUS_ACCESS_VIOLATION = 0xC0000005u,
@@ -574,11 +574,11 @@ public static void RhThrowHwEx(uint exceptionCode, ref ExInfo exInfo)
574574

575575
switch (exceptionCode)
576576
{
577-
case (uint)HwExceptionCode.STATUS_NULL_REFERENCE:
577+
case (uint)HwExceptionCode.STATUS_NATIVEAOT_NULL_REFERENCE:
578578
exceptionId = ExceptionIDs.NullReference;
579579
break;
580580

581-
case (uint)HwExceptionCode.STATUS_UNMANAGED_HELPER_NULL_REFERENCE:
581+
case (uint)HwExceptionCode.STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE:
582582
// The write barrier where the actual fault happened has been unwound already.
583583
// The IP of this fault needs to be treated as return address, not as IP of
584584
// faulting instruction.
@@ -587,7 +587,7 @@ public static void RhThrowHwEx(uint exceptionCode, ref ExInfo exInfo)
587587
break;
588588

589589
#if NATIVEAOT
590-
case (uint)HwExceptionCode.STATUS_THREAD_ABORT:
590+
case (uint)HwExceptionCode.STATUS_NATIVEAOT_THREAD_ABORT:
591591
exceptionToThrow = InternalCalls.RhpGetThreadAbortException();
592592
break;
593593
#endif

src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/TypeCast.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -789,27 +789,12 @@ public static unsafe void StelemRef(object?[] array, nint index, object? obj)
789789
// This is supported only on arrays
790790
Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array");
791791

792-
#if INPLACE_RUNTIME
793792
// This will throw NullReferenceException if obj is null.
794793
if ((nuint)index >= (uint)array.Length)
795794
ThrowIndexOutOfRangeException(array);
796795

797796
Debug.Assert(index >= 0);
798797
ref object? element = ref Unsafe.Add(ref MemoryMarshal.GetArrayDataReference(array), index);
799-
#else
800-
if (array is null)
801-
{
802-
// TODO: If both array and obj are null, we're likely going to throw NativeAOT's NullReferenceException.
803-
// This should blame the caller.
804-
throw obj.GetMethodTable()->GetClasslibException(ExceptionIDs.NullReference);
805-
}
806-
if ((uint)index >= (uint)array.Length)
807-
{
808-
throw array.GetMethodTable()->GetClasslibException(ExceptionIDs.IndexOutOfRange);
809-
}
810-
ref object rawData = ref Unsafe.As<byte, object>(ref Unsafe.As<RawArrayData>(array).Data);
811-
ref object element = ref Unsafe.Add(ref rawData, index);
812-
#endif
813798

814799
MethodTable* elementType = array.GetMethodTable()->RelatedParameterType;
815800

src/coreclr/nativeaot/Runtime/AsmOffsetsVerify.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "gcenv.h"
55
#include "gcheaputilities.h"
66
#include "rhassert.h"
7-
#include "Warnings.h"
87
#include "slist.h"
98
#include "regdisplay.h"
109
#include "StackFrameIterator.h"

src/coreclr/nativeaot/Runtime/CachedInterfaceDispatchPal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
#include "CommonMacros.h"
99
#include "daccess.h"
1010
#include "DebugMacrosExt.h"
11-
#include "PalCommon.h"
11+
#include "PalLimitedContext.h"
1212
#include "Pal.h"
1313
#include "rhassert.h"
1414
#include "slist.h"
1515
#include "holder.h"
1616
#include "Crst.h"
17-
#include "Warnings.h"
1817
#include "TargetPtrs.h"
1918
#include "MethodTable.h"
2019
#include "Range.h"

src/coreclr/nativeaot/Runtime/Crst.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "common.h"
44
#include "CommonTypes.h"
55
#include "CommonMacros.h"
6-
#include "PalCommon.h"
6+
#include "PalLimitedContext.h"
77
#include "Pal.h"
88
#include "holder.h"
99
#include "Crst.h"

src/coreclr/nativeaot/Runtime/DebugHeader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "gcinterface.dac.h"
88
#include "rhassert.h"
99
#include "TargetPtrs.h"
10-
#include "PalCommon.h"
10+
#include "PalLimitedContext.h"
1111
#include "Pal.h"
1212
#include "holder.h"
1313
#include "RuntimeInstance.h"

src/coreclr/nativeaot/Runtime/EHHelpers.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include "GcEnum.h"
1111
#include "shash.h"
1212
#include "TypeManager.h"
13-
#include "PalCommon.h"
13+
#include "PalLimitedContext.h"
1414
#include "Pal.h"
1515
#include "holder.h"
1616
#include "Crst.h"
@@ -357,13 +357,13 @@ int32_t RhpHardwareExceptionHandler(uintptr_t faultCode, uintptr_t faultAddress,
357357
if (pCodeManager != NULL)
358358
{
359359
// Make sure that the OS does not use our internal fault codes
360-
ASSERT(faultCode != STATUS_NULL_REFERENCE && faultCode != STATUS_UNMANAGED_HELPER_NULL_REFERENCE);
360+
ASSERT(faultCode != STATUS_NATIVEAOT_NULL_REFERENCE && faultCode != STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE);
361361

362362
if (faultCode == STATUS_ACCESS_VIOLATION)
363363
{
364364
if (faultAddress < NULL_AREA_SIZE)
365365
{
366-
faultCode = STATUS_NULL_REFERENCE;
366+
faultCode = STATUS_NATIVEAOT_NULL_REFERENCE;
367367
}
368368
}
369369
else if (faultCode == STATUS_STACK_OVERFLOW)
@@ -387,7 +387,7 @@ int32_t RhpHardwareExceptionHandler(uintptr_t faultCode, uintptr_t faultAddress,
387387
{
388388
if (faultAddress < NULL_AREA_SIZE)
389389
{
390-
faultCode = STATUS_UNMANAGED_HELPER_NULL_REFERENCE;
390+
faultCode = STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE;
391391
}
392392

393393
// we were AV-ing in a helper - unwind our way to our caller
@@ -490,13 +490,13 @@ LONG WINAPI RhpVectoredExceptionHandler(PEXCEPTION_POINTERS pExPtrs)
490490
if (pCodeManager != NULL)
491491
{
492492
// Make sure that the OS does not use our internal fault codes
493-
ASSERT(faultCode != STATUS_NULL_REFERENCE && faultCode != STATUS_UNMANAGED_HELPER_NULL_REFERENCE);
493+
ASSERT(faultCode != STATUS_NATIVEAOT_NULL_REFERENCE && faultCode != STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE);
494494

495495
if (faultCode == STATUS_ACCESS_VIOLATION)
496496
{
497497
if (pExPtrs->ExceptionRecord->ExceptionInformation[1] < NULL_AREA_SIZE)
498498
{
499-
faultCode = STATUS_NULL_REFERENCE;
499+
faultCode = STATUS_NATIVEAOT_NULL_REFERENCE;
500500
}
501501
}
502502
else if (faultCode == STATUS_STACK_OVERFLOW)
@@ -525,7 +525,7 @@ LONG WINAPI RhpVectoredExceptionHandler(PEXCEPTION_POINTERS pExPtrs)
525525
{
526526
if (pExPtrs->ExceptionRecord->ExceptionInformation[1] < NULL_AREA_SIZE)
527527
{
528-
faultCode = STATUS_UNMANAGED_HELPER_NULL_REFERENCE;
528+
faultCode = STATUS_NATIVEAOT_UNMANAGED_HELPER_NULL_REFERENCE;
529529
}
530530

531531
// we were AV-ing in a helper - unwind our way to our caller

src/coreclr/nativeaot/Runtime/GCHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "forward_declarations.h"
1616
#include "RhConfig.h"
1717

18-
#include "PalCommon.h"
18+
#include "PalLimitedContext.h"
1919
#include "slist.h"
2020
#include "regdisplay.h"
2121
#include "StackFrameIterator.h"

src/coreclr/nativeaot/Runtime/GCMemoryHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include "common.h"
99
#include "gcenv.h"
10-
#include "PalCommon.h"
10+
#include "PalLimitedContext.h"
1111
#include "CommonMacros.inl"
1212
#include "GCMemoryHelpers.inl"
1313

src/coreclr/nativeaot/Runtime/GcStressControl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "CommonTypes.h"
99
#include "CommonMacros.h"
1010
#include "daccess.h"
11-
#include "PalCommon.h"
11+
#include "PalLimitedContext.h"
1212
#include "Pal.h"
1313
#include "rhassert.h"
1414
#include "holder.h"

0 commit comments

Comments
 (0)