summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2018-12-17 14:07:08 +0100
committerGitHub <noreply@github.com>2018-12-17 14:07:08 +0100
commitd4a1ed808feba26664d09e81e85336e049d30aa1 (patch)
tree8059dd01b0bccfb4c6a1c423e7dbda02b10d097b
parentf5979429b345879b4a4b38caac23ad701e4ae49f (diff)
downloadcoreclr-d4a1ed808feba26664d09e81e85336e049d30aa1.tar.gz
coreclr-d4a1ed808feba26664d09e81e85336e049d30aa1.tar.bz2
coreclr-d4a1ed808feba26664d09e81e85336e049d30aa1.zip
Add specialized allocation helpers (#21561)
This is to support dotnet/corert#6688. They don't exist in CoreCLR (yet).
-rw-r--r--src/inc/corinfo.h13
-rw-r--r--src/inc/jithelpers.h3
-rw-r--r--src/jit/earlyprop.cpp3
-rw-r--r--src/jit/utils.cpp3
-rw-r--r--src/jit/valuenum.cpp3
5 files changed, 20 insertions, 5 deletions
diff --git a/src/inc/corinfo.h b/src/inc/corinfo.h
index 9b7a2f971a..f342b2d219 100644
--- a/src/inc/corinfo.h
+++ b/src/inc/corinfo.h
@@ -213,11 +213,11 @@ TODO: Talk about initializing strutures before use
#define SELECTANY extern __declspec(selectany)
#endif
-SELECTANY const GUID JITEEVersionIdentifier = { /* FF09DB9F-26A8-4A0B-AF2C-78E32A516FE1 */
- 0xff09db9f,
- 0x26a8,
- 0x4a0b,
- {0xaf, 0x2c, 0x78, 0xe3, 0x2a, 0x51, 0x6f, 0xe1}
+SELECTANY const GUID JITEEVersionIdentifier = { /* {0BA24443-F3E0-453E-BE58-039CC4510F39} */
+ 0xba24443,
+ 0xf3e0,
+ 0x453e,
+ {0xbe, 0x58, 0x3, 0x9c, 0xc4, 0x51, 0xf, 0x39}
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -396,7 +396,10 @@ enum CorInfoHelpFunc
CORINFO_HELP_NEW_CROSSCONTEXT, // cross context new object
CORINFO_HELP_NEWFAST,
CORINFO_HELP_NEWSFAST, // allocator for small, non-finalizer, non-array object
+ CORINFO_HELP_NEWSFAST_FINALIZE, // allocator for small, finalizable, non-array object
CORINFO_HELP_NEWSFAST_ALIGN8, // allocator for small, non-finalizer, non-array object, 8 byte aligned
+ CORINFO_HELP_NEWSFAST_ALIGN8_VC,// allocator for small, value class, 8 byte aligned
+ CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE, // allocator for small, finalizable, non-array object, 8 byte aligned
CORINFO_HELP_NEW_MDARR, // multi-dim array helper (with or without lower bounds - dimensions passed in as vararg)
CORINFO_HELP_NEW_MDARR_NONVARARG,// multi-dim array helper (with or without lower bounds - dimensions passed in as unmanaged array)
CORINFO_HELP_NEWARR_1_DIRECT, // helper for any one dimensional array creation
diff --git a/src/inc/jithelpers.h b/src/inc/jithelpers.h
index 1da962aaff..f305a4d765 100644
--- a/src/inc/jithelpers.h
+++ b/src/inc/jithelpers.h
@@ -73,7 +73,10 @@
JITHELPER(CORINFO_HELP_NEW_CROSSCONTEXT, NULL, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)
JITHELPER(CORINFO_HELP_NEWFAST, JIT_New, CORINFO_HELP_SIG_REG_ONLY)
DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST, JIT_New, CORINFO_HELP_SIG_REG_ONLY)
+ JITHELPER(CORINFO_HELP_NEWSFAST_FINALIZE, NULL, CORINFO_HELP_SIG_REG_ONLY)
DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8, JIT_New, CORINFO_HELP_SIG_REG_ONLY)
+ JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_VC, NULL, CORINFO_HELP_SIG_REG_ONLY)
+ JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE, NULL, CORINFO_HELP_SIG_REG_ONLY)
JITHELPER(CORINFO_HELP_NEW_MDARR, JIT_NewMDArr,CORINFO_HELP_SIG_8_VA)
JITHELPER(CORINFO_HELP_NEW_MDARR_NONVARARG, JIT_NewMDArrNonVarArg,CORINFO_HELP_SIG_4_STACK)
JITHELPER(CORINFO_HELP_NEWARR_1_DIRECT, JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)
diff --git a/src/jit/earlyprop.cpp b/src/jit/earlyprop.cpp
index edbcefdf69..0131aa6e21 100644
--- a/src/jit/earlyprop.cpp
+++ b/src/jit/earlyprop.cpp
@@ -115,7 +115,10 @@ GenTree* Compiler::getObjectHandleNodeFromAllocation(GenTree* tree)
{
if (call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWFAST) ||
call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWSFAST) ||
+ call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWSFAST_FINALIZE) ||
call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWSFAST_ALIGN8) ||
+ call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWSFAST_ALIGN8_VC) ||
+ call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE) ||
call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWARR_1_DIRECT) ||
call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWARR_1_R2R_DIRECT) ||
call->gtCallMethHnd == eeFindHelper(CORINFO_HELP_NEWARR_1_OBJ) ||
diff --git a/src/jit/utils.cpp b/src/jit/utils.cpp
index 8ccae2ccc8..8bc85961fd 100644
--- a/src/jit/utils.cpp
+++ b/src/jit/utils.cpp
@@ -1227,6 +1227,7 @@ void HelperCallProperties::init()
// Heap Allocation helpers, these all never return null
case CORINFO_HELP_NEWSFAST:
case CORINFO_HELP_NEWSFAST_ALIGN8:
+ case CORINFO_HELP_NEWSFAST_ALIGN8_VC:
isAllocator = true;
nonNullReturn = true;
@@ -1235,6 +1236,8 @@ void HelperCallProperties::init()
case CORINFO_HELP_NEW_CROSSCONTEXT:
case CORINFO_HELP_NEWFAST:
+ case CORINFO_HELP_NEWSFAST_FINALIZE:
+ case CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE:
case CORINFO_HELP_READYTORUN_NEW:
mayFinalize = true; // These may run a finalizer
diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp
index 0ea6df9bc9..40f6c05b7f 100644
--- a/src/jit/valuenum.cpp
+++ b/src/jit/valuenum.cpp
@@ -8934,7 +8934,10 @@ VNFunc Compiler::fgValueNumberJitHelperMethodVNFunc(CorInfoHelpFunc helpFunc)
case CORINFO_HELP_NEW_CROSSCONTEXT:
case CORINFO_HELP_NEWFAST:
case CORINFO_HELP_NEWSFAST:
+ case CORINFO_HELP_NEWSFAST_FINALIZE:
case CORINFO_HELP_NEWSFAST_ALIGN8:
+ case CORINFO_HELP_NEWSFAST_ALIGN8_VC:
+ case CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE:
vnf = VNF_JitNew;
break;