diff --git a/src/coreclr/nativeaot/Runtime/GCHelpers.cpp b/src/coreclr/nativeaot/Runtime/GCHelpers.cpp index f9eafffdc3744c..2685a33faad092 100644 --- a/src/coreclr/nativeaot/Runtime/GCHelpers.cpp +++ b/src/coreclr/nativeaot/Runtime/GCHelpers.cpp @@ -655,7 +655,7 @@ static Object* GcAllocInternal(MethodTable* pEEType, uint32_t uFlags, uintptr_t // numElements - number of array elements // pTransitionFrame- transition frame to make stack crawlable // Returns a pointer to the object allocated or NULL on failure. -EXTERN_C void* RhpGcAlloc(MethodTable* pEEType, uint32_t uFlags, uintptr_t numElements, PInvokeTransitionFrame* pTransitionFrame) +EXTERN_C void* RhpGcAlloc(MethodTable* pEEType, uint32_t uFlags, intptr_t numElements, PInvokeTransitionFrame* pTransitionFrame) { Thread* pThread = ThreadStore::GetCurrentThread(); diff --git a/src/coreclr/nativeaot/Runtime/portable.cpp b/src/coreclr/nativeaot/Runtime/portable.cpp index d92b7f93597773..46fe1fbb7f7d79 100644 --- a/src/coreclr/nativeaot/Runtime/portable.cpp +++ b/src/coreclr/nativeaot/Runtime/portable.cpp @@ -32,9 +32,9 @@ #include "GCMemoryHelpers.inl" #if defined(FEATURE_PORTABLE_HELPERS) -EXTERN_C void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame); +EXTERN_C void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame); -static Object* AllocateObject(MethodTable* pEEType, uint32_t uFlags, uintptr_t numElements) +static Object* AllocateObject(MethodTable* pEEType, uint32_t uFlags, intptr_t numElements) { Object* pObject = (Object*)RhpGcAlloc(pEEType, uFlags, numElements, nullptr); if (pObject == nullptr) diff --git a/src/coreclr/runtime/amd64/AllocFast.S b/src/coreclr/runtime/amd64/AllocFast.S index 02091bea31083e..fef27e309f0214 100644 --- a/src/coreclr/runtime/amd64/AllocFast.S +++ b/src/coreclr/runtime/amd64/AllocFast.S @@ -87,7 +87,7 @@ NESTED_ENTRY RhpNewObject, _TEXT, NoHandler xor edx, edx // numElements // Call the rest of the allocation helper. - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call C_FUNC(RhpGcAlloc) test rax, rax @@ -273,7 +273,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT, NoHandler // passing pTransitionFrame in rcx // Call the rest of the allocation helper. - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call C_FUNC(RhpGcAlloc) test rax, rax diff --git a/src/coreclr/runtime/amd64/AllocFast.asm b/src/coreclr/runtime/amd64/AllocFast.asm index cda88f3bf8f1ec..1be1d2f2706f75 100644 --- a/src/coreclr/runtime/amd64/AllocFast.asm +++ b/src/coreclr/runtime/amd64/AllocFast.asm @@ -72,7 +72,7 @@ NESTED_ENTRY RhpNewObject, _TEXT xor r8d, r8d ; numElements ;; Call the rest of the allocation helper. - ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call RhpGcAlloc test rax, rax @@ -224,7 +224,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT ; passing pTransitionFrame in r9 ; Call the rest of the allocation helper. - ; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + ; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call RhpGcAlloc test rax, rax diff --git a/src/coreclr/runtime/arm/AllocFast.S b/src/coreclr/runtime/arm/AllocFast.S index e57679edf72fb4..424fce1ceb61ef 100644 --- a/src/coreclr/runtime/arm/AllocFast.S +++ b/src/coreclr/runtime/arm/AllocFast.S @@ -162,7 +162,7 @@ NESTED_ENTRY RhpNewObject, _TEXT, NoHandler mov r2, #0 // numElements - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) blx C_FUNC(RhpGcAlloc) cbz r0, LOCAL_LABEL(NewOutOfMemory) @@ -369,7 +369,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT, NoHandler mov r2, r1 // numElements mov r1, #0 // uFlags - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) blx C_FUNC(RhpGcAlloc) // Test for failure (NULL return). @@ -414,7 +414,7 @@ NESTED_ENTRY RhpNewArrayFastAlign8, _TEXT, NoHandler mov r2, r1 // numElements mov r1, #GC_ALLOC_ALIGN8 // uFlags - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) blx C_FUNC(RhpGcAlloc) // Test for failure (NULL return). diff --git a/src/coreclr/runtime/arm64/AllocFast.S b/src/coreclr/runtime/arm64/AllocFast.S index 33e8c83ae3ef1f..19d5c5a3ebd35e 100644 --- a/src/coreclr/runtime/arm64/AllocFast.S +++ b/src/coreclr/runtime/arm64/AllocFast.S @@ -76,7 +76,7 @@ LOCAL_LABEL(RhpNewFast_RarePath): mov w2, 0 // numElements // Call the rest of the allocation helper. - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) bl C_FUNC(RhpGcAlloc) // Set the new object's MethodTable pointer on success. @@ -258,7 +258,7 @@ LOCAL_LABEL(ArraySizeOverflow): mov x2, x1 // numElements mov x1, #0 // uFlags - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) bl C_FUNC(RhpGcAlloc) // Set the new object's MethodTable pointer and length on success. diff --git a/src/coreclr/runtime/arm64/AllocFast.asm b/src/coreclr/runtime/arm64/AllocFast.asm index ad67eb2107e737..753117f0a499c4 100644 --- a/src/coreclr/runtime/arm64/AllocFast.asm +++ b/src/coreclr/runtime/arm64/AllocFast.asm @@ -75,7 +75,7 @@ RhpNewFast_RarePath mov w2, #0 ; numElements ;; Call the rest of the allocation helper. - ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) bl RhpGcAlloc cbz x0, NewOutOfMemory @@ -229,7 +229,7 @@ ArraySizeOverflow mov x2, x1 ; numElements mov x1, #0 ; uFlags - ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) bl RhpGcAlloc cbz x0, RhpNewVariableSizeObject_OutOfMemory diff --git a/src/coreclr/runtime/i386/AllocFast.S b/src/coreclr/runtime/i386/AllocFast.S index 529a5142bcf2fd..3eec8fb8d0114b 100644 --- a/src/coreclr/runtime/i386/AllocFast.S +++ b/src/coreclr/runtime/i386/AllocFast.S @@ -51,7 +51,7 @@ LEAF_ENTRY RhpNewObject, _TEXT push ecx // Call the rest of the allocation helper. - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call RhpGcAlloc add esp, 16 @@ -249,7 +249,7 @@ NESTED_ENTRY RhpNewVariableSizeObject, _TEXT, NoHandler push 0 // Flags push ecx // MethodTable - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call RhpGcAlloc add esp, 16 diff --git a/src/coreclr/runtime/i386/AllocFast.asm b/src/coreclr/runtime/i386/AllocFast.asm index 7bb4d6ee6544f4..4afd486f05e09b 100644 --- a/src/coreclr/runtime/i386/AllocFast.asm +++ b/src/coreclr/runtime/i386/AllocFast.asm @@ -55,7 +55,7 @@ FASTCALL_FUNC RhpNewObject, 8 push ecx ;; Call the rest of the allocation helper. - ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + ;; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call RhpGcAlloc test eax, eax @@ -241,7 +241,7 @@ FASTCALL_FUNC RhpNewVariableSizeObject, 8 push 0 ; Flags push ecx ; MethodTable - ; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + ; void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call RhpGcAlloc test eax, eax diff --git a/src/coreclr/runtime/loongarch64/AllocFast.S b/src/coreclr/runtime/loongarch64/AllocFast.S index 1a55fa7da9e510..5093e9db1cb64f 100644 --- a/src/coreclr/runtime/loongarch64/AllocFast.S +++ b/src/coreclr/runtime/loongarch64/AllocFast.S @@ -72,7 +72,7 @@ LOCAL_LABEL(RhpNewFast_RarePath): ori $a2, $zero, 0 // numElements // Call the rest of the allocation helper. - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) bl C_FUNC(RhpGcAlloc) // Set the new object's MethodTable pointer on success. @@ -228,7 +228,7 @@ LOCAL_LABEL(ArraySizeOverflow): ori $a2, $a1, 0 // numElements ori $a1, $zero, 0 // uFlags - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) bl C_FUNC(RhpGcAlloc) // Set the new object's MethodTable pointer and length on success. diff --git a/src/coreclr/runtime/riscv64/AllocFast.S b/src/coreclr/runtime/riscv64/AllocFast.S index 5fc3d69987e42f..917b5e81395e2d 100644 --- a/src/coreclr/runtime/riscv64/AllocFast.S +++ b/src/coreclr/runtime/riscv64/AllocFast.S @@ -86,7 +86,7 @@ LOCAL_LABEL(RhpNewFast_RarePath): li a2, 0 // numElements // Call the rest of the allocation helper. - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call C_FUNC(RhpGcAlloc) // Set the new object's MethodTable pointer on success. @@ -262,7 +262,7 @@ LOCAL_LABEL(ArraySizeOverflow): mv a2, a1 // numElements li a1, 0 // uFlags - // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, uintptr_t numElements, void * pTransitionFrame) + // void* RhpGcAlloc(MethodTable *pEEType, uint32_t uFlags, intptr_t numElements, void * pTransitionFrame) call C_FUNC(RhpGcAlloc) // Set the new object's MethodTable pointer and length on success. diff --git a/src/coreclr/vm/gchelpers.cpp b/src/coreclr/vm/gchelpers.cpp index bc451012c3779f..e89fbf45508569 100644 --- a/src/coreclr/vm/gchelpers.cpp +++ b/src/coreclr/vm/gchelpers.cpp @@ -114,7 +114,7 @@ EXTERN_C Object* RhpGcAlloc(MethodTable* pMT, GC_ALLOC_FLAGS uFlags, uintptr_t n return OBJECTREFToObject(newobj); } -EXTERN_C Object* RhpGcAllocMaybeFrozen(MethodTable* pMT, uintptr_t numElements, TransitionBlock* pTransitionBlock) +EXTERN_C Object* RhpGcAllocMaybeFrozen(MethodTable* pMT, intptr_t numElements, TransitionBlock* pTransitionBlock) { OBJECTREF newobj = NULL;