diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/inc/corinfo.h | 18 | ||||
-rw-r--r-- | src/jit/flowgraph.cpp | 7 | ||||
-rw-r--r--[-rwxr-xr-x] | src/jit/gentree.cpp | 2 | ||||
-rw-r--r-- | src/jit/gentree.h | 2 | ||||
-rw-r--r-- | src/jit/importer.cpp | 6 | ||||
-rw-r--r-- | src/vm/jitinterface.cpp | 11 | ||||
-rw-r--r-- | src/vm/jitinterface.h | 6 | ||||
-rw-r--r-- | src/vm/win32threadpool.cpp | 2 | ||||
-rw-r--r-- | src/zap/zapimport.cpp | 9 | ||||
-rw-r--r-- | src/zap/zapimport.h | 3 | ||||
-rw-r--r-- | src/zap/zapinfo.cpp | 22 | ||||
-rw-r--r-- | src/zap/zapinfo.h | 6 |
12 files changed, 74 insertions, 20 deletions
diff --git a/src/inc/corinfo.h b/src/inc/corinfo.h index bb1a1c339c..fb839996c0 100644 --- a/src/inc/corinfo.h +++ b/src/inc/corinfo.h @@ -231,11 +231,11 @@ TODO: Talk about initializing strutures before use #if COR_JIT_EE_VERSION > 460 // Update this one -SELECTANY const GUID JITEEVersionIdentifier = { /* 35ef98ab-fd22-4ccc-8ddb-b1156a7d94f3 */ - 0x35ef98ab, - 0xfd22, - 0x4ccc, - { 0x8d, 0xdb, 0xb1, 0x15, 0x6a, 0x7d, 0x94, 0xf3 } +SELECTANY const GUID JITEEVersionIdentifier = { /* 27626524-7315-4ed0-b74e-a0e4579883bb */ + 0x27626524, + 0x7315, + 0x4ed0, + { 0xb7, 0x4e, 0xa0, 0xe4, 0x57, 0x98, 0x83, 0xbb } }; #else @@ -2390,6 +2390,14 @@ public: CORINFO_CONST_LOOKUP * pLookup ) = 0; +#if COR_JIT_EE_VERSION > 460 + virtual void getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN * pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_CONST_LOOKUP * pLookup + ) = 0; +#endif + virtual const char* getHelperName( CorInfoHelpFunc ) = 0; diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index d075401ed4..4e3ba8648b 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -6924,7 +6924,12 @@ GenTreePtr Compiler::fgOptimizeDelegateConstructor(GenTreePtr call, CORINFO_C helperArgs->gtOp.gtOp2 = gtNewArgList(call->gtCall.gtCallArgs->gtOp.gtOp1); call = gtNewHelperCallNode(CORINFO_HELP_READYTORUN_DELEGATE_CTOR, TYP_VOID, GTF_EXCEPT, helperArgs); - call->gtCall.gtEntryPoint = targetMethod->gtFptrVal.gtDelegateCtor; +#if COR_JIT_EE_VERSION > 460 + info.compCompHnd->getReadyToRunDelegateCtorHelper(targetMethod->gtFptrVal.gtLdftnResolvedToken, clsHnd, &call->gtCall.gtEntryPoint); +#else + info.compCompHnd->getReadyToRunHelper(targetMethod->gtFptrVal.gtLdftnResolvedToken, + CORINFO_HELP_READYTORUN_DELEGATE_CTOR, &call->gtCall.gtEntryPoint); +#endif } } else diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp index cad84177c4..a0ce79b11c 100755..100644 --- a/src/jit/gentree.cpp +++ b/src/jit/gentree.cpp @@ -5954,7 +5954,7 @@ GenTreePtr Compiler::gtCloneExpr(GenTree * tree, #ifdef FEATURE_READYTORUN_COMPILER copy->gtFptrVal.gtEntryPoint = tree->gtFptrVal.gtEntryPoint; - copy->gtFptrVal.gtDelegateCtor = tree->gtFptrVal.gtDelegateCtor; + copy->gtFptrVal.gtLdftnResolvedToken = tree->gtFptrVal.gtLdftnResolvedToken; #endif goto DONE; diff --git a/src/jit/gentree.h b/src/jit/gentree.h index 631f67b79f..d95c473e17 100644 --- a/src/jit/gentree.h +++ b/src/jit/gentree.h @@ -2547,7 +2547,7 @@ struct GenTreeFptrVal: public GenTree #ifdef FEATURE_READYTORUN_COMPILER CORINFO_CONST_LOOKUP gtEntryPoint; - CORINFO_CONST_LOOKUP gtDelegateCtor; + CORINFO_RESOLVED_TOKEN* gtLdftnResolvedToken; #endif GenTreeFptrVal(var_types type, CORINFO_METHOD_HANDLE meth) : diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 7993918df0..558fc1f39f 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -1663,10 +1663,8 @@ GenTreePtr Compiler::impMethodPointer(CORINFO_RESOLVED_TOKEN * pResolvedToken, C if (opts.IsReadyToRun()) { op1->gtFptrVal.gtEntryPoint = pCallInfo->codePointerLookup.constLookup; - - // In almost all cases, we are going to create the delegate out of the function pointer. While we are here, - // get the pointer to the optimized delegate helper. Only one of the two is going to be embedded into the code. - info.compCompHnd->getReadyToRunHelper(pResolvedToken, CORINFO_HELP_READYTORUN_DELEGATE_CTOR, &op1->gtFptrVal.gtDelegateCtor); + op1->gtFptrVal.gtLdftnResolvedToken = new(this, CMK_Unknown) CORINFO_RESOLVED_TOKEN; + *op1->gtFptrVal.gtLdftnResolvedToken = *pResolvedToken; } else op1->gtFptrVal.gtEntryPoint.addr = nullptr; diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index aabc658ea4..46542482ba 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -6092,6 +6092,17 @@ void CEEInfo::getReadyToRunHelper( } /***********************************************************************/ +void CEEInfo::getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN * pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_CONST_LOOKUP * pLookup + ) +{ + LIMITED_METHOD_CONTRACT; + UNREACHABLE(); // only called during NGen +} + +/***********************************************************************/ // see code:Nullable#NullableVerification CORINFO_CLASS_HANDLE CEEInfo::getTypeForBox(CORINFO_CLASS_HANDLE cls) diff --git a/src/vm/jitinterface.h b/src/vm/jitinterface.h index 215ceda4b2..00edc6e212 100644 --- a/src/vm/jitinterface.h +++ b/src/vm/jitinterface.h @@ -538,6 +538,12 @@ public: CORINFO_CONST_LOOKUP * pLookup ); + void getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN * pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_CONST_LOOKUP * pLookup + ); + CorInfoInitClassResult initClass( CORINFO_FIELD_HANDLE field, CORINFO_METHOD_HANDLE method, diff --git a/src/vm/win32threadpool.cpp b/src/vm/win32threadpool.cpp index af7b26c1e2..fc25f4e7b9 100644 --- a/src/vm/win32threadpool.cpp +++ b/src/vm/win32threadpool.cpp @@ -305,11 +305,13 @@ DWORD GetDefaultMaxLimitWorkerThreads(DWORD minLimit) DWORD GetForceMinWorkerThreadsValue() { + WRAPPER_NO_CONTRACT; return Configuration::GetKnobDWORDValue(W("System.Threading.ThreadPool.MinThreads"), CLRConfig::INTERNAL_ThreadPool_ForceMinWorkerThreads); } DWORD GetForceMaxWorkerThreadsValue() { + WRAPPER_NO_CONTRACT; return Configuration::GetKnobDWORDValue(W("System.Threading.ThreadPool.MaxThreads"), CLRConfig::INTERNAL_ThreadPool_ForceMaxWorkerThreads); } diff --git a/src/zap/zapimport.cpp b/src/zap/zapimport.cpp index c1947a96f0..4e7b151d74 100644 --- a/src/zap/zapimport.cpp +++ b/src/zap/zapimport.cpp @@ -1791,13 +1791,20 @@ ZapImport * ZapImportTable::GetDynamicHelperCell(CORCOMPILE_FIXUP_BLOB_KIND kind return pImport; } -ZapImport * ZapImportTable::GetDynamicHelperCell(CORCOMPILE_FIXUP_BLOB_KIND kind, CORINFO_METHOD_HANDLE handle, CORINFO_RESOLVED_TOKEN * pResolvedToken) +ZapImport * ZapImportTable::GetDynamicHelperCell(CORCOMPILE_FIXUP_BLOB_KIND kind, CORINFO_METHOD_HANDLE handle, CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_CLASS_HANDLE delegateType /*=NULL*/) { SigBuilder sigBuilder; EncodeMethod((CORCOMPILE_FIXUP_BLOB_KIND)(kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE), handle, &sigBuilder, pResolvedToken); + if (delegateType != NULL) + { + _ASSERTE((CORCOMPILE_FIXUP_BLOB_KIND)(kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE) == ENCODE_DELEGATE_CTOR); + GetCompileInfo()->EncodeClass(m_pImage->GetModuleHandle(), delegateType, &sigBuilder, NULL, NULL); + } + return GetImportForSignature<ZapDynamicHelperCell, ZapNodeType_DynamicHelperCell>((void *)kind, &sigBuilder); } diff --git a/src/zap/zapimport.h b/src/zap/zapimport.h index 9d55e03531..9aa5e95f27 100644 --- a/src/zap/zapimport.h +++ b/src/zap/zapimport.h @@ -432,7 +432,8 @@ public: ZapImport * GetExternalMethodCell(CORINFO_METHOD_HANDLE handle, CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_RESOLVED_TOKEN * pConstrainedResolvedToken); ZapImport * GetDynamicHelperCell(CORCOMPILE_FIXUP_BLOB_KIND kind, CORINFO_CLASS_HANDLE handle); - ZapImport * GetDynamicHelperCell(CORCOMPILE_FIXUP_BLOB_KIND kind, CORINFO_METHOD_HANDLE handle, CORINFO_RESOLVED_TOKEN * pResolvedToken); + ZapImport * GetDynamicHelperCell(CORCOMPILE_FIXUP_BLOB_KIND kind, CORINFO_METHOD_HANDLE handle, CORINFO_RESOLVED_TOKEN * pResolvedToken, + CORINFO_CLASS_HANDLE delegateType = NULL); ZapImport * GetDynamicHelperCell(CORCOMPILE_FIXUP_BLOB_KIND kind, CORINFO_FIELD_HANDLE handle, CORINFO_RESOLVED_TOKEN * pResolvedToken); #ifdef FEATURE_READYTORUN_COMPILER diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp index c8a08a3cc6..cf8e9b7c7e 100644 --- a/src/zap/zapinfo.cpp +++ b/src/zap/zapinfo.cpp @@ -2667,7 +2667,7 @@ CORINFO_METHOD_HANDLE ZapInfo::GetDelegateCtor(CORINFO_METHOD_HANDLE methHnd, CORINFO_METHOD_HANDLE targetMethodHnd, DelegateCtorArgs * pCtorData) { - // For ReadyToRun, this optimization is done via ZapInfo::getReadyToRunHelper + // For ReadyToRun, this optimization is done via ZapInfo::getReadyToRunDelegateCtorHelper if (IsReadyToRunCompilation()) return methHnd; @@ -3410,11 +3410,6 @@ void ZapInfo::getReadyToRunHelper( } break; - case CORINFO_HELP_READYTORUN_DELEGATE_CTOR: - pImport = m_pImage->GetImportTable()->GetDynamicHelperCell( - (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_DELEGATE_CTOR | fAtypicalCallsite), pResolvedToken->hMethod, pResolvedToken); - break; - default: _ASSERTE(false); ThrowHR(E_NOTIMPL); @@ -3425,6 +3420,21 @@ void ZapInfo::getReadyToRunHelper( #endif } +void ZapInfo::getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN * pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_CONST_LOOKUP * pLookup + ) +{ +#ifdef FEATURE_READYTORUN_COMPILER + _ASSERTE(IsReadyToRunCompilation()); + + pLookup->accessType = IAT_PVALUE; + pLookup->addr = m_pImage->GetImportTable()->GetDynamicHelperCell( + (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_DELEGATE_CTOR), pTargetMethod->hMethod, pTargetMethod, delegateType); +#endif +} + // // ICorModuleInfo diff --git a/src/zap/zapinfo.h b/src/zap/zapinfo.h index 83528e9e7b..5fe3dcb76e 100644 --- a/src/zap/zapinfo.h +++ b/src/zap/zapinfo.h @@ -550,6 +550,12 @@ public: CORINFO_CONST_LOOKUP * pLookup ); + void getReadyToRunDelegateCtorHelper( + CORINFO_RESOLVED_TOKEN * pTargetMethod, + CORINFO_CLASS_HANDLE delegateType, + CORINFO_CONST_LOOKUP * pLookup + ); + CorInfoInitClassResult initClass( CORINFO_FIELD_HANDLE field, CORINFO_METHOD_HANDLE method, |