summaryrefslogtreecommitdiff
path: root/src/vm/jithelpers.cpp
diff options
context:
space:
mode:
authorRuben Ayrapetyan <ruben-ayrapetyan@users.noreply.github.com>2017-06-27 21:31:03 +0300
committerJan Kotas <jkotas@microsoft.com>2017-06-27 11:31:03 -0700
commit3951920cbd825c2b2251ba3572ca354f887d6033 (patch)
tree0245d94927f56736b6f4adf1f630c2639bb28686 /src/vm/jithelpers.cpp
parentf1499d2214d0d8d630bff30045ce520b73d4356c (diff)
downloadcoreclr-3951920cbd825c2b2251ba3572ca354f887d6033.tar.gz
coreclr-3951920cbd825c2b2251ba3572ca354f887d6033.tar.bz2
coreclr-3951920cbd825c2b2251ba3572ca354f887d6033.zip
Implement JIT_NewArr1_R2R as R2R wrapper for JIT_NewArr1 to support both MethodTable-based and TypeDesc-based helpers. (#12475)
Related issue: #12463
Diffstat (limited to 'src/vm/jithelpers.cpp')
-rw-r--r--src/vm/jithelpers.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp
index e5fc596689..b74c4104ff 100644
--- a/src/vm/jithelpers.cpp
+++ b/src/vm/jithelpers.cpp
@@ -3139,6 +3139,21 @@ HCIMPL2(Object*, JIT_NewArr1OBJ_MP_FastPortable, CORINFO_CLASS_HANDLE arrayMT, I
}
HCIMPLEND
+//*************************************************************
+// R2R-specific array allocation wrapper that extracts array method table from ArrayTypeDesc
+//
+HCIMPL2(Object*, JIT_NewArr1_R2R, CORINFO_CLASS_HANDLE arrayTypeHnd_, INT_PTR size)
+{
+ FCALL_CONTRACT;
+
+ TypeHandle arrayTypeHandle(arrayTypeHnd_);
+ ArrayTypeDesc *pArrayTypeDesc = arrayTypeHandle.AsArray();
+ MethodTable *pArrayMT = pArrayTypeDesc->GetTemplateMethodTable();
+
+ return HCCALL2(JIT_NewArr1, (CORINFO_CLASS_HANDLE)pArrayMT, size);
+}
+HCIMPLEND
+
#include <optdefault.h>
/*************************************************************/