diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-06-01 03:41:11 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-06-01 03:41:11 +0300 |
commit | f8c15e4921eacb4c8f96ecea1c02c907a0418745 (patch) | |
tree | 1167cd4a3e32baf9097be762e234f1a9634ec549 /src/Native/Runtime/portable.cpp | |
parent | d34aaaaf70dc1a2d13b5f9f2b8e8a84b53fceb34 (diff) |
Reduce assembly code in alloc helpers
- Use extern "C" names for methods called from asm helper to avoid dealing with name mangling for ports
- Move hooking up of the PInvoke tunnel to C++
- Change arm assembly code to follow same naming pattern as x86 and arm64
[tfs-changeset: 1609408]
Diffstat (limited to 'src/Native/Runtime/portable.cpp')
-rw-r--r-- | src/Native/Runtime/portable.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Native/Runtime/portable.cpp b/src/Native/Runtime/portable.cpp index 3fb9bf8cf..ef6ef0340 100644 --- a/src/Native/Runtime/portable.cpp +++ b/src/Native/Runtime/portable.cpp @@ -35,6 +35,7 @@ #include "GCMemoryHelpers.h" #include "GCMemoryHelpers.inl" +EXTERN_C REDHAWK_API void* REDHAWK_CALLCONV RhpGcAlloc(EEType *pEEType, UInt32 uFlags, UIntNative cbSize, void * pTransitionFrame); EXTERN_C REDHAWK_API void* REDHAWK_CALLCONV RhpPublishObject(void* pObject, UIntNative cbSize); #if defined(FEATURE_SVR_GC) @@ -96,7 +97,7 @@ COOP_PINVOKE_HELPER(Object *, RhpNewFast, (EEType* pEEType)) return pObject; } - pObject = (Object *)RedhawkGCInterface::Alloc(pCurThread, size, 0, pEEType); + pObject = (Object *)RhpGcAlloc(pEEType, 0, size, NULL); if (pObject == nullptr) { ASSERT_UNCONDITIONALLY("NYI"); // TODO: Throw OOM @@ -116,12 +117,9 @@ COOP_PINVOKE_HELPER(Object *, RhpNewFinalizable, (EEType* pEEType)) ASSERT(!pEEType->RequiresAlign8()); ASSERT(pEEType->HasFinalizer()); - Thread * pCurThread = ThreadStore::GetCurrentThread(); - Object * pObject; - size_t size = pEEType->get_BaseSize(); - pObject = (Object *)RedhawkGCInterface::Alloc(pCurThread, size, GC_ALLOC_FINALIZE, pEEType); + Object * pObject = (Object *)RhpGcAlloc(pEEType, GC_ALLOC_FINALIZE, size, NULL); if (pObject == nullptr) { ASSERT_UNCONDITIONALLY("NYI"); // TODO: Throw OOM @@ -181,7 +179,7 @@ COOP_PINVOKE_HELPER(Array *, RhpNewArray, (EEType * pArrayEEType, int numElement return pObject; } - pObject = (Array *)RedhawkGCInterface::Alloc(pCurThread, size, 0, pArrayEEType); + pObject = (Array *)RhpGcAlloc(pArrayEEType, 0, size, NULL); if (pObject == nullptr) { ASSERT_UNCONDITIONALLY("NYI"); // TODO: Throw OOM @@ -231,7 +229,7 @@ COOP_PINVOKE_HELPER(MDArray *, RhNewMDArray, (EEType * pArrayEEType, UInt32 rank else { needsPublish = true; - pObject = (MDArray *)RedhawkGCInterface::Alloc(pCurThread, size, 0, pArrayEEType); + pObject = (MDArray *)RhpGcAlloc(pArrayEEType, 0, size, NULL); if (pObject == nullptr) { ASSERT_UNCONDITIONALLY("NYI"); // TODO: Throw OOM |