From 484a2cf0b0c4e304a5093ec26e07fe41f8896c3c Mon Sep 17 00:00:00 2001 From: dotnet-bot Date: Wed, 6 May 2015 23:43:46 -0700 Subject: Merge changes from parent branch [tfs-changeset: 1466545] --- src/debug/daccess/nidump.cpp | 1 + src/inc/corcompile.h | 10 + src/inc/eetwain.h | 8 +- src/inc/eventtracebase.h | 15 + src/inc/pedecoder.h | 1 + src/inc/pedecoder.inl | 15 + src/jit/codegenxarch.cpp | 17 +- src/jit/flowgraph.cpp | 21 ++ src/jit/gentree.cpp | 6 +- src/jit/lower.cpp | 71 +---- src/jit/lower.h | 7 - src/jit/lowerxarch.cpp | 25 +- src/jit/lsra.cpp | 25 +- src/jit/optimizer.cpp | 18 ++ src/jit/simdcodegenxarch.cpp | 48 +++- src/jit/ssabuilder.cpp | 19 +- src/jit/valuenum.cpp | 13 +- src/md/winmd/adapter.cpp | 55 ++++ src/md/winmd/inc/adapter.h | 11 +- src/md/winmd/winmdimport.cpp | 2 +- src/md/winmd/winmdinternalimportro.cpp | 6 +- src/mscorlib/src/System/AppDomain.cs | 22 +- src/mscorlib/src/System/AppDomainSetup.cs | 22 +- .../src/System/Globalization/CalendarData.cs | 16 ++ .../src/System/Reflection/Emit/TypeBuilder.cs | 6 +- src/pal/prebuilt/inc/clretwall.h | 311 ++++++++++++++++----- src/pal/prebuilt/inc/clretwallmain.h | 2 +- src/pal/prebuilt/inc/etmdummy.h | 7 + src/vm/ClrEtwAll.man | 84 +++++- src/vm/appdomain.hpp | 3 +- src/vm/assembly.cpp | 51 +++- src/vm/assembly.hpp | 4 + src/vm/ceeload.cpp | 10 +- src/vm/clrtracelogging.cpp | 41 +++ src/vm/codeman.cpp | 2 +- src/vm/compile.cpp | 19 +- src/vm/coreassemblyspec.cpp | 2 +- src/vm/crossgen/wks_crossgen.nativeproj | 4 +- src/vm/domainfile.cpp | 7 + src/vm/dwreport.cpp | 98 ++++--- src/vm/eetwain.cpp | 51 +++- src/vm/eventtrace.cpp | 139 +++++++++ src/vm/exceptionhandling.cpp | 53 +++- src/vm/exceptionhandling.h | 9 + src/vm/gcenv.cpp | 108 ++++++- src/vm/i386/excepx86.cpp | 14 + src/vm/i386/stublinkerx86.cpp | 8 +- src/vm/methodtablebuilder.cpp | 14 +- src/vm/pefile.cpp | 20 ++ src/vm/pefile.h | 1 + src/vm/pefile.inl | 22 ++ src/vm/peimage.cpp | 9 +- src/vm/stackwalk.cpp | 27 +- src/vm/stackwalk.h | 13 + src/vm/threaddebugblockinginfo.cpp | 7 + src/vm/threads.cpp | 15 + src/vm/threads.h | 2 + src/vm/vm.settings | 1 + src/vm/wks/wks.targets | 3 + src/zap/zapheaders.cpp | 33 ++- src/zap/zapimport.cpp | 13 +- src/zap/zapper.cpp | 7 +- 62 files changed, 1357 insertions(+), 317 deletions(-) create mode 100644 src/vm/clrtracelogging.cpp (limited to 'src') diff --git a/src/debug/daccess/nidump.cpp b/src/debug/daccess/nidump.cpp index fbd6993756..16f8bea1fe 100644 --- a/src/debug/daccess/nidump.cpp +++ b/src/debug/daccess/nidump.cpp @@ -5355,6 +5355,7 @@ const NativeImageDumper::EnumMnemonics s_CorCompileHdrFlags[] = #define CCHF_ENTRY(f) NativeImageDumper::EnumMnemonics(f, W(#f)) CCHF_ENTRY(CORCOMPILE_HEADER_HAS_SECURITY_DIRECTORY), CCHF_ENTRY(CORCOMPILE_HEADER_IS_IBC_OPTIMIZED), + CCHF_ENTRY(CORCOMPILE_HEADER_IS_READY_TO_RUN), #undef CCHF_ENTRY }; diff --git a/src/inc/corcompile.h b/src/inc/corcompile.h index 693cf31edf..e3f73a79c9 100644 --- a/src/inc/corcompile.h +++ b/src/inc/corcompile.h @@ -198,8 +198,16 @@ enum CorCompileCodegen CORCOMPILE_CODEGEN_PROFILING = 0x0004, // supports profiling CORCOMPILE_CODEGEN_PROF_INSTRUMENTING = 0x0008, // code is instrumented to collect profile count info + +#if defined(_TARGET_AMD64_) && !defined(FEATURE_CORECLR) + CORCOMPILE_CODEGEN_USE_RYUJIT = 0x0100, // code is generated by Ryu JIT +#endif }; +#if defined(_TARGET_AMD64_) && !defined(FEATURE_CORECLR) +bool UseRyuJit(); +#endif + // Used for INativeImageInstallInfo::GetConfigMask() // A bind will ask for the particular bits it needs set; if all bits are set, it is a match. Additional // bits are ignored. @@ -225,6 +233,8 @@ enum CorCompileHeaderFlags // Note it is useless to cache the actual directory contents // since it must be verified as part of the original image CORCOMPILE_HEADER_IS_IBC_OPTIMIZED = 0x00000002, + + CORCOMPILE_HEADER_IS_READY_TO_RUN = 0x00000004, }; // diff --git a/src/inc/eetwain.h b/src/inc/eetwain.h index d849bcf47c..21f74847e6 100644 --- a/src/inc/eetwain.h +++ b/src/inc/eetwain.h @@ -43,6 +43,8 @@ #define CHECK_APP_DOMAIN 0 #endif +#define NO_OVERRIDE_OFFSET (DWORD)-1 + struct EHContext; #ifdef DACCESS_COMPILE @@ -231,7 +233,8 @@ virtual bool EnumGcRefs(PREGDISPLAY pContext, EECodeInfo *pCodeInfo, unsigned flags, GCEnumCallback pCallback, - LPVOID hCallBack) = 0; + LPVOID hCallBack, + DWORD relOffsetOverride = NO_OVERRIDE_OFFSET) = 0; /* Return the address of the local security object reference @@ -460,7 +463,8 @@ bool EnumGcRefs(PREGDISPLAY pContext, EECodeInfo *pCodeInfo, unsigned flags, GCEnumCallback pCallback, - LPVOID hCallBack); + LPVOID hCallBack, + DWORD relOffsetOverride = NO_OVERRIDE_OFFSET); #ifdef FEATURE_CONSERVATIVE_GC // Temporary conservative collection, for testing purposes, until we have diff --git a/src/inc/eventtracebase.h b/src/inc/eventtracebase.h index 517125f49b..eac127e732 100644 --- a/src/inc/eventtracebase.h +++ b/src/inc/eventtracebase.h @@ -650,8 +650,23 @@ namespace ETW public: #ifdef FEATURE_EVENT_TRACE static VOID ExceptionThrown(CrawlFrame *pCf, BOOL bIsReThrownException, BOOL bIsNewException); + static VOID ExceptionThrownEnd(); + static VOID ExceptionCatchBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP); + static VOID ExceptionCatchEnd(); + static VOID ExceptionFinallyBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP); + static VOID ExceptionFinallyEnd(); + static VOID ExceptionFilterBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP); + static VOID ExceptionFilterEnd(); + #else static VOID ExceptionThrown(CrawlFrame *pCf, BOOL bIsReThrownException, BOOL bIsNewException) {}; + static VOID ExceptionThrownEnd() {}; + static VOID ExceptionCatchBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP) {}; + static VOID ExceptionCatchEnd() {}; + static VOID ExceptionFinallyBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP) {}; + static VOID ExceptionFinallyEnd() {}; + static VOID ExceptionFilterBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP) {}; + static VOID ExceptionFilterEnd() {}; #endif // FEATURE_EVENT_TRACE typedef union _ExceptionStructs { diff --git a/src/inc/pedecoder.h b/src/inc/pedecoder.h index 71126d3ff3..a744764a6d 100644 --- a/src/inc/pedecoder.h +++ b/src/inc/pedecoder.h @@ -307,6 +307,7 @@ class PEDecoder const void *GetNativePreferredBase() const; BOOL GetNativeILHasSecurityDirectory() const; BOOL GetNativeILIsIbcOptimized() const; + BOOL GetNativeILHasReadyToRunHeader() const; BOOL IsNativeILILOnly() const; BOOL IsNativeILDll() const; void GetNativeILPEKindAndMachine(DWORD* pdwKind, DWORD* pdwMachine) const; diff --git a/src/inc/pedecoder.inl b/src/inc/pedecoder.inl index 94c93c3526..9794625a58 100644 --- a/src/inc/pedecoder.inl +++ b/src/inc/pedecoder.inl @@ -1046,6 +1046,21 @@ inline BOOL PEDecoder::GetNativeILIsIbcOptimized() const return (GetNativeHeader()->Flags & CORCOMPILE_HEADER_IS_IBC_OPTIMIZED) != 0; } +inline BOOL PEDecoder::GetNativeILHasReadyToRunHeader() const +{ + CONTRACTL + { + INSTANCE_CHECK; + PRECONDITION(CheckNativeHeader()); + NOTHROW; + GC_NOTRIGGER; + } + CONTRACTL_END; + + PREFIX_ASSUME (GetNativeHeader()!=NULL); + return (GetNativeHeader()->Flags & CORCOMPILE_HEADER_IS_READY_TO_RUN) != 0; +} + inline BOOL PEDecoder::IsNativeILILOnly() const { CONTRACTL diff --git a/src/jit/codegenxarch.cpp b/src/jit/codegenxarch.cpp index 98a269b397..9449a751ad 100644 --- a/src/jit/codegenxarch.cpp +++ b/src/jit/codegenxarch.cpp @@ -6759,6 +6759,7 @@ void CodeGen::genEmitHelperCall(unsigned helper, emitter::EmitCallType callType = emitter::EC_FUNC_TOKEN; addr = compiler->compGetHelperFtn((CorInfoHelpFunc)helper, &pAddr); regNumber callTarget = REG_NA; + regMaskTP killMask = compiler->compHelperCallKillSet((CorInfoHelpFunc)helper); if (!addr) { @@ -6782,13 +6783,16 @@ void CodeGen::genEmitHelperCall(unsigned helper, // If a callTargetReg has not been explicitly provided, we will use REG_DEFAULT_HELPER_CALL_TARGET, but // this is only a valid assumption if the helper call is known to kill REG_DEFAULT_HELPER_CALL_TARGET. callTargetReg = REG_DEFAULT_HELPER_CALL_TARGET; + regMaskTP callTargetMask = genRegMask(callTargetReg); + noway_assert((callTargetMask & killMask) == callTargetMask); + } + else + { + // The call target must not overwrite any live variable, though it may not be in the + // kill set for the call. + regMaskTP callTargetMask = genRegMask(callTargetReg); + noway_assert((callTargetMask & regSet.rsMaskVars) == RBM_NONE); } - - regMaskTP callTargetMask = genRegMask(callTargetReg); - regMaskTP callKillSet = compiler->compHelperCallKillSet((CorInfoHelpFunc)helper); - - // assert that all registers in callTargetMask are in the callKillSet - noway_assert((callTargetMask & callKillSet) == callTargetMask); #endif callTarget = callTargetReg; CodeGen::genSetRegToIcon(callTarget, (ssize_t) pAddr, TYP_I_IMPL); @@ -6812,7 +6816,6 @@ void CodeGen::genEmitHelperCall(unsigned helper, emitter::emitNoGChelper(helper)); - regMaskTP killMask = compiler->compHelperCallKillSet((CorInfoHelpFunc)helper); regTracker.rsTrashRegSet(killMask); regTracker.rsTrashRegsForGCInterruptability(); } diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index f05c4aa194..0463575029 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -16430,6 +16430,27 @@ void Compiler::fgExtendEHRegionBefore(BasicBlock* block) HBtab->ebdHndBeg = bPrev; bPrev->bbFlags |= BBF_DONT_REMOVE | BBF_HAS_LABEL; bPrev->bbRefs++; + + // If this is a handler for a filter, the last block of the filter will end with + // a BBJ_EJFILTERRET block that has a bbJumpDest that jumps to the first block of + // it's handler. So we need to update it to keep things in sync. + // + if (HBtab->HasFilter()) + { + BasicBlock* bFilterLast = HBtab->BBFilterLast(); + assert(bFilterLast != nullptr); + assert(bFilterLast->bbJumpKind == BBJ_EHFILTERRET); + assert(bFilterLast->bbJumpDest == block); +#ifdef DEBUG + if (verbose) + { + printf("EH#%u: Updating bbJumpDest for filter ret block: BB%02u => BB%02u\n", + ehGetIndex(HBtab), bFilterLast->bbNum, bPrev->bbNum); + } +#endif // DEBUG + // Change the bbJumpDest for bFilterLast from the old first 'block' to the new first 'bPrev' + bFilterLast->bbJumpDest = bPrev; + } } if (HBtab->HasFilter() && (HBtab->ebdFilter == block)) diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp index b7d63850e4..4654350962 100644 --- a/src/jit/gentree.cpp +++ b/src/jit/gentree.cpp @@ -11597,9 +11597,13 @@ BasicBlock* BasicBlock::GetSucc(unsigned i, Compiler * comp) unreached(); // Should have been covered by assert above. case BBJ_EHFILTERRET: + { assert(comp != NULL); // Or else we're not looking for successors. + BasicBlock* result = comp->fgFirstBlockOfHandler(this); + noway_assert(result == bbJumpDest); // Handler is the (sole) normal successor of the filter. - return comp->fgFirstBlockOfHandler(this); + return result; + } case BBJ_EHFINALLYRET: return comp->fgSuccOfFinallyRet(this, i); diff --git a/src/jit/lower.cpp b/src/jit/lower.cpp index a231ebbeee..4327e20bd6 100644 --- a/src/jit/lower.cpp +++ b/src/jit/lower.cpp @@ -417,76 +417,6 @@ GenTreePtr Lowering::CreateLocalTempAsg(GenTreePtr rhs, return store; } -/** Creates a byref to byref assignment where the actual values are not - * GC pointers. The assignment has the following shape: - * [dstObj + scale*index + offset] = [srcObj + scale*index + offset] - * The IR generated for this is: - * GT_ASG( - * GT_IND( - * GT_LEA(dstObj, index, scale, offset)), - * GT_IND( - * GT_LEA(srcObj, index, scale, offset))) - */ -GenTreePtr Lowering::CreateAsgByRefNonGcStmt (Compiler* comp, - BasicBlock* block, - GenTreePtr srcObj, - GenTreePtr dstObj, - GenTreePtr index, - unsigned scale, - unsigned offset) -{ - assert(srcObj != nullptr && dstObj != nullptr); - var_types type = TYP_INT; - switch (scale) - { - case 4: - type = TYP_INT; - break; - case 2: - type = TYP_USHORT; - break; - case 1: - type = TYP_UBYTE; - break; - default: - noway_assert(!"Unsupported scale size for addressing modes"); - } - GenTreePtr gtClonedSrc = comp->gtClone(srcObj); - GenTreePtr gtClonedDst = comp->gtClone(dstObj); - GenTreePtr gtClonedIndex = nullptr; - GenTreePtr gtClonedIndex2 = nullptr; - - assert(gtClonedSrc != nullptr && gtClonedDst != nullptr); - - if (index != nullptr) - { - gtClonedIndex = comp->gtClone(index); - gtClonedIndex2 = comp->gtClone(index); - assert(gtClonedIndex != nullptr && gtClonedIndex2 != nullptr); - } - - GenTreePtr gtSrcAddrNode = new(comp, GT_LEA) GenTreeAddrMode(type, - gtClonedSrc, - gtClonedIndex, - scale, - offset); - GenTreePtr gtSrcIndirNode = comp->gtNewOperNode(GT_IND, - type, - gtSrcAddrNode); - GenTreePtr gtDstAddrNode = new(comp, GT_LEA) GenTreeAddrMode(type, - gtClonedDst, - gtClonedIndex2, - scale, - offset); - GenTreePtr gtDstIndirNode = comp->gtNewOperNode(GT_IND, - type, - gtDstAddrNode); - GenTreePtr gtByRefAsgStmt = comp->fgNewStmtFromTree( - comp->gtNewAssignNode(gtDstIndirNode, gtSrcIndirNode), - block); - return gtByRefAsgStmt; -} - // This is the main entry point for Lowering. // In addition to that, LowerNode is also responsible for initializing the @@ -2086,6 +2016,7 @@ GenTree* Lowering::LowerDelegateInvoke(GenTreeCall* call) originalThisValue->InsertAfterSelf(newThisAddr); GenTree* newThis = comp->gtNewOperNode(GT_IND, TYP_REF, newThisAddr); + newThis->SetCosts(IND_COST_EX, 2); newThisAddr->InsertAfterSelf(newThis); *pThisExpr = newThis; diff --git a/src/jit/lower.h b/src/jit/lower.h index 6b78903d9f..e029e451a0 100644 --- a/src/jit/lower.h +++ b/src/jit/lower.h @@ -168,13 +168,6 @@ private: GenTreePtr indirCandidate); GenTreePtr CreateLocalTempAsg (GenTreePtr rhs, unsigned refCount, GenTreePtr *ppLclVar = nullptr); - GenTreePtr CreateAsgByRefNonGcStmt (Compiler* comp, - BasicBlock* block, - GenTreePtr srcObj, - GenTreePtr dstObj, - GenTreePtr index, - unsigned scale, - unsigned offset); bool AreSourcesPossiblyModified (GenTree* use, GenTree* src1, GenTree *src2); void ReplaceNode (GenTree** ppTreeLocation, diff --git a/src/jit/lowerxarch.cpp b/src/jit/lowerxarch.cpp index 87f6fa8c00..d803e5dd26 100644 --- a/src/jit/lowerxarch.cpp +++ b/src/jit/lowerxarch.cpp @@ -1874,19 +1874,32 @@ Lowering::TreeNodeInfoInitSIMD(GenTree* tree, LinearScan* lsra) // Otherwise, if the baseType is floating point, the targetReg will be a xmm reg and we // can use that in the process of extracting the element. // - // If the index is a constant and base type is a small int we can use pextrw. + // If the index is a constant and base type is a small int we can use pextrw, but on AVX + // we will need a temp if are indexing into the upper half of the AVX register. // In all other cases with constant index, we need a temp xmm register to extract the // element if index is other than zero. + if (!op2->IsCnsIntOrI()) { (void) comp->getSIMDInitTempVarNum(); } - else if (!varTypeIsFloating(simdTree->gtSIMDBaseType) && - !varTypeIsSmallInt(simdTree->gtSIMDBaseType) && - !op2->IsZero()) + else if (!varTypeIsFloating(simdTree->gtSIMDBaseType)) { - info->internalFloatCount = 1; - info->setInternalCandidates(lsra, lsra->allSIMDRegs()); + bool needFloatTemp; + if (varTypeIsSmallInt(simdTree->gtSIMDBaseType) && (comp->getSIMDInstructionSet() == InstructionSet_AVX)) + { + int byteShiftCnt = (int) op2->AsIntCon()->gtIconVal * genTypeSize(simdTree->gtSIMDBaseType); + needFloatTemp = (byteShiftCnt >= 16); + } + else + { + needFloatTemp = !op2->IsZero(); + } + if (needFloatTemp) + { + info->internalFloatCount = 1; + info->setInternalCandidates(lsra, lsra->allSIMDRegs()); + } } break; diff --git a/src/jit/lsra.cpp b/src/jit/lsra.cpp index 76a98f3c53..f0831cf919 100644 --- a/src/jit/lsra.cpp +++ b/src/jit/lsra.cpp @@ -2974,6 +2974,17 @@ LinearScan::buildRefPositionsForNode(GenTree *tree, srcInterval->assignRelatedInterval(varDefInterval); } } + // We can have a case where the source of the store has a different register type, + // e.g. when the store is of a return value temp, and op1 is a Vector2 + // (8-byte SIMD, which is TYP_DOUBLE at this point). We will need to set the + // src candidates accordingly on op1 so that LSRA will generate a copy. + // We could do this during Lowering, but at that point we don't know whether + // this lclVar will be a register candidate, and if not, we would prefer to leave + // the type alone. + if (regType(tree->gtGetOp1()->TypeGet()) != regType(tree->TypeGet())) + { + tree->gtGetOp1()->gtLsraInfo.setSrcCandidates(this, allRegs(tree->TypeGet())); + } } if ((tree->gtFlags & GTF_VAR_DEATH) == 0) @@ -4154,7 +4165,7 @@ LinearScan::registerIsAvailable(RegRecord *physRegRecord, LsraLocation currentLo // Notes: // This will nearly always be identical to the registerType of the interval, except in the case // of SIMD types of 8 bytes (currently only Vector2) when they are passed and returned in integer -// registers. +// registers, or copied to a return temp. // This method need only be called in situations where we may be dealing with the register requirements // of a RefTypeUse RefPosition (i.e. not when we are only looking at the type of an interval, nor when // we are interested in the "defining" type of the interval). This is because the situation of interest @@ -4169,10 +4180,9 @@ LinearScan::getRegisterType(Interval *currentInterval, RefPosition* refPosition) #if defined(FEATURE_SIMD) && defined(_TARGET_AMD64_) if ((candidates & allRegs(regType)) == RBM_NONE) { - assert(genMaxOneBit(candidates) && - (regType == TYP_DOUBLE) && - (refPosition->refType == RefTypeUse) && - ((candidates & (RBM_ARG_REGS | RBM_LNGRET)) != RBM_NONE)); + assert((regType == TYP_DOUBLE) && + (refPosition->refType == RefTypeUse) && + ((candidates & allRegs(TYP_INT)) != RBM_NONE)); regType = TYP_INT; } #else // !(defined(FEATURE_SIMD) && defined(_TARGET_AMD64_)) @@ -6694,9 +6704,8 @@ LinearScan::insertUpperVectorSaveAndReload(GenTreePtr tree, RefPosition* refPosi assert(lclVarInterval->isLocalVar == true); LclVarDsc * varDsc = compiler->lvaTable + lclVarInterval->varNum; assert(varDsc->lvType == LargeVectorType); - regNumber lclVarReg = varDsc->lvRegNum; - assert(lclVarReg != REG_NA); - if (lclVarReg == REG_STK) + regNumber lclVarReg = lclVarInterval->physReg; + if (lclVarReg == REG_NA) { return; } diff --git a/src/jit/optimizer.cpp b/src/jit/optimizer.cpp index 61b1881bcd..2f781e9840 100644 --- a/src/jit/optimizer.cpp +++ b/src/jit/optimizer.cpp @@ -1813,6 +1813,24 @@ void Compiler::optFindNaturalLoops() goto NO_LOOP; } +#if FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) + // Disqualify loops where the first block of the loop is a finally target. + // The main problem is when multiple loops share a 'first' block that is a finally + // target and we canonicalize the loops by adding a new loop head. In that case, we + // need to update the blocks so the finally target bit is moved to the newly created + // block, and removed from the old 'first' block. This is 'hard', so at this point + // in the RyuJIT codebase (when we don't expect to keep the "old" ARM32 code generator + // long-term), it's easier to disallow the loop than to update the flow graph to + // support this case. + + if ((first->bbFlags & BBF_FINALLY_TARGET) != 0) + { + JITDUMP("Loop 'first' BB%02u is a finally target. Rejecting loop.\n", + first->bbNum); + goto NO_LOOP; + } +#endif // FEATURE_EH_FUNCLETS && defined(_TARGET_ARM_) + /* At this point we have a loop - record it in the loop table * If we found only one exit, record it in the table too * (otherwise an exit = 0 in the loop table means multiple exits) */ diff --git a/src/jit/simdcodegenxarch.cpp b/src/jit/simdcodegenxarch.cpp index 59fed64056..6675b86f34 100644 --- a/src/jit/simdcodegenxarch.cpp +++ b/src/jit/simdcodegenxarch.cpp @@ -1428,6 +1428,39 @@ CodeGen::genSIMDIntrinsicGetItem(GenTreeSIMD* simdNode) noway_assert(op2->isContained()); int byteShiftCnt = (int) op2->gtIntCon.gtIconVal * genTypeSize(baseType); + regNumber tmpReg = REG_NA; + if (simdNode->gtRsvdRegs != RBM_NONE) + { + assert(genCountBits(simdNode->gtRsvdRegs) == 1); + tmpReg = genRegNumFromMask(simdNode->gtRsvdRegs); + } + else + { + assert((byteShiftCnt == 0) || + varTypeIsFloating(baseType) || + (varTypeIsSmallInt(baseType) && (byteShiftCnt < 16))); + } + + if (byteShiftCnt >= 16) + { + assert(compiler->getSIMDInstructionSet() == InstructionSet_AVX); + byteShiftCnt -= 16; + regNumber newSrcReg; + if (varTypeIsFloating(baseType)) + { + newSrcReg = targetReg; + } + else + { + // Integer types + assert(tmpReg != REG_NA); + newSrcReg = tmpReg; + } + getEmitter()->emitIns_R_R_I(INS_vextractf128, EA_32BYTE, newSrcReg, srcReg, 0x01); + + srcReg = newSrcReg; + } + // Generate the following sequence: // 1) baseType is floating point // movaps targetReg, srcReg @@ -1435,6 +1468,7 @@ CodeGen::genSIMDIntrinsicGetItem(GenTreeSIMD* simdNode) // // 2) baseType is not floating point // movaps tmpReg, srcReg <-- not generated if accessing zero'th element + // OR if tmpReg == srcReg // psrldq tmpReg, byteShiftCnt <-- not generated if accessing zero'th element // mov_xmm2i targetReg, tmpReg if (varTypeIsFloating(baseType)) @@ -1464,6 +1498,14 @@ CodeGen::genSIMDIntrinsicGetItem(GenTreeSIMD* simdNode) { index /= 2; } + // We actually want index % 8 for the AVX case (for SSE it will never be > 8). + // Note that this doesn't matter functionally, because the instruction uses just the + // low 3 bits of index, but it's better to use the right value. + if (index > 8) + { + assert(compiler->getSIMDInstructionSet() == InstructionSet_AVX); + index -= 8; + } getEmitter()->emitIns_R_R_I(INS_pextrw, emitTypeSize(TYP_INT), targetReg, srcReg, index); @@ -1497,14 +1539,11 @@ CodeGen::genSIMDIntrinsicGetItem(GenTreeSIMD* simdNode) { // We need a temp xmm register if the baseType is not floating point and // accessing non-zero'th element. - regNumber tmpReg = REG_NA; instruction ins; if (byteShiftCnt != 0) { - assert(simdNode->gtRsvdRegs != RBM_NONE); - assert(genCountBits(simdNode->gtRsvdRegs) == 1); - tmpReg = genRegNumFromMask(simdNode->gtRsvdRegs); + assert(tmpReg != REG_NA); if (tmpReg != srcReg) { @@ -1516,7 +1555,6 @@ CodeGen::genSIMDIntrinsicGetItem(GenTreeSIMD* simdNode) } else { - assert(simdNode->gtRsvdRegs == RBM_NONE); tmpReg = srcReg; } diff --git a/src/jit/ssabuilder.cpp b/src/jit/ssabuilder.cpp index 69245c30a4..1dc9d3907d 100644 --- a/src/jit/ssabuilder.cpp +++ b/src/jit/ssabuilder.cpp @@ -753,14 +753,17 @@ void SsaBuilder::InsertPhiFunctions(BasicBlock** postOrder, int count) // We have a variable i that is defined in block j and live at l, and l belongs to dom frontier of j. // So insert a phi node at l. JITDUMP("Inserting phi definition for V%02u at start of BB%02u.\n", lclNum, bbInDomFront->bbNum); - GenTreePtr phiLhs = m_pCompiler->gtNewLclvNode(lclNum, m_pCompiler->lvaTable[lclNum].TypeGet()); - GenTreePtr phiAsg = m_pCompiler->gtNewAssignNode( - phiLhs, - m_pCompiler->gtNewOperNode( - GT_PHI, - m_pCompiler->lvaTable[lclNum].TypeGet(), - NULL) - DEBUG_ARG(/*isPhiDefn*/true)); + + GenTreePtr phiLhs = m_pCompiler->gtNewLclvNode(lclNum, m_pCompiler->lvaTable[lclNum].TypeGet()); + + // Create 'phiRhs' as a GT_PHI node for 'lclNum', it will eventually hold a GT_LIST of GT_PHI_ARG nodes. + // However we have to construct this list so for now the gtOp1 of 'phiRhs' is a nullptr. + // It will get replaced with a GT_LIST of GT_PHI_ARG nodes in SsaBuilder::AssignPhiNodeRhsVariables() + // and in SsaBuilder::AddDefToHandlerPhis() + // + GenTreePtr phiRhs = m_pCompiler->gtNewOperNode(GT_PHI, m_pCompiler->lvaTable[lclNum].TypeGet(), nullptr); + + GenTreePtr phiAsg = m_pCompiler->gtNewAssignNode(phiLhs, phiRhs DEBUG_ARG(/*isPhiDefn*/true)); GenTreePtr stmt = m_pCompiler->fgInsertStmtAtBeg(bbInDomFront, phiAsg); m_pCompiler->gtSetStmtInfo(stmt); diff --git a/src/jit/valuenum.cpp b/src/jit/valuenum.cpp index c5625407b9..2680e0ec44 100644 --- a/src/jit/valuenum.cpp +++ b/src/jit/valuenum.cpp @@ -3890,9 +3890,18 @@ void Compiler::fgValueNumberBlock(BasicBlock* blk, bool newVNsForPhis) ValueNumPair sameVNPair; GenTreePtr phiFunc = phiDef->gtOp.gtOp2; + + // At this point a GT_PHI node should never have a nullptr for gtOp1 + // and the gtOp1 should always be a GT_LIST node. + GenTreePtr phiOp1 = phiFunc->gtOp.gtOp1; + noway_assert(phiOp1 != nullptr); + noway_assert(phiOp1->OperGet() == GT_LIST); + GenTreeArgList* phiArgs = phiFunc->gtOp.gtOp1->AsArgList(); - // Phi's should have more than one argument. - assert(phiArgs->Rest() != nullptr); + + // A GT_PHI node should have more than one argument. + noway_assert(phiArgs->Rest() != nullptr); + GenTreeLclVarCommon* phiArg = phiArgs->Current()->AsLclVarCommon(); phiArgs = phiArgs->Rest(); diff --git a/src/md/winmd/adapter.cpp b/src/md/winmd/adapter.cpp index 45c695c1d3..1be4e0a07b 100644 --- a/src/md/winmd/adapter.cpp +++ b/src/md/winmd/adapter.cpp @@ -207,6 +207,7 @@ WinMDAdapter::WinMDAdapter(IMDCommon *pRawMDCommon) , m_redirectedTypeSpecSigMemoTable(pRawMDCommon->GetMetaModelCommonRO()->CommonGetRowCount(mdtTypeSpec), NULL) , m_redirectedMethodSpecSigMemoTable(pRawMDCommon->GetMetaModelCommonRO()->CommonGetRowCount(mdtMethodSpec), NULL) , m_mangledTypeNameTable(pRawMDCommon->GetMetaModelCommonRO()->CommonGetRowCount(mdtTypeDef), NULL) + , m_extraAssemblyRefCount(-1) { m_rawAssemblyRefCount = pRawMDCommon->GetMetaModelCommonRO()->CommonGetRowCount(mdtAssemblyRef); m_pRedirectedVersionString = NULL; @@ -1095,6 +1096,60 @@ HRESULT WinMDAdapter::ModifyExportedTypeName( //------------------------------------------------------------------------------ +// We must optionaly add an assembly ref for System.Numerics.Vectors.dll since this assembly is not available +// on downlevel platforms. +// +// This function assumes that System.Numerics.Vectors.dll is the last assembly that +// we add so if we find a reference then we return ContractAssembly_Count otherwise we return +// ContractAssembly_Count - 1. +int WinMDAdapter::GetExtraAssemblyRefCount() +{ + HRESULT hr; + + if (m_extraAssemblyRefCount == -1) + { + mdAssemblyRef tkSystemNumericsVectors = TokenFromRid(m_rawAssemblyRefCount + ContractAssembly_SystemNumericsVectors + 1, mdtAssemblyRef); + ULONG cTypeRefRecs = m_pRawMetaModelCommonRO->CommonGetRowCount(mdtTypeRef); + BOOL systemNumericsVectorsTypeFound = FALSE; + + for (ULONG i = 1; i <= cTypeRefRecs; i++) + { + mdToken tkResolutionScope; + mdTypeRef tkTypeRef = TokenFromRid(i, mdtTypeRef); + + // Get the resolution scope(AssemblyRef) token for the type. GetTypeRefProps does the type redirection. + IfFailGo(GetTypeRefProps(tkTypeRef, nullptr, nullptr, &tkResolutionScope)); + + if (tkResolutionScope == tkSystemNumericsVectors) + { + systemNumericsVectorsTypeFound = TRUE; + break; + } + } + + if (systemNumericsVectorsTypeFound) + { + m_extraAssemblyRefCount = ContractAssembly_Count; + } + else + { + m_extraAssemblyRefCount = ContractAssembly_Count - 1; + } + } + +ErrExit: + if (m_extraAssemblyRefCount == -1) + { + // Setting m_extraAssemblyRefCount to ContractAssembly_Count so that this function returns a stable value and + // that if there is a System.Numerics type ref that it does not have a dangling assembly ref + m_extraAssemblyRefCount = ContractAssembly_Count; + } + + return m_extraAssemblyRefCount; +} + +//------------------------------------------------------------------------------ + /*static*/ void WinMDAdapter::GetExtraAssemblyRefProps(FrameworkAssemblyIndex index, LPCSTR* ppName, diff --git a/src/md/winmd/inc/adapter.h b/src/md/winmd/inc/adapter.h index 87fc410a77..748d65d473 100644 --- a/src/md/winmd/inc/adapter.h +++ b/src/md/winmd/inc/adapter.h @@ -102,7 +102,8 @@ public: ContractAssembly_SystemObjectModel, ContractAssembly_SystemRuntimeWindowsRuntime, ContractAssembly_SystemRuntimeWindowsRuntimeUIXaml, - ContractAssembly_SystemNumericsVectors, + ContractAssembly_SystemNumericsVectors, // GetExtraAssemblyRefCount assumes SystemNumericsVectors is the last assembly. + // If you add an assembly you must update GetActualExtraAssemblyRefCount. ContractAssembly_Count, }; @@ -120,10 +121,7 @@ public: WinMDTypeKind_Runtimeclass, }; - static int GetExtraAssemblyRefCount() - { - return ContractAssembly_Count; - } + int GetExtraAssemblyRefCount(); // Factory and destructor static HRESULT Create(IMDCommon *pRawMDCommon, /*[out]*/ WinMDAdapter **ppAdapter); @@ -813,7 +811,8 @@ private: //----------------------------------------------------------------------------------- mdAssemblyRef m_assemblyRefMscorlib; BOOL m_fReferencesMscorlibV4; // m_assemblyRefMscorlib is a version=4.0.0.0 AssemblyRef - ULONG m_rawAssemblyRefCount; // the saw assembly ref count not including the extra ones. + ULONG m_rawAssemblyRefCount; // the raw assembly ref count not including the extra ones. + LONG m_extraAssemblyRefCount; // the assembly ref count to return from IMetaDataAssemblyImport::EnumAssemblyRefs private: diff --git a/src/md/winmd/winmdimport.cpp b/src/md/winmd/winmdimport.cpp index ace02c262b..b0a229dbb0 100644 --- a/src/md/winmd/winmdimport.cpp +++ b/src/md/winmd/winmdimport.cpp @@ -1661,7 +1661,7 @@ class WinMDImport : public IMetaDataImport2 _ASSERTE(phInternalEnum->m_EnumType == MDSimpleEnum); _ASSERTE( phInternalEnum->m_ulCount == m_pWinMDAdapter->GetRawAssemblyRefCount()); - int n = WinMDAdapter::GetExtraAssemblyRefCount(); + int n = m_pWinMDAdapter->GetExtraAssemblyRefCount(); phInternalEnum->m_ulCount += n; phInternalEnum->u.m_ulEnd += n; diff --git a/src/md/winmd/winmdinternalimportro.cpp b/src/md/winmd/winmdinternalimportro.cpp index 1d82e13aeb..b4a448dd27 100644 --- a/src/md/winmd/winmdinternalimportro.cpp +++ b/src/md/winmd/winmdinternalimportro.cpp @@ -160,7 +160,7 @@ class WinMDInternalImportRO : public IMDInternalImport, IWinMDImport, IMetaModel { if (tkKind == mdtAssemblyRef) { - return m_pRawInternalImport->GetCountWithTokenKind(tkKind) + WinMDAdapter::GetExtraAssemblyRefCount(); + return m_pRawInternalImport->GetCountWithTokenKind(tkKind) + m_pWinMDAdapter->GetExtraAssemblyRefCount(); } else { @@ -297,7 +297,7 @@ class WinMDInternalImportRO : public IMDInternalImport, IWinMDImport, IMetaModel if (tkKind == mdtAssemblyRef) { _ASSERTE( phEnum->m_ulCount == m_pWinMDAdapter->GetRawAssemblyRefCount()); - int n = WinMDAdapter::GetExtraAssemblyRefCount(); + int n = m_pWinMDAdapter->GetExtraAssemblyRefCount(); phEnum->m_ulCount += n; phEnum->u.m_ulEnd += n; } @@ -320,7 +320,7 @@ ErrExit: if (tkKind == mdtAssemblyRef) { _ASSERTE( phEnum->m_ulCount == m_pWinMDAdapter->GetRawAssemblyRefCount()); - int n = WinMDAdapter::GetExtraAssemblyRefCount(); + int n = m_pWinMDAdapter->GetExtraAssemblyRefCount(); phEnum->m_ulCount += n; phEnum->u.m_ulEnd += n; } diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs index 52375b1534..932a66021a 100644 --- a/src/mscorlib/src/System/AppDomain.cs +++ b/src/mscorlib/src/System/AppDomain.cs @@ -606,7 +606,27 @@ namespace System { [SecuritySafeCritical] internal String GetTargetFrameworkName() { - return _FusionStore.TargetFrameworkName; + String targetFrameworkName = _FusionStore.TargetFrameworkName; + + if (targetFrameworkName == null && IsDefaultAppDomain() && !_FusionStore.CheckedForTargetFrameworkName) + { + // This should only be run in the default appdomain. All other appdomains should have + // values copied from the default appdomain and/or specified by the host. + Assembly assembly = Assembly.GetEntryAssembly(); + if (assembly != null) + { + TargetFrameworkAttribute[] attrs = (TargetFrameworkAttribute[])assembly.GetCustomAttributes(typeof(TargetFrameworkAttribute)); + if (attrs != null && attrs.Length > 0) + { + Contract.Assert(attrs.Length == 1); + targetFrameworkName = attrs[0].FrameworkName; + _FusionStore.TargetFrameworkName = targetFrameworkName; + } + } + _FusionStore.CheckedForTargetFrameworkName = true; + } + + return targetFrameworkName; } /// diff --git a/src/mscorlib/src/System/AppDomainSetup.cs b/src/mscorlib/src/System/AppDomainSetup.cs index 8bb8d8c0ef..198404ddb2 100644 --- a/src/mscorlib/src/System/AppDomainSetup.cs +++ b/src/mscorlib/src/System/AppDomainSetup.cs @@ -209,10 +209,7 @@ namespace System { _AppDomainSortingSetupInfo = new AppDomainSortingSetupInfo(copy._AppDomainSortingSetupInfo); } #endif - // The behavior of computing the TargetFrameworkName should be preserved! - // This value needs to be computed before the copy constructor returns the value. - // Note: The computed value can be null if the assembly does not have a TargetFrameworkAttribute - _TargetFrameworkName = copy.TargetFrameworkName; + _TargetFrameworkName = copy._TargetFrameworkName; #if FEATURE_RANDOMIZED_STRING_HASHING _UseRandomizedStringHashing = copy._UseRandomizedStringHashing; @@ -650,23 +647,6 @@ namespace System { // A target Framework moniker, in a format parsible by the FrameworkName class. public String TargetFrameworkName { get { - if (!CheckedForTargetFrameworkName && _TargetFrameworkName == null && AppDomain.CurrentDomain.IsDefaultAppDomain() && AppDomain.CurrentDomain.FusionStore == this) - { - // This should only be run for the default appdomain. All other appdomains should have - // values copied from the default appdomain and/or specified by the host. - Assembly assembly = Assembly.GetEntryAssembly(); - if (assembly != null) - { - TargetFrameworkAttribute[] attrs = (TargetFrameworkAttribute[])assembly.GetCustomAttributes(typeof(TargetFrameworkAttribute)); - if (attrs != null && attrs.Length > 0) - { - Contract.Assert(attrs.Length == 1); - _TargetFrameworkName = attrs[0].FrameworkName; - } - } - CheckedForTargetFrameworkName = true; - } - return _TargetFrameworkName; } set { diff --git a/src/mscorlib/src/System/Globalization/CalendarData.cs b/src/mscorlib/src/System/Globalization/CalendarData.cs index 1e5133e37c..8f8e20805f 100644 --- a/src/mscorlib/src/System/Globalization/CalendarData.cs +++ b/src/mscorlib/src/System/Globalization/CalendarData.cs @@ -259,6 +259,14 @@ namespace System.Globalization case CalendarId.JAPANESELUNISOLAR: this.saEraNames = JapaneseCalendar.EraNames(); break; + + case CalendarId.PERSIAN: + if (this.saEraNames == null || this.saEraNames.Length == 0 || String.IsNullOrEmpty(this.saEraNames[0])) + { + this.saEraNames = new String[] { "\x0647\x002e\x0634" }; + } + break; + default: // Most calendars are just "A.D." this.saEraNames = Invariant.saEraNames; @@ -313,6 +321,14 @@ namespace System.Globalization this.saAbbrevEraNames[0] = this.saEraNames[0]; } break; + + case CalendarId.PERSIAN: + if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || String.IsNullOrEmpty(this.saAbbrevEraNames[0])) + { + this.saAbbrevEraNames = this.saEraNames; + } + break; + default: // Most calendars just use the full name this.saAbbrevEraNames = this.saEraNames; diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs index dde61478cc..91bd6e7020 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs @@ -492,7 +492,11 @@ namespace System.Reflection.Emit { else { if (destType.IsValueType) - throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNull")); + { + // nullable types can hold null value. + if (!(destType.IsGenericType && destType.GetGenericTypeDefinition() == typeof(Nullable<>))) + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNull")); + } SetConstantValue(module.GetNativeHandle(), tk, (int)CorElementType.Class, null); } diff --git a/src/pal/prebuilt/inc/clretwall.h b/src/pal/prebuilt/inc/clretwall.h index 6d3f9b6c04..865fccf866 100644 --- a/src/pal/prebuilt/inc/clretwall.h +++ b/src/pal/prebuilt/inc/clretwall.h @@ -218,7 +218,7 @@ Remarks: #endif #endif // MCGEN_DISABLE_PROVIDER_CODE_GENERATION //+ -// Provider Microsoft-Windows-DotNETRuntime Event Count 159 +// Provider Microsoft-Windows-DotNETRuntime Event Count 166 //+ EXTERN_C __declspec(selectany) const GUID MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER = {0xe13c0d23, 0xccbc, 0x4e12, {0x93, 0x1b, 0xd9, 0xcc, 0x2e, 0xee, 0x27, 0xe4}}; @@ -327,6 +327,12 @@ EXTERN_C __declspec(selectany) const GUID IOThreadRetirementId = {0x840c8456, 0x EXTERN_C __declspec(selectany) const GUID ThreadpoolSuspensionId = {0xc424b3e3, 0x2ae0, 0x416e, {0xa0, 0x39, 0x41, 0x0c, 0x5d, 0x8e, 0x5f, 0x14}}; #define CLR_EXCEPTION_TASK 0x7 EXTERN_C __declspec(selectany) const GUID ExceptionId = {0x300ce105, 0x86d1, 0x41f8, {0xb9, 0xd2, 0x83, 0xfc, 0xbf, 0xf3, 0x2d, 0x99}}; +#define CLR_EXCEPTION_CATCH_TASK 0x1b +EXTERN_C __declspec(selectany) const GUID ExceptionCatchId = {0x5bbf9499, 0x1715, 0x4658, {0x88, 0xdc, 0xaf, 0xd7, 0x69, 0x0a, 0x87, 0x11}}; +#define CLR_EXCEPTION_FINALLY_TASK 0x1c +EXTERN_C __declspec(selectany) const GUID ExceptionFinallyId = {0x9565bc31, 0x300f, 0x4ea2, {0xa5, 0x32, 0x30, 0xbc, 0xe9, 0xa1, 0x41, 0x99}}; +#define CLR_EXCEPTION_FILTER_TASK 0x1d +EXTERN_C __declspec(selectany) const GUID ExceptionFilterId = {0x72e72606, 0xbb71, 0x4290, {0xa2, 0x42, 0xd5, 0xf3, 0x6c, 0xe5, 0x31, 0x2e}}; #define CLR_CONTENTION_TASK 0x8 EXTERN_C __declspec(selectany) const GUID ContentionId = {0x561410f5, 0xa138, 0x4ab3, {0x94, 0x5e, 0x51, 0x64, 0x83, 0xcd, 0xdf, 0xbc}}; #define CLR_METHOD_TASK 0x9 @@ -396,6 +402,7 @@ EXTERN_C __declspec(selectany) const GUID DebugExceptionProcessingId = {0xc44121 #define CLR_STACK_KEYWORD 0x40000000 #define CLR_THREADTRANSFER_KEYWORD 0x80000000 #define CLR_DEBUGGER_KEYWORD 0x100000000 +#define CLR_MONITORING_KEYWORD 0x200000000 // // Event Descriptors @@ -568,8 +575,22 @@ EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ThreadRunning = {0x47, 0x0 #define ThreadRunning_value 0x47 EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionThrown = {0x50, 0x0, 0x0, 0x4, 0x1, 0x7, 0x0}; #define ExceptionThrown_value 0x50 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionThrown_V1 = {0x50, 0x1, 0x0, 0x2, 0x1, 0x7, 0x8000}; +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionThrown_V1 = {0x50, 0x1, 0x0, 0x2, 0x1, 0x7, 0x200008000}; #define ExceptionThrown_V1_value 0x50 +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionCatchStart = {0xfa, 0x0, 0x0, 0x4, 0x1, 0x1b, 0x8000}; +#define ExceptionCatchStart_value 0xfa +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionCatchStop = {0xfb, 0x0, 0x0, 0x4, 0x2, 0x1b, 0x8000}; +#define ExceptionCatchStop_value 0xfb +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionFinallyStart = {0xfc, 0x0, 0x0, 0x4, 0x1, 0x1c, 0x8000}; +#define ExceptionFinallyStart_value 0xfc +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionFinallyStop = {0xfd, 0x0, 0x0, 0x4, 0x2, 0x1c, 0x8000}; +#define ExceptionFinallyStop_value 0xfd +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionFilterStart = {0xfe, 0x0, 0x0, 0x4, 0x1, 0x1d, 0x8000}; +#define ExceptionFilterStart_value 0xfe +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionFilterStop = {0xff, 0x0, 0x0, 0x4, 0x2, 0x1d, 0x8000}; +#define ExceptionFilterStop_value 0xff +EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ExceptionThrownStop = {0x100, 0x0, 0x0, 0x4, 0x2, 0x7, 0x8000}; +#define ExceptionThrownStop_value 0x100 EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR Contention = {0x51, 0x0, 0x0, 0x4, 0x1, 0x8, 0x0}; #define Contention_value 0x51 EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR ContentionStart_V1 = {0x51, 0x1, 0x0, 0x4, 0x1, 0x8, 0x4000}; @@ -747,9 +768,9 @@ EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR DebugExceptionProcessingEn // EXTERN_C __declspec(selectany) DECLSPEC_CACHEALIGN ULONG Microsoft_Windows_DotNETRuntimeEnableBits[1]; -EXTERN_C __declspec(selectany) const ULONGLONG Microsoft_Windows_DotNETRuntimeKeywords[30] = {0x1, 0x1, 0x10001, 0x80000, 0x100000, 0x200000, 0x400000, 0x2, 0x2000000, 0x10000, 0x10000, 0x80010000, 0x80010000, 0x0, 0x8000, 0x4000, 0x40000000, 0x800, 0x10800, 0x2000, 0x30, 0x10, 0x1000, 0x20000, 0x8, 0x20000008, 0x20000000, 0x400, 0x400, 0x100000000}; -EXTERN_C __declspec(selectany) const UCHAR Microsoft_Windows_DotNETRuntimeLevels[30] = {4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 2, 4, 0, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 4, 4}; -EXTERN_C __declspec(selectany) MCGEN_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context = {0, 0, 0, 0, 0, 0, 0, 0, 30, Microsoft_Windows_DotNETRuntimeEnableBits, Microsoft_Windows_DotNETRuntimeKeywords, Microsoft_Windows_DotNETRuntimeLevels}; +EXTERN_C __declspec(selectany) const ULONGLONG Microsoft_Windows_DotNETRuntimeKeywords[31] = {0x1, 0x1, 0x10001, 0x80000, 0x100000, 0x200000, 0x400000, 0x2, 0x2000000, 0x10000, 0x10000, 0x80010000, 0x80010000, 0x0, 0x200008000, 0x8000, 0x4000, 0x40000000, 0x800, 0x10800, 0x2000, 0x30, 0x10, 0x1000, 0x20000, 0x8, 0x20000008, 0x20000000, 0x400, 0x400, 0x100000000}; +EXTERN_C __declspec(selectany) const UCHAR Microsoft_Windows_DotNETRuntimeLevels[31] = {4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 2, 4, 4, 0, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 5, 4, 4}; +EXTERN_C __declspec(selectany) MCGEN_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_Context = {0, 0, 0, 0, 0, 0, 0, 0, 31, Microsoft_Windows_DotNETRuntimeEnableBits, Microsoft_Windows_DotNETRuntimeKeywords, Microsoft_Windows_DotNETRuntimeLevels}; EXTERN_C __declspec(selectany) REGHANDLE Microsoft_Windows_DotNETRuntimeHandle = (REGHANDLE)0; @@ -2036,6 +2057,104 @@ Remarks: CoTemplate_zzpqhh(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionThrown_V1, ExceptionType, ExceptionMessage, ExceptionEIP, ExceptionHRESULT, ExceptionFlags, ClrInstanceID)\ : ERROR_SUCCESS\ +// +// Enablement check macro for ExceptionCatchStart +// + +#define EventEnabledExceptionCatchStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) + +// +// Event Macro for ExceptionCatchStart +// +#define FireEtwExceptionCatchStart(EntryEIP, MethodID, MethodName, ClrInstanceID)\ + EventEnabledExceptionCatchStart() ?\ + CoTemplate_xxzh(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionCatchStart, EntryEIP, MethodID, MethodName, ClrInstanceID)\ + : ERROR_SUCCESS\ + +// +// Enablement check macro for ExceptionCatchStop +// + +#define EventEnabledExceptionCatchStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) + +// +// Event Macro for ExceptionCatchStop +// +#define FireEtwExceptionCatchStop()\ + EventEnabledExceptionCatchStop() ?\ + CoTemplateEventDescriptor(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionCatchStop)\ + : ERROR_SUCCESS\ + +// +// Enablement check macro for ExceptionFinallyStart +// + +#define EventEnabledExceptionFinallyStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) + +// +// Event Macro for ExceptionFinallyStart +// +#define FireEtwExceptionFinallyStart(EntryEIP, MethodID, MethodName, ClrInstanceID)\ + EventEnabledExceptionFinallyStart() ?\ + CoTemplate_xxzh(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionFinallyStart, EntryEIP, MethodID, MethodName, ClrInstanceID)\ + : ERROR_SUCCESS\ + +// +// Enablement check macro for ExceptionFinallyStop +// + +#define EventEnabledExceptionFinallyStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) + +// +// Event Macro for ExceptionFinallyStop +// +#define FireEtwExceptionFinallyStop()\ + EventEnabledExceptionFinallyStop() ?\ + CoTemplateEventDescriptor(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionFinallyStop)\ + : ERROR_SUCCESS\ + +// +// Enablement check macro for ExceptionFilterStart +// + +#define EventEnabledExceptionFilterStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) + +// +// Event Macro for ExceptionFilterStart +// +#define FireEtwExceptionFilterStart(EntryEIP, MethodID, MethodName, ClrInstanceID)\ + EventEnabledExceptionFilterStart() ?\ + CoTemplate_xxzh(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionFilterStart, EntryEIP, MethodID, MethodName, ClrInstanceID)\ + : ERROR_SUCCESS\ + +// +// Enablement check macro for ExceptionFilterStop +// + +#define EventEnabledExceptionFilterStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) + +// +// Event Macro for ExceptionFilterStop +// +#define FireEtwExceptionFilterStop()\ + EventEnabledExceptionFilterStop() ?\ + CoTemplateEventDescriptor(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionFilterStop)\ + : ERROR_SUCCESS\ + +// +// Enablement check macro for ExceptionThrownStop +// + +#define EventEnabledExceptionThrownStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) + +// +// Event Macro for ExceptionThrownStop +// +#define FireEtwExceptionThrownStop()\ + EventEnabledExceptionThrownStop() ?\ + CoTemplateEventDescriptor(Microsoft_Windows_DotNETRuntimeHandle, &ExceptionThrownStop)\ + : ERROR_SUCCESS\ + // // Enablement check macro for Contention // @@ -2054,7 +2173,7 @@ Remarks: // Enablement check macro for ContentionStart_V1 // -#define EventEnabledContentionStart_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) +#define EventEnabledContentionStart_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00010000) != 0) // // Event Macro for ContentionStart_V1 @@ -2068,7 +2187,7 @@ Remarks: // Enablement check macro for ContentionStop // -#define EventEnabledContentionStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00008000) != 0) +#define EventEnabledContentionStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00010000) != 0) // // Event Macro for ContentionStop @@ -2082,7 +2201,7 @@ Remarks: // Enablement check macro for CLRStackWalk // -#define EventEnabledCLRStackWalk() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00010000) != 0) +#define EventEnabledCLRStackWalk() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00020000) != 0) // // Event Macro for CLRStackWalk @@ -2096,7 +2215,7 @@ Remarks: // Enablement check macro for AppDomainMemAllocated // -#define EventEnabledAppDomainMemAllocated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00020000) != 0) +#define EventEnabledAppDomainMemAllocated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00040000) != 0) // // Event Macro for AppDomainMemAllocated @@ -2110,7 +2229,7 @@ Remarks: // Enablement check macro for AppDomainMemSurvived // -#define EventEnabledAppDomainMemSurvived() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00020000) != 0) +#define EventEnabledAppDomainMemSurvived() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00040000) != 0) // // Event Macro for AppDomainMemSurvived @@ -2124,7 +2243,7 @@ Remarks: // Enablement check macro for ThreadCreated // -#define EventEnabledThreadCreated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00040000) != 0) +#define EventEnabledThreadCreated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00080000) != 0) // // Event Macro for ThreadCreated @@ -2138,7 +2257,7 @@ Remarks: // Enablement check macro for ThreadTerminated // -#define EventEnabledThreadTerminated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00040000) != 0) +#define EventEnabledThreadTerminated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00080000) != 0) // // Event Macro for ThreadTerminated @@ -2152,7 +2271,7 @@ Remarks: // Enablement check macro for ThreadDomainEnter // -#define EventEnabledThreadDomainEnter() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00040000) != 0) +#define EventEnabledThreadDomainEnter() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00080000) != 0) // // Event Macro for ThreadDomainEnter @@ -2166,7 +2285,7 @@ Remarks: // Enablement check macro for ILStubGenerated // -#define EventEnabledILStubGenerated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00080000) != 0) +#define EventEnabledILStubGenerated() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) // // Event Macro for ILStubGenerated @@ -2180,7 +2299,7 @@ Remarks: // Enablement check macro for ILStubCacheHit // -#define EventEnabledILStubCacheHit() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00080000) != 0) +#define EventEnabledILStubCacheHit() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) // // Event Macro for ILStubCacheHit @@ -2194,7 +2313,7 @@ Remarks: // Enablement check macro for DCStartCompleteV2 // -#define EventEnabledDCStartCompleteV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledDCStartCompleteV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for DCStartCompleteV2 @@ -2208,7 +2327,7 @@ Remarks: // Enablement check macro for DCEndCompleteV2 // -#define EventEnabledDCEndCompleteV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledDCEndCompleteV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for DCEndCompleteV2 @@ -2222,7 +2341,7 @@ Remarks: // Enablement check macro for MethodDCStartV2 // -#define EventEnabledMethodDCStartV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodDCStartV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodDCStartV2 @@ -2236,7 +2355,7 @@ Remarks: // Enablement check macro for MethodDCEndV2 // -#define EventEnabledMethodDCEndV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodDCEndV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodDCEndV2 @@ -2250,7 +2369,7 @@ Remarks: // Enablement check macro for MethodDCStartVerboseV2 // -#define EventEnabledMethodDCStartVerboseV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodDCStartVerboseV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodDCStartVerboseV2 @@ -2264,7 +2383,7 @@ Remarks: // Enablement check macro for MethodDCEndVerboseV2 // -#define EventEnabledMethodDCEndVerboseV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodDCEndVerboseV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodDCEndVerboseV2 @@ -2278,7 +2397,7 @@ Remarks: // Enablement check macro for MethodLoad // -#define EventEnabledMethodLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodLoad @@ -2292,7 +2411,7 @@ Remarks: // Enablement check macro for MethodLoad_V1 // -#define EventEnabledMethodLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodLoad_V1 @@ -2306,7 +2425,7 @@ Remarks: // Enablement check macro for MethodLoad_V2 // -#define EventEnabledMethodLoad_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodLoad_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodLoad_V2 @@ -2320,7 +2439,7 @@ Remarks: // Enablement check macro for MethodUnload // -#define EventEnabledMethodUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodUnload @@ -2334,7 +2453,7 @@ Remarks: // Enablement check macro for MethodUnload_V1 // -#define EventEnabledMethodUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodUnload_V1 @@ -2348,7 +2467,7 @@ Remarks: // Enablement check macro for MethodUnload_V2 // -#define EventEnabledMethodUnload_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodUnload_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodUnload_V2 @@ -2362,7 +2481,7 @@ Remarks: // Enablement check macro for MethodLoadVerbose // -#define EventEnabledMethodLoadVerbose() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodLoadVerbose() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodLoadVerbose @@ -2376,7 +2495,7 @@ Remarks: // Enablement check macro for MethodLoadVerbose_V1 // -#define EventEnabledMethodLoadVerbose_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodLoadVerbose_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodLoadVerbose_V1 @@ -2390,7 +2509,7 @@ Remarks: // Enablement check macro for MethodLoadVerbose_V2 // -#define EventEnabledMethodLoadVerbose_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodLoadVerbose_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodLoadVerbose_V2 @@ -2404,7 +2523,7 @@ Remarks: // Enablement check macro for MethodUnloadVerbose // -#define EventEnabledMethodUnloadVerbose() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodUnloadVerbose() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodUnloadVerbose @@ -2418,7 +2537,7 @@ Remarks: // Enablement check macro for MethodUnloadVerbose_V1 // -#define EventEnabledMethodUnloadVerbose_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodUnloadVerbose_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodUnloadVerbose_V1 @@ -2432,7 +2551,7 @@ Remarks: // Enablement check macro for MethodUnloadVerbose_V2 // -#define EventEnabledMethodUnloadVerbose_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00100000) != 0) +#define EventEnabledMethodUnloadVerbose_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) // // Event Macro for MethodUnloadVerbose_V2 @@ -2446,7 +2565,7 @@ Remarks: // Enablement check macro for MethodJittingStarted // -#define EventEnabledMethodJittingStarted() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) +#define EventEnabledMethodJittingStarted() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00400000) != 0) // // Event Macro for MethodJittingStarted @@ -2460,7 +2579,7 @@ Remarks: // Enablement check macro for MethodJittingStarted_V1 // -#define EventEnabledMethodJittingStarted_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00200000) != 0) +#define EventEnabledMethodJittingStarted_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00400000) != 0) // // Event Macro for MethodJittingStarted_V1 @@ -2474,7 +2593,7 @@ Remarks: // Enablement check macro for MethodJitInliningSucceeded // -#define EventEnabledMethodJitInliningSucceeded() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00400000) != 0) +#define EventEnabledMethodJitInliningSucceeded() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00800000) != 0) // // Event Macro for MethodJitInliningSucceeded @@ -2488,7 +2607,7 @@ Remarks: // Enablement check macro for MethodJitInliningFailed // -#define EventEnabledMethodJitInliningFailed() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00400000) != 0) +#define EventEnabledMethodJitInliningFailed() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00800000) != 0) // // Event Macro for MethodJitInliningFailed @@ -2502,7 +2621,7 @@ Remarks: // Enablement check macro for MethodJitTailCallSucceeded // -#define EventEnabledMethodJitTailCallSucceeded() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00400000) != 0) +#define EventEnabledMethodJitTailCallSucceeded() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00800000) != 0) // // Event Macro for MethodJitTailCallSucceeded @@ -2516,7 +2635,7 @@ Remarks: // Enablement check macro for MethodJitTailCallFailed // -#define EventEnabledMethodJitTailCallFailed() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00400000) != 0) +#define EventEnabledMethodJitTailCallFailed() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00800000) != 0) // // Event Macro for MethodJitTailCallFailed @@ -2530,7 +2649,7 @@ Remarks: // Enablement check macro for MethodILToNativeMap // -#define EventEnabledMethodILToNativeMap() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x00800000) != 0) +#define EventEnabledMethodILToNativeMap() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) // // Event Macro for MethodILToNativeMap @@ -2544,7 +2663,7 @@ Remarks: // Enablement check macro for ModuleDCStartV2 // -#define EventEnabledModuleDCStartV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledModuleDCStartV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for ModuleDCStartV2 @@ -2558,7 +2677,7 @@ Remarks: // Enablement check macro for ModuleDCEndV2 // -#define EventEnabledModuleDCEndV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledModuleDCEndV2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for ModuleDCEndV2 @@ -2572,7 +2691,7 @@ Remarks: // Enablement check macro for DomainModuleLoad // -#define EventEnabledDomainModuleLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledDomainModuleLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for DomainModuleLoad @@ -2586,7 +2705,7 @@ Remarks: // Enablement check macro for DomainModuleLoad_V1 // -#define EventEnabledDomainModuleLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledDomainModuleLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for DomainModuleLoad_V1 @@ -2600,7 +2719,7 @@ Remarks: // Enablement check macro for ModuleLoad // -#define EventEnabledModuleLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledModuleLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for ModuleLoad @@ -2614,7 +2733,7 @@ Remarks: // Enablement check macro for ModuleLoad_V1 // -#define EventEnabledModuleLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) +#define EventEnabledModuleLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x04000000) != 0) // // Event Macro for ModuleLoad_V1 @@ -2628,7 +2747,7 @@ Remarks: // Enablement check macro for ModuleLoad_V2 // -#define EventEnabledModuleLoad_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) +#define EventEnabledModuleLoad_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x04000000) != 0) // // Event Macro for ModuleLoad_V2 @@ -2642,7 +2761,7 @@ Remarks: // Enablement check macro for ModuleUnload // -#define EventEnabledModuleUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledModuleUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for ModuleUnload @@ -2656,7 +2775,7 @@ Remarks: // Enablement check macro for ModuleUnload_V1 // -#define EventEnabledModuleUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) +#define EventEnabledModuleUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x04000000) != 0) // // Event Macro for ModuleUnload_V1 @@ -2670,7 +2789,7 @@ Remarks: // Enablement check macro for ModuleUnload_V2 // -#define EventEnabledModuleUnload_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) +#define EventEnabledModuleUnload_V2() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x04000000) != 0) // // Event Macro for ModuleUnload_V2 @@ -2684,7 +2803,7 @@ Remarks: // Enablement check macro for AssemblyLoad // -#define EventEnabledAssemblyLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAssemblyLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AssemblyLoad @@ -2698,7 +2817,7 @@ Remarks: // Enablement check macro for AssemblyLoad_V1 // -#define EventEnabledAssemblyLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAssemblyLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AssemblyLoad_V1 @@ -2712,7 +2831,7 @@ Remarks: // Enablement check macro for AssemblyUnload // -#define EventEnabledAssemblyUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAssemblyUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AssemblyUnload @@ -2726,7 +2845,7 @@ Remarks: // Enablement check macro for AssemblyUnload_V1 // -#define EventEnabledAssemblyUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAssemblyUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AssemblyUnload_V1 @@ -2740,7 +2859,7 @@ Remarks: // Enablement check macro for AppDomainLoad // -#define EventEnabledAppDomainLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAppDomainLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AppDomainLoad @@ -2754,7 +2873,7 @@ Remarks: // Enablement check macro for AppDomainLoad_V1 // -#define EventEnabledAppDomainLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAppDomainLoad_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AppDomainLoad_V1 @@ -2768,7 +2887,7 @@ Remarks: // Enablement check macro for AppDomainUnload // -#define EventEnabledAppDomainUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAppDomainUnload() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AppDomainUnload @@ -2782,7 +2901,7 @@ Remarks: // Enablement check macro for AppDomainUnload_V1 // -#define EventEnabledAppDomainUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x01000000) != 0) +#define EventEnabledAppDomainUnload_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x02000000) != 0) // // Event Macro for AppDomainUnload_V1 @@ -2796,7 +2915,7 @@ Remarks: // Enablement check macro for ModuleRangeLoad // -#define EventEnabledModuleRangeLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x04000000) != 0) +#define EventEnabledModuleRangeLoad() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x08000000) != 0) // // Event Macro for ModuleRangeLoad @@ -2810,7 +2929,7 @@ Remarks: // Enablement check macro for StrongNameVerificationStart // -#define EventEnabledStrongNameVerificationStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x08000000) != 0) +#define EventEnabledStrongNameVerificationStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) // // Event Macro for StrongNameVerificationStart @@ -2824,7 +2943,7 @@ Remarks: // Enablement check macro for StrongNameVerificationStart_V1 // -#define EventEnabledStrongNameVerificationStart_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x08000000) != 0) +#define EventEnabledStrongNameVerificationStart_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) // // Event Macro for StrongNameVerificationStart_V1 @@ -2838,7 +2957,7 @@ Remarks: // Enablement check macro for StrongNameVerificationStop // -#define EventEnabledStrongNameVerificationStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) +#define EventEnabledStrongNameVerificationStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) // // Event Macro for StrongNameVerificationStop @@ -2852,7 +2971,7 @@ Remarks: // Enablement check macro for StrongNameVerificationStop_V1 // -#define EventEnabledStrongNameVerificationStop_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) +#define EventEnabledStrongNameVerificationStop_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) // // Event Macro for StrongNameVerificationStop_V1 @@ -2866,7 +2985,7 @@ Remarks: // Enablement check macro for AuthenticodeVerificationStart // -#define EventEnabledAuthenticodeVerificationStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x08000000) != 0) +#define EventEnabledAuthenticodeVerificationStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) // // Event Macro for AuthenticodeVerificationStart @@ -2880,7 +2999,7 @@ Remarks: // Enablement check macro for AuthenticodeVerificationStart_V1 // -#define EventEnabledAuthenticodeVerificationStart_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x08000000) != 0) +#define EventEnabledAuthenticodeVerificationStart_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) // // Event Macro for AuthenticodeVerificationStart_V1 @@ -2894,7 +3013,7 @@ Remarks: // Enablement check macro for AuthenticodeVerificationStop // -#define EventEnabledAuthenticodeVerificationStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) +#define EventEnabledAuthenticodeVerificationStop() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) // // Event Macro for AuthenticodeVerificationStop @@ -2908,7 +3027,7 @@ Remarks: // Enablement check macro for AuthenticodeVerificationStop_V1 // -#define EventEnabledAuthenticodeVerificationStop_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x10000000) != 0) +#define EventEnabledAuthenticodeVerificationStop_V1() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) // // Event Macro for AuthenticodeVerificationStop_V1 @@ -3020,7 +3139,7 @@ Remarks: // Enablement check macro for DebugIPCEventStart // -#define EventEnabledDebugIPCEventStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) +#define EventEnabledDebugIPCEventStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x40000000) != 0) // // Event Macro for DebugIPCEventStart @@ -3034,7 +3153,7 @@ Remarks: // Enablement check macro for DebugIPCEventEnd // -#define EventEnabledDebugIPCEventEnd() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) +#define EventEnabledDebugIPCEventEnd() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x40000000) != 0) // // Event Macro for DebugIPCEventEnd @@ -3048,7 +3167,7 @@ Remarks: // Enablement check macro for DebugExceptionProcessingStart // -#define EventEnabledDebugExceptionProcessingStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) +#define EventEnabledDebugExceptionProcessingStart() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x40000000) != 0) // // Event Macro for DebugExceptionProcessingStart @@ -3062,7 +3181,7 @@ Remarks: // Enablement check macro for DebugExceptionProcessingEnd // -#define EventEnabledDebugExceptionProcessingEnd() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x20000000) != 0) +#define EventEnabledDebugExceptionProcessingEnd() ((Microsoft_Windows_DotNETRuntimeEnableBits[0] & 0x40000000) != 0) // // Event Macro for DebugExceptionProcessingEnd @@ -8726,6 +8845,50 @@ MCGEN_CALLOUT(RegHandle, } #endif +// +//Template from manifest : ExceptionHandling +// +#ifndef CoTemplate_xxzh_def +#define CoTemplate_xxzh_def +ETW_INLINE +ULONG +CoTemplate_xxzh( + _In_ REGHANDLE RegHandle, + _In_ PCEVENT_DESCRIPTOR Descriptor, + _In_ unsigned __int64 _Arg0, + _In_ unsigned __int64 _Arg1, + _In_opt_ PCWSTR _Arg2, + _In_ const unsigned short _Arg3 + ) +{ +#define ARGUMENT_COUNT_xxzh 4 + ULONG Error = ERROR_SUCCESS; + + EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_xxzh]; + + EventDataDescCreate(&EventData[0], &_Arg0, sizeof(unsigned __int64) ); + + EventDataDescCreate(&EventData[1], &_Arg1, sizeof(unsigned __int64) ); + + EventDataDescCreate(&EventData[2], + (_Arg2 != NULL) ? _Arg2 : L"NULL", + (_Arg2 != NULL) ? (ULONG)((wcslen(_Arg2) + 1) * sizeof(WCHAR)) : (ULONG)sizeof(L"NULL")); + + EventDataDescCreate(&EventData[3], &_Arg3, sizeof(const unsigned short) ); + + Error = EventWrite(RegHandle, Descriptor, ARGUMENT_COUNT_xxzh, EventData); + +#ifdef MCGEN_CALLOUT +MCGEN_CALLOUT(RegHandle, + Descriptor, + ARGUMENT_COUNT_xxzh, + EventData); +#endif + + return Error; +} +#endif + // //Template from manifest : Contention // @@ -12274,6 +12437,7 @@ MCGEN_CALLOUT(RegHandle, #define MSG_RuntimePublisher_StackKeywordMessage 0x1000001FL #define MSG_RuntimePublisher_ThreadTransferKeywordMessage 0x10000020L #define MSG_RuntimePublisher_DebuggerKeywordMessage 0x10000021L +#define MSG_RuntimePublisher_MonitoringKeywordMessage 0x10000022L #define MSG_RundownPublisher_LoaderKeywordMessage 0x11000004L #define MSG_RundownPublisher_JitKeywordMessage 0x11000005L #define MSG_RundownPublisher_NGenKeywordMessage 0x11000006L @@ -12558,6 +12722,9 @@ MCGEN_CALLOUT(RegHandle, #define MSG_RuntimePublisher_ThreadTaskMessage 0x70000018L #define MSG_RuntimePublisher_DebugIPCEventTaskMessage 0x70000019L #define MSG_RuntimePublisher_DebugExceptionProcessingTaskMessage 0x7000001AL +#define MSG_RuntimePublisher_ExceptionCatchTaskMessage 0x7000001BL +#define MSG_RuntimePublisher_ExceptionFinallyTaskMessage 0x7000001CL +#define MSG_RuntimePublisher_ExceptionFilterTaskMessage 0x7000001DL #define MSG_RundownPublisher_MethodTaskMessage 0x71000001L #define MSG_RundownPublisher_LoaderTaskMessage 0x71000002L #define MSG_RundownPublisher_StackTaskMessage 0x7100000BL @@ -12679,6 +12846,8 @@ MCGEN_CALLOUT(RegHandle, #define MSG_RuntimePublisher_IncreaseMemoryPressureEventMessage 0xB00000C8L #define MSG_RuntimePublisher_DecreaseMemoryPressureEventMessage 0xB00000C9L #define MSG_RuntimePublisher_GCMarkWithTypeEventMessage 0xB00000CAL +#define MSG_RuntimePublisher_ExceptionExceptionHandlingEventMessage 0xB00000FAL +#define MSG_RuntimePublisher_ExceptionExceptionHandlingNoneEventMessage 0xB00000FBL #define MSG_RuntimePublisher_GCStart_V1EventMessage 0xB0010001L #define MSG_RuntimePublisher_GCEnd_V1EventMessage 0xB0010002L #define MSG_RuntimePublisher_GCRestartEEEnd_V1EventMessage 0xB0010003L diff --git a/src/pal/prebuilt/inc/clretwallmain.h b/src/pal/prebuilt/inc/clretwallmain.h index 57fca4aa80..a17e84cd15 100644 --- a/src/pal/prebuilt/inc/clretwallmain.h +++ b/src/pal/prebuilt/inc/clretwallmain.h @@ -9,7 +9,7 @@ #define MAX_BYTES_PER_ETW_PROVIDER 64 EXTERN_C __declspec(selectany) const BYTE etwStackSupportedEvents[NO_OF_ETW_PROVIDERS][MAX_BYTES_PER_ETW_PROVIDER] = { - {0, 4, 16, 192, 9, 255, 3, 241, 195, 0, 251, 3, 0, 0, 0, 0, 128, 31, 226, 63, 0, 0, 64, 65, 0, 43, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 4, 16, 192, 9, 255, 3, 241, 195, 0, 251, 3, 0, 0, 0, 0, 128, 31, 226, 63, 0, 0, 64, 65, 0, 43, 0, 0, 0, 0, 15, 252, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, diff --git a/src/pal/prebuilt/inc/etmdummy.h b/src/pal/prebuilt/inc/etmdummy.h index 6a2456a12c..983bba67b3 100644 --- a/src/pal/prebuilt/inc/etmdummy.h +++ b/src/pal/prebuilt/inc/etmdummy.h @@ -88,6 +88,13 @@ #define FireEtwThreadRunning(ID, ClrInstanceID) 0 #define FireEtwExceptionThrown() 0 #define FireEtwExceptionThrown_V1(ExceptionType, ExceptionMessage, ExceptionEIP, ExceptionHRESULT, ExceptionFlags, ClrInstanceID) 0 +#define FireEtwExceptionCatchStart(EntryEIP, MethodID, MethodName, ClrInstanceID) 0 +#define FireEtwExceptionCatchStop() 0 +#define FireEtwExceptionFinallyStart(EntryEIP, MethodID, MethodName, ClrInstanceID) 0 +#define FireEtwExceptionFinallyStop() 0 +#define FireEtwExceptionFilterStart(EntryEIP, MethodID, MethodName, ClrInstanceID) 0 +#define FireEtwExceptionFilterStop() 0 +#define FireEtwExceptionThrownStop() 0 #define FireEtwContention() 0 #define FireEtwContentionStart_V1(ContentionFlags, ClrInstanceID) 0 #define FireEtwContentionStop(ContentionFlags, ClrInstanceID) 0 diff --git a/src/vm/ClrEtwAll.man b/src/vm/ClrEtwAll.man index ea3c4da935..71b7346878 100644 --- a/src/vm/ClrEtwAll.man +++ b/src/vm/ClrEtwAll.man @@ -71,6 +71,8 @@ message="$(string.RuntimePublisher.ThreadTransferKeywordMessage)" symbol="CLR_THREADTRANSFER_KEYWORD"/> + @@ -163,7 +165,28 @@ - + + + + + + + + + + + + + + + @@ -339,6 +362,7 @@ + @@ -1326,6 +1350,21 @@ + +