diff --git a/src/coreclr/src/inc/clrconfigvalues.h b/src/coreclr/src/inc/clrconfigvalues.h index 56483b0a7d66d..44e08eef3ba41 100644 --- a/src/coreclr/src/inc/clrconfigvalues.h +++ b/src/coreclr/src/inc/clrconfigvalues.h @@ -280,7 +280,6 @@ RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcServer, W("gcServer"), 0, "Enables server CONFIG_STRING_INFO(INTERNAL_GcCoverage, W("GcCoverage"), "Specify a method or regular expression of method names to run with GCStress") CONFIG_STRING_INFO(INTERNAL_SkipGCCoverage, W("SkipGcCoverage"), "Specify a list of assembly names to skip with GC Coverage") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StatsUpdatePeriod, W("StatsUpdatePeriod"), 60, "Specifies the interval, in seconds, at which to update the statistics") -RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(EXTERNAL_GCPollType, W("GCPollType"), "") RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCRetainVM, W("GCRetainVM"), 0, "When set we put the segments that should be deleted on a standby list (instead of releasing them back to the OS) which will be considered to satisfy new segment requests (note that the same thing can be specified via API which is the supported way)") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCLOHThreshold, W("GCLOHThreshold"), 0, "Specifies the size that will make objects go on LOH") RETAIL_CONFIG_DWORD_INFO(EXTERNAL_gcAllowVeryLargeObjects, W("gcAllowVeryLargeObjects"), 1, "Allow allocation of 2GB+ objects on GC heap") diff --git a/src/coreclr/src/inc/corjitflags.h b/src/coreclr/src/inc/corjitflags.h index 7ec09408b3da5..5cd57af5a94ec 100644 --- a/src/coreclr/src/inc/corjitflags.h +++ b/src/coreclr/src/inc/corjitflags.h @@ -32,7 +32,7 @@ class CORJIT_FLAGS CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necesarily debuggable code) - CORJIT_FLAG_GCPOLL_CALLS = 6, // Emit calls to JIT_POLLGC for thread suspension. + CORJIT_FLAG_UNUSED1 = 6, CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete #if defined(TARGET_X86) @@ -44,11 +44,11 @@ class CORJIT_FLAGS #else // !defined(TARGET_X86) - CORJIT_FLAG_UNUSED1 = 8, - CORJIT_FLAG_UNUSED2 = 9, - CORJIT_FLAG_UNUSED3 = 10, - CORJIT_FLAG_UNUSED4 = 11, - CORJIT_FLAG_UNUSED5 = 12, + CORJIT_FLAG_UNUSED2 = 8, + CORJIT_FLAG_UNUSED3 = 9, + CORJIT_FLAG_UNUSED4 = 10, + CORJIT_FLAG_UNUSED5 = 11, + CORJIT_FLAG_UNUSED6 = 12, #endif // !defined(TARGET_X86) @@ -81,43 +81,43 @@ class CORJIT_FLAGS CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame CORJIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - CORJIT_FLAG_GCPOLL_INLINE = 34, // JIT must inline calls to GCPoll when possible + CORJIT_FLAG_UNUSED11 = 34, CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - // CORJIT_FLAG_UNUSED = 38, + CORJIT_FLAG_UNUSED12 = 38, CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code #if defined(TARGET_ARM) CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records #else // !defined(TARGET_ARM) - CORJIT_FLAG_UNUSED11 = 41, + CORJIT_FLAG_UNUSED13 = 41, #endif // !defined(TARGET_ARM) CORJIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method - CORJIT_FLAG_UNUSED12 = 43, - CORJIT_FLAG_UNUSED13 = 44, - CORJIT_FLAG_UNUSED14 = 45, - CORJIT_FLAG_UNUSED15 = 46, - CORJIT_FLAG_UNUSED16 = 47, - CORJIT_FLAG_UNUSED17 = 48, - CORJIT_FLAG_UNUSED18 = 49, - CORJIT_FLAG_UNUSED19 = 50, - CORJIT_FLAG_UNUSED20 = 51, - CORJIT_FLAG_UNUSED21 = 52, - CORJIT_FLAG_UNUSED22 = 53, - CORJIT_FLAG_UNUSED23 = 54, - CORJIT_FLAG_UNUSED24 = 55, - CORJIT_FLAG_UNUSED25 = 56, - CORJIT_FLAG_UNUSED26 = 57, - CORJIT_FLAG_UNUSED27 = 58, - CORJIT_FLAG_UNUSED28 = 59, - CORJIT_FLAG_UNUSED29 = 60, - CORJIT_FLAG_UNUSED30 = 61, - CORJIT_FLAG_UNUSED31 = 62, - CORJIT_FLAG_UNUSED32 = 63 + CORJIT_FLAG_UNUSED14 = 43, + CORJIT_FLAG_UNUSED15 = 44, + CORJIT_FLAG_UNUSED16 = 45, + CORJIT_FLAG_UNUSED17 = 46, + CORJIT_FLAG_UNUSED18 = 47, + CORJIT_FLAG_UNUSED19 = 48, + CORJIT_FLAG_UNUSED20 = 49, + CORJIT_FLAG_UNUSED21 = 50, + CORJIT_FLAG_UNUSED22 = 51, + CORJIT_FLAG_UNUSED23 = 52, + CORJIT_FLAG_UNUSED24 = 53, + CORJIT_FLAG_UNUSED25 = 54, + CORJIT_FLAG_UNUSED26 = 55, + CORJIT_FLAG_UNUSED27 = 56, + CORJIT_FLAG_UNUSED28 = 57, + CORJIT_FLAG_UNUSED29 = 58, + CORJIT_FLAG_UNUSED30 = 59, + CORJIT_FLAG_UNUSED31 = 60, + CORJIT_FLAG_UNUSED32 = 61, + CORJIT_FLAG_UNUSED33 = 62, + CORJIT_FLAG_UNUSED34 = 63 }; CORJIT_FLAGS() diff --git a/src/coreclr/src/inc/switches.h b/src/coreclr/src/inc/switches.h index c334512e9572f..f22f3e2d45032 100644 --- a/src/coreclr/src/inc/switches.h +++ b/src/coreclr/src/inc/switches.h @@ -81,9 +81,6 @@ #define ALLOW_SXS_JIT #define ALLOW_SXS_JIT_NGEN -//master switch for gc suspension not based on hijacking -#define FEATURE_ENABLE_GCPOLL - #if !defined(TARGET_UNIX) // PLATFORM_SUPPORTS_THREADSUSPEND is defined for platforms where it is safe to call // SuspendThread. This API is dangerous on non-Windows platforms, as it can lead to diff --git a/src/coreclr/src/jit/block.cpp b/src/coreclr/src/jit/block.cpp index d8ca31c6662c2..3c6fd6297dfe2 100644 --- a/src/coreclr/src/jit/block.cpp +++ b/src/coreclr/src/jit/block.cpp @@ -277,10 +277,6 @@ void BasicBlock::dspFlags() { printf("try "); } - if (bbFlags & BBF_NEEDS_GCPOLL) - { - printf("poll "); - } if (bbFlags & BBF_RUN_RARELY) { printf("rare "); diff --git a/src/coreclr/src/jit/block.h b/src/coreclr/src/jit/block.h index 26ccbd80a42a3..18e46d7a98792 100644 --- a/src/coreclr/src/jit/block.h +++ b/src/coreclr/src/jit/block.h @@ -395,7 +395,6 @@ struct BasicBlock : private LIR::Range #define BBF_TRY_BEG 0x00000100 // BB starts a 'try' block #define BBF_FUNCLET_BEG 0x00000200 // BB is the beginning of a funclet #define BBF_HAS_NULLCHECK 0x00000400 // BB contains a null check -#define BBF_NEEDS_GCPOLL 0x00000800 // This BB is the source of a back edge and needs a GC Poll #define BBF_RUN_RARELY 0x00001000 // BB is rarely run (catch clauses, blocks with throws etc) #define BBF_LOOP_HEAD 0x00002000 // BB is the head of a loop @@ -465,8 +464,8 @@ struct BasicBlock : private LIR::Range // Flags to update when two blocks are compacted #define BBF_COMPACT_UPD \ - (BBF_CHANGED | BBF_GC_SAFE_POINT | BBF_HAS_JMP | BBF_NEEDS_GCPOLL | BBF_HAS_IDX_LEN | BBF_BACKWARD_JUMP | \ - BBF_HAS_NEWARRAY | BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_VTABREF) + (BBF_CHANGED | BBF_GC_SAFE_POINT | BBF_HAS_JMP | BBF_HAS_IDX_LEN | BBF_BACKWARD_JUMP | BBF_HAS_NEWARRAY | \ + BBF_HAS_NEWOBJ | BBF_HAS_NULLCHECK | BBF_HAS_VTABREF) // Flags a block should not have had before it is split. diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp index 9f4518bf9fd1f..7c01c6968799d 100644 --- a/src/coreclr/src/jit/compiler.cpp +++ b/src/coreclr/src/jit/compiler.cpp @@ -3261,18 +3261,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) } #endif - opts.compGCPollType = GCPOLL_NONE; - if (jitFlags->IsSet(JitFlags::JIT_FLAG_GCPOLL_CALLS)) - { - opts.compGCPollType = GCPOLL_CALL; - } - else if (jitFlags->IsSet(JitFlags::JIT_FLAG_GCPOLL_INLINE)) - { - // make sure that the EE didn't set both flags. - assert(opts.compGCPollType == GCPOLL_NONE); - opts.compGCPollType = GCPOLL_INLINE; - } - #ifdef PROFILING_SUPPORTED #ifdef UNIX_AMD64_ABI if (compIsProfilerHookNeeded()) @@ -4650,18 +4638,6 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags }; DoPhase(this, PHASE_GS_COOKIE, gsPhase); - // If we need to emit GC Poll calls, mark the blocks that need them now. - // This is conservative and can be optimized later. - // - // GC Poll marking assumes block bbnums match lexical block order, - // so make sure this is the case. - // - auto gcPollPhase = [this]() { - fgRenumberBlocks(); - fgMarkGCPollBlocks(); - }; - DoPhase(this, PHASE_MARK_GC_POLL_BLOCKS, gcPollPhase); - // Compute the block and edge weights // DoPhase(this, PHASE_COMPUTE_EDGE_WEIGHTS, &Compiler::fgComputeBlockAndEdgeWeights); diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h index 8d6e3fb81f0bb..76bd5d9947260 100644 --- a/src/coreclr/src/jit/compiler.h +++ b/src/coreclr/src/jit/compiler.h @@ -5025,10 +5025,6 @@ class Compiler // Initialize the per-block variable sets (used for liveness analysis). void fgInitBlockVarSets(); - // true if we've gone through and created GC Poll calls. - bool fgGCPollsCreated; - void fgMarkGCPollBlocks(); - void fgCreateGCPolls(); PhaseStatus fgInsertGCPolls(); BasicBlock* fgCreateGCPoll(GCPollType pollType, BasicBlock* block); @@ -8888,8 +8884,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #else // !ARM_SOFTFP static const bool compUseSoftFP = false; #endif - - GCPollType compGCPollType; } opts; #ifdef ALT_JIT diff --git a/src/coreclr/src/jit/compphases.h b/src/coreclr/src/jit/compphases.h index 0fe78151c1735..50e5afad7b5a2 100644 --- a/src/coreclr/src/jit/compphases.h +++ b/src/coreclr/src/jit/compphases.h @@ -46,7 +46,6 @@ CompPhaseNameMacro(PHASE_PROMOTE_STRUCTS, "Morph - Promote Structs", CompPhaseNameMacro(PHASE_MORPH_GLOBAL, "Morph - Global", "MOR-GLOB", false, -1, false) CompPhaseNameMacro(PHASE_MORPH_END, "Morph - Finish", "MOR-END", false, -1, true) CompPhaseNameMacro(PHASE_GS_COOKIE, "GS Cookie", "GS-COOK", false, -1, false) -CompPhaseNameMacro(PHASE_MARK_GC_POLL_BLOCKS, "Mark GC poll blocks", "GC-POLL", false, -1, false) CompPhaseNameMacro(PHASE_COMPUTE_EDGE_WEIGHTS, "Compute edge weights (1, false)", "EDG-WGT", false, -1, false) #if defined(FEATURE_EH_FUNCLETS) CompPhaseNameMacro(PHASE_CREATE_FUNCLETS, "Create EH funclets", "EH-FUNC", false, -1, false) diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp index 7a178fbcc1a24..7a9fa4966be62 100644 --- a/src/coreclr/src/jit/flowgraph.cpp +++ b/src/coreclr/src/jit/flowgraph.cpp @@ -56,9 +56,6 @@ void Compiler::fgInit() /* We don't know yet which loops will always execute calls */ fgLoopCallMarked = false; - /* We haven't created GC Poll blocks yet. */ - fgGCPollsCreated = false; - /* Initialize the basic block list */ fgFirstBB = nullptr; @@ -2238,7 +2235,7 @@ bool Compiler::fgRemoveUnreachableBlocks() /* Unmark the block as removed, */ /* clear BBF_INTERNAL as well and set BBJ_IMPORTED */ - block->bbFlags &= ~(BBF_REMOVED | BBF_INTERNAL | BBF_NEEDS_GCPOLL); + block->bbFlags &= ~(BBF_REMOVED | BBF_INTERNAL); block->bbFlags |= BBF_IMPORTED; block->bbJumpKind = BBJ_THROW; block->bbSetRunRarely(); @@ -3617,73 +3614,6 @@ BasicBlock* Compiler::fgFirstBlockOfHandler(BasicBlock* block) return ehGetDsc(block->getHndIndex())->ebdHndBeg; } -/***************************************************************************** - * - * Function called to find back edges and return blocks and mark them as needing GC Polls. This marks all - * blocks. - */ -void Compiler::fgMarkGCPollBlocks() -{ - if (GCPOLL_NONE == opts.compGCPollType) - { - return; - } - -#ifdef DEBUG - /* Check that the flowgraph data (bbNum, bbRefs, bbPreds) is up-to-date */ - fgDebugCheckBBlist(); -#endif - - BasicBlock* block; - - // Return blocks always need GC polls. In addition, all back edges (including those from switch - // statements) need GC polls. The poll is on the block with the outgoing back edge (or ret), rather than - // on the destination or on the edge itself. - for (block = fgFirstBB; block; block = block->bbNext) - { - bool blockNeedsPoll = false; - switch (block->bbJumpKind) - { - case BBJ_ALWAYS: - if (block->isBBCallAlwaysPairTail()) - { - break; - } - case BBJ_COND: - blockNeedsPoll = (block->bbJumpDest->bbNum <= block->bbNum); - break; - - case BBJ_RETURN: - blockNeedsPoll = true; - break; - - case BBJ_SWITCH: - unsigned jumpCnt; - jumpCnt = block->bbJumpSwt->bbsCount; - BasicBlock** jumpTab; - jumpTab = block->bbJumpSwt->bbsDstTab; - - do - { - if ((*jumpTab)->bbNum <= block->bbNum) - { - blockNeedsPoll = true; - break; - } - } while (++jumpTab, --jumpCnt); - break; - - default: - break; - } - - if (blockNeedsPoll) - { - block->bbFlags |= BBF_NEEDS_GCPOLL; - } - } -} - void Compiler::fgInitBlockVarSets() { for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) @@ -3889,303 +3819,6 @@ PhaseStatus Compiler::fgInsertGCPolls() return result; } -/***************************************************************************** - * - * The following does the final pass on BBF_NEEDS_GCPOLL and then actually creates the GC Polls. - */ - -void Compiler::fgCreateGCPolls() -{ - if (GCPOLL_NONE == opts.compGCPollType) - { - return; - } - - bool createdPollBlocks = false; - -#ifdef DEBUG - if (verbose) - { - printf("*************** In fgCreateGCPolls() for %s\n", info.compFullName); - fgDispBasicBlocks(false); - printf("\n"); - } -#endif // DEBUG - - if (opts.OptimizationEnabled()) - { - // Remove polls from well formed loops with a constant upper bound. - for (unsigned lnum = 0; lnum < optLoopCount; ++lnum) - { - // Look for constant counted loops that run for a short duration. This logic is very similar to - // what's in code:Compiler::optUnrollLoops, since they have similar constraints. However, this - // logic is much more permissive since we're not doing a complex transformation. - - /* TODO-Cleanup: - * I feel bad cloning so much logic from optUnrollLoops - */ - - // Filter out loops not meeting the obvious preconditions. - // - if (optLoopTable[lnum].lpFlags & LPFLG_REMOVED) - { - continue; - } - - if (!(optLoopTable[lnum].lpFlags & LPFLG_CONST)) - { - continue; - } - - BasicBlock* head = optLoopTable[lnum].lpHead; - BasicBlock* bottom = optLoopTable[lnum].lpBottom; - - // Loops dominated by GC_SAFE_POINT won't have this set. - if (!(bottom->bbFlags & BBF_NEEDS_GCPOLL)) - { - continue; - } - - /* Get the loop data: - - initial constant - - limit constant - - iterator - - iterator increment - - increment operation type (i.e. ASG_ADD, ASG_SUB, etc...) - - loop test type (i.e. GT_GE, GT_LT, etc...) - */ - - int lbeg = optLoopTable[lnum].lpConstInit; - int llim = optLoopTable[lnum].lpConstLimit(); - genTreeOps testOper = optLoopTable[lnum].lpTestOper(); - - int lvar = optLoopTable[lnum].lpIterVar(); - int iterInc = optLoopTable[lnum].lpIterConst(); - genTreeOps iterOper = optLoopTable[lnum].lpIterOper(); - - var_types iterOperType = optLoopTable[lnum].lpIterOperType(); - bool unsTest = (optLoopTable[lnum].lpTestTree->gtFlags & GTF_UNSIGNED) != 0; - if (lvaTable[lvar].lvAddrExposed) - { // Can't reason about the value of the iteration variable. - continue; - } - - unsigned totalIter; - - /* Find the number of iterations - the function returns false if not a constant number */ - - if (!optComputeLoopRep(lbeg, llim, iterInc, iterOper, iterOperType, testOper, unsTest, - // The value here doesn't matter for this variation of the optimization - true, &totalIter)) - { -#ifdef DEBUG - if (verbose) - { - printf("Could not compute loop iterations for loop from " FMT_BB " to " FMT_BB, head->bbNum, - bottom->bbNum); - } -#endif // DEBUG - (void)head; // suppress gcc error. - - continue; - } - - /* Forget it if there are too many repetitions or not a constant loop */ - - static const unsigned ITER_LIMIT = 256; - if (totalIter > ITER_LIMIT) - { - continue; - } - - // It is safe to elminate the poll from this loop. - bottom->bbFlags &= ~BBF_NEEDS_GCPOLL; - -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in block " FMT_BB " because it forms a bounded counted loop\n", bottom->bbNum); - } -#endif // DEBUG - } - } - - // Final chance to optimize the polls. Move all polls in loops from the bottom of the loop up to the - // loop head. Also eliminate all epilog polls in non-leaf methods. This only works if we have dominator - // information. - if (fgDomsComputed) - { - for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) - { - if (!(block->bbFlags & BBF_NEEDS_GCPOLL)) - { - continue; - } - - if (block->bbJumpKind == BBJ_COND || block->bbJumpKind == BBJ_ALWAYS) - { - // make sure that this is loop-like - if (!fgReachable(block->bbJumpDest, block)) - { - block->bbFlags &= ~BBF_NEEDS_GCPOLL; -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in block " FMT_BB " because it is not loop\n", block->bbNum); - } -#endif // DEBUG - continue; - } - } - else if (!(block->bbJumpKind == BBJ_RETURN || block->bbJumpKind == BBJ_SWITCH)) - { - noway_assert(!"GC Poll on a block that has no control transfer."); -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in block " FMT_BB " because it is not a jump\n", block->bbNum); - } -#endif // DEBUG - block->bbFlags &= ~BBF_NEEDS_GCPOLL; - continue; - } - - // Because of block compaction, it's possible to end up with a block that is both poll and safe. - // Clean those up now. - - if (block->bbFlags & BBF_GC_SAFE_POINT) - { -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in return block " FMT_BB " because it is GC Safe\n", block->bbNum); - } -#endif // DEBUG - block->bbFlags &= ~BBF_NEEDS_GCPOLL; - continue; - } - - if (block->bbJumpKind == BBJ_RETURN) - { - if (!optReachWithoutCall(fgFirstBB, block)) - { - // check to see if there is a call along the path between the first block and the return - // block. - block->bbFlags &= ~BBF_NEEDS_GCPOLL; -#ifdef DEBUG - if (verbose) - { - printf("Removing poll in return block " FMT_BB " because it dominated by a call\n", - block->bbNum); - } -#endif // DEBUG - continue; - } - } - } - } - - noway_assert(!fgGCPollsCreated); - BasicBlock* block; - fgGCPollsCreated = true; - - // Walk through the blocks and hunt for a block that has BBF_NEEDS_GCPOLL - for (block = fgFirstBB; block; block = block->bbNext) - { - // Because of block compaction, it's possible to end up with a block that is both poll and safe. - // And if !fgDomsComputed, we won't have cleared them, so skip them now - if (!(block->bbFlags & BBF_NEEDS_GCPOLL) || (block->bbFlags & BBF_GC_SAFE_POINT)) - { - continue; - } - - // This block needs a poll. We either just insert a callout or we split the block and inline part of - // the test. This depends on the value of opts.compGCPollType. - - // If we're doing GCPOLL_CALL, just insert a GT_CALL node before the last node in the block. - CLANG_FORMAT_COMMENT_ANCHOR; - -#ifdef DEBUG - switch (block->bbJumpKind) - { - case BBJ_RETURN: - case BBJ_ALWAYS: - case BBJ_COND: - case BBJ_SWITCH: - break; - default: - noway_assert(!"Unknown block type for BBF_NEEDS_GCPOLL"); - } -#endif // DEBUG - - noway_assert(opts.compGCPollType); - - GCPollType pollType = opts.compGCPollType; - // pollType is set to either CALL or INLINE at this point. Below is the list of places where we - // can't or don't want to emit an inline check. Check all of those. If after all of that we still - // have INLINE, then emit an inline check. - - if (opts.OptimizationDisabled()) - { -#ifdef DEBUG - if (verbose) - { - printf("Selecting CALL poll in block " FMT_BB " because of debug/minopts\n", block->bbNum); - } -#endif // DEBUG - - // Don't split blocks and create inlined polls unless we're optimizing. - pollType = GCPOLL_CALL; - } - else if (genReturnBB == block) - { -#ifdef DEBUG - if (verbose) - { - printf("Selecting CALL poll in block " FMT_BB " because it is the single return block\n", block->bbNum); - } -#endif // DEBUG - - // we don't want to split the single return block - pollType = GCPOLL_CALL; - } - else if (BBJ_SWITCH == block->bbJumpKind) - { -#ifdef DEBUG - if (verbose) - { - printf("Selecting CALL poll in block " FMT_BB " because it is a loop formed by a SWITCH\n", - block->bbNum); - } -#endif // DEBUG - - // I don't want to deal with all the outgoing edges of a switch block. - pollType = GCPOLL_CALL; - } - - // TODO-Cleanup: potentially don't split if we're in an EH region. - - BasicBlock* curBasicBlock = fgCreateGCPoll(pollType, block); - createdPollBlocks |= (block != curBasicBlock); - } - - // If we split a block to create a GC Poll, then rerun fgReorderBlocks to push the rarely run blocks out - // past the epilog. We should never split blocks unless we're optimizing. - if (createdPollBlocks) - { - noway_assert(opts.OptimizationEnabled()); - fgReorderBlocks(); - fgUpdateChangedFlowGraph(); - } -#ifdef DEBUG - if (verbose) - { - printf("*************** After fgCreateGCPolls()\n"); - fgDispBasicBlocks(true); - } -#endif // DEBUG -} - //------------------------------------------------------------------------------ // fgCreateGCPoll : Insert a GC poll of the specified type for the given basic block. // @@ -4446,10 +4079,6 @@ BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block) NO_WAY("Unknown block type for updating predecessor lists."); } - top->bbFlags &= ~BBF_NEEDS_GCPOLL; - noway_assert(!(poll->bbFlags & BBF_NEEDS_GCPOLL)); - noway_assert(!(bottom->bbFlags & BBF_NEEDS_GCPOLL)); - if (compCurBB == top) { compCurBB = bottom; @@ -8109,11 +7738,6 @@ inline void Compiler::fgLoopCallTest(BasicBlock* srcBB, BasicBlock* dstBB) dstBB->bbFlags |= BBF_LOOP_CALL1; } } - // if this loop will always call, then we can omit the GC Poll - if ((GCPOLL_NONE != opts.compGCPollType) && (dstBB->bbFlags & BBF_LOOP_CALL1)) - { - srcBB->bbFlags &= ~BBF_NEEDS_GCPOLL; - } } /***************************************************************************** @@ -8204,8 +7828,6 @@ inline void Compiler::fgMarkLoopHead(BasicBlock* block) printf("this block will execute a call\n"); } #endif - // single block loops that contain GC safe points don't need polls. - block->bbFlags &= ~BBF_NEEDS_GCPOLL; return; } @@ -8254,26 +7876,13 @@ inline void Compiler::fgMarkLoopHead(BasicBlock* block) return; } - // only enable fully interruptible code for if we're hijacking. - if (GCPOLL_NONE == opts.compGCPollType) - { #ifdef DEBUG - if (verbose) - { - printf("no guaranteed callsite exits, marking method as fully interruptible\n"); - } -#endif - SetInterruptible(true); - } - else + if (verbose) { -#ifdef DEBUG - if (verbose) - { - printf("no guaranteed callsite exits, but we are using GC Poll calls\n"); - } -#endif + printf("no guaranteed callsite exits, marking method as fully interruptible\n"); } +#endif + SetInterruptible(true); } GenTree* Compiler::fgGetCritSectOfStaticMethod() @@ -11235,7 +10844,6 @@ void Compiler::fgRemoveConditionalJump(BasicBlock* block) // Change the BBJ_COND to BBJ_NONE, and adjust the refCount and dupCount. block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; --block->bbNext->bbRefs; --flow->flDupCount; @@ -11523,7 +11131,6 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) // because that would violate our invariant that BBJ_CALLFINALLY blocks are followed by // BBJ_ALWAYS blocks. bPrev->bbJumpKind = BBJ_NONE; - bPrev->bbFlags &= ~BBF_NEEDS_GCPOLL; } // If this is the first Cold basic block update fgFirstColdBlock @@ -11812,7 +11419,6 @@ void Compiler::fgRemoveBlock(BasicBlock* block, bool unreachable) { // It's safe to change the jump type bPrev->bbJumpKind = BBJ_NONE; - bPrev->bbFlags &= ~BBF_NEEDS_GCPOLL; } } break; @@ -11960,7 +11566,6 @@ BasicBlock* Compiler::fgConnectFallThrough(BasicBlock* bSrc, BasicBlock* bDst) (bSrc->bbJumpDest == bSrc->bbNext)) { bSrc->bbJumpKind = BBJ_NONE; - bSrc->bbFlags &= ~BBF_NEEDS_GCPOLL; #ifdef DEBUG if (verbose) { @@ -15207,7 +14812,6 @@ bool Compiler::fgOptimizeBranchToNext(BasicBlock* block, BasicBlock* bNext, Basi { /* the unconditional jump is to the next BB */ block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; #ifdef DEBUG if (verbose) { @@ -15325,7 +14929,6 @@ bool Compiler::fgOptimizeBranchToNext(BasicBlock* block, BasicBlock* bNext, Basi /* Conditional is gone - simply fall into the next block */ block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; /* Update bbRefs and bbNum - Conditional predecessors to the same * block are counted twice so we have to remove one of them */ @@ -19570,8 +19173,7 @@ void Compiler::fgSetBlockOrder() } } } - // only enable fully interruptible code for if we're hijacking. - else if (GCPOLL_NONE == opts.compGCPollType) + else { /* If we don't have the dominators, use an abbreviated test for fully interruptible. If there are * any back edges, check the source and destination blocks to see if they're GC Safe. If not, then @@ -19629,11 +19231,6 @@ void Compiler::fgSetBlockOrder() } } - if (!fgGCPollsCreated) - { - fgCreateGCPolls(); - } - for (BasicBlock* block = fgFirstBB; block; block = block->bbNext) { @@ -19641,15 +19238,6 @@ void Compiler::fgSetBlockOrder() #ifndef JIT32_GCENCODER if (block->endsWithTailCallOrJmp(this, true) && optReachWithoutCall(fgFirstBB, block)) { - // We have a tail call that is reachable without making any other - // 'normal' call that would have counted as a GC Poll. If we were - // using polls, all return blocks meeting this criteria would have - // already added polls and then marked as being GC safe - // (BBF_GC_SAFE_POINT). Thus we can only reach here when *NOT* - // using GC polls, but instead relying on the JIT to generate - // fully-interruptible code. - noway_assert(GCPOLL_NONE == opts.compGCPollType); - // This tail call might combine with other tail calls to form a // loop. Thus we need to either add a poll, or make the method // fully interruptible. I chose the later because that's what @@ -21582,12 +21170,6 @@ void Compiler::fgDebugCheckBBlist(bool checkBBNum /* = false */, bool checkBBRef assert(block->lastNode()->gtNext == nullptr && (block->lastNode()->gtOper == GT_SWITCH || block->lastNode()->gtOper == GT_SWITCH_TABLE)); } - else if (!(block->bbJumpKind == BBJ_ALWAYS || block->bbJumpKind == BBJ_RETURN || - block->bbJumpKind == BBJ_NONE || block->bbJumpKind == BBJ_THROW)) - { - // this block cannot have a poll - assert(!(block->bbFlags & BBF_NEEDS_GCPOLL)); - } if (block->bbCatchTyp == BBCT_FILTER) { diff --git a/src/coreclr/src/jit/jitee.h b/src/coreclr/src/jit/jitee.h index a12f7f29329b0..25ff8b835d5a3 100644 --- a/src/coreclr/src/jit/jitee.h +++ b/src/coreclr/src/jit/jitee.h @@ -17,7 +17,7 @@ class JitFlags JIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode JIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info JIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necesarily debuggable code) - JIT_FLAG_GCPOLL_CALLS = 6, // Emit calls to JIT_POLLGC for thread suspension. + JIT_FLAG_UNUSED1 = 6, JIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete #if defined(TARGET_X86) @@ -29,11 +29,11 @@ class JitFlags #else // !defined(TARGET_X86) - JIT_FLAG_UNUSED1 = 8, - JIT_FLAG_UNUSED2 = 9, - JIT_FLAG_UNUSED3 = 10, - JIT_FLAG_UNUSED4 = 11, - JIT_FLAG_UNUSED5 = 12, + JIT_FLAG_UNUSED2 = 8, + JIT_FLAG_UNUSED3 = 9, + JIT_FLAG_UNUSED4 = 10, + JIT_FLAG_UNUSED5 = 11, + JIT_FLAG_UNUSED6 = 12, #endif // !defined(TARGET_X86) @@ -65,43 +65,43 @@ class JitFlags JIT_FLAG_FRAMED = 31, // All methods have an EBP frame JIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries JIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - JIT_FLAG_GCPOLL_INLINE = 34, // JIT must inline calls to GCPoll when possible + JIT_FLAG_UNUSED11 = 34, JIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background JIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions JIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - // JIT_FLAG_UNUSED = 38, + JIT_FLAG_UNUSED12 = 38, JIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible JIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code #if defined(TARGET_ARM) JIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records #else // !defined(TARGET_ARM) - JIT_FLAG_UNUSED11 = 41, + JIT_FLAG_UNUSED13 = 41, #endif // !defined(TARGET_ARM) JIT_FLAG_NO_INLINING = 42, // JIT should not inline any called method into this method - JIT_FLAG_UNUSED12 = 43, - JIT_FLAG_UNUSED13 = 44, - JIT_FLAG_UNUSED14 = 45, - JIT_FLAG_UNUSED15 = 46, - JIT_FLAG_UNUSED16 = 47, - JIT_FLAG_UNUSED17 = 48, - JIT_FLAG_UNUSED18 = 49, - JIT_FLAG_UNUSED19 = 50, - JIT_FLAG_UNUSED20 = 51, - JIT_FLAG_UNUSED21 = 52, - JIT_FLAG_UNUSED22 = 53, - JIT_FLAG_UNUSED23 = 54, - JIT_FLAG_UNUSED24 = 55, - JIT_FLAG_UNUSED25 = 56, - JIT_FLAG_UNUSED26 = 57, - JIT_FLAG_UNUSED27 = 58, - JIT_FLAG_UNUSED28 = 59, - JIT_FLAG_UNUSED29 = 60, - JIT_FLAG_UNUSED30 = 61, - JIT_FLAG_UNUSED31 = 62, - JIT_FLAG_UNUSED32 = 63 + JIT_FLAG_UNUSED14 = 43, + JIT_FLAG_UNUSED15 = 44, + JIT_FLAG_UNUSED16 = 45, + JIT_FLAG_UNUSED17 = 46, + JIT_FLAG_UNUSED18 = 47, + JIT_FLAG_UNUSED19 = 48, + JIT_FLAG_UNUSED20 = 49, + JIT_FLAG_UNUSED21 = 50, + JIT_FLAG_UNUSED22 = 51, + JIT_FLAG_UNUSED23 = 52, + JIT_FLAG_UNUSED24 = 53, + JIT_FLAG_UNUSED25 = 54, + JIT_FLAG_UNUSED26 = 55, + JIT_FLAG_UNUSED27 = 56, + JIT_FLAG_UNUSED28 = 57, + JIT_FLAG_UNUSED29 = 58, + JIT_FLAG_UNUSED30 = 59, + JIT_FLAG_UNUSED31 = 60, + JIT_FLAG_UNUSED32 = 61, + JIT_FLAG_UNUSED33 = 62, + JIT_FLAG_UNUSED34 = 63 }; // clang-format on @@ -169,7 +169,6 @@ class JitFlags FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_EnC, JIT_FLAG_DEBUG_EnC); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_DEBUG_INFO, JIT_FLAG_DEBUG_INFO); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MIN_OPT, JIT_FLAG_MIN_OPT); - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_CALLS, JIT_FLAG_GCPOLL_CALLS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_MCJIT_BACKGROUND, JIT_FLAG_MCJIT_BACKGROUND); #if defined(TARGET_X86) @@ -203,7 +202,6 @@ class JitFlags FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_FRAMED, JIT_FLAG_FRAMED); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_ALIGN_LOOPS, JIT_FLAG_ALIGN_LOOPS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_PUBLISH_SECRET_PARAM, JIT_FLAG_PUBLISH_SECRET_PARAM); - FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_INLINE, JIT_FLAG_GCPOLL_INLINE); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_SAMPLING_JIT_BACKGROUND, JIT_FLAG_SAMPLING_JIT_BACKGROUND); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_USE_PINVOKE_HELPERS, JIT_FLAG_USE_PINVOKE_HELPERS); FLAGS_EQUAL(CORJIT_FLAGS::CORJIT_FLAG_REVERSE_PINVOKE, JIT_FLAG_REVERSE_PINVOKE); diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp index 6b75dadc3b620..48648620d4087 100644 --- a/src/coreclr/src/jit/morph.cpp +++ b/src/coreclr/src/jit/morph.cpp @@ -15856,9 +15856,8 @@ bool Compiler::fgFoldConditional(BasicBlock* block) /* JTRUE 0 - transform the basic block into a BBJ_NONE */ block->bbJumpKind = BBJ_NONE; - noway_assert(!(block->bbFlags & BBF_NEEDS_GCPOLL)); - bTaken = block->bbNext; - bNotTaken = block->bbJumpDest; + bTaken = block->bbNext; + bNotTaken = block->bbJumpDest; } if (fgHaveValidEdgeWeights) @@ -16079,18 +16078,11 @@ bool Compiler::fgFoldConditional(BasicBlock* block) /* transform the basic block into a BBJ_ALWAYS */ block->bbJumpKind = BBJ_ALWAYS; block->bbJumpDest = curJump; - - // if we are jumping backwards, make sure we have a GC Poll. - if (curJump->bbNum > block->bbNum) - { - block->bbFlags &= ~BBF_NEEDS_GCPOLL; - } } else { /* transform the basic block into a BBJ_NONE */ block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~BBF_NEEDS_GCPOLL; } foundVal = true; } diff --git a/src/coreclr/src/jit/optimizer.cpp b/src/coreclr/src/jit/optimizer.cpp index e7abb095793c9..e5e664d7ff41b 100644 --- a/src/coreclr/src/jit/optimizer.cpp +++ b/src/coreclr/src/jit/optimizer.cpp @@ -3798,8 +3798,6 @@ void Compiler::optUnrollLoops() testCopyStmt->SetRootNode(sideEffList); } newBlock->bbJumpKind = BBJ_NONE; - newBlock->bbFlags &= - ~BBF_NEEDS_GCPOLL; // Clear any NEEDS_GCPOLL flag as this block no longer can be a back edge // Exit this loop; we've walked all the blocks. break; @@ -3842,7 +3840,7 @@ void Compiler::optUnrollLoops() { block->bbStmtList = nullptr; block->bbJumpKind = BBJ_NONE; - block->bbFlags &= ~(BBF_NEEDS_GCPOLL | BBF_LOOP_HEAD); + block->bbFlags &= ~BBF_LOOP_HEAD; if (block->bbJumpDest != nullptr) { block->bbJumpDest = nullptr; @@ -3871,7 +3869,6 @@ void Compiler::optUnrollLoops() initStmt->SetNextStmt(nullptr); preHeaderStmt->SetPrevStmt(initStmt); head->bbJumpKind = BBJ_NONE; - head->bbFlags &= ~BBF_NEEDS_GCPOLL; } else { diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs index 0bacc4f0e999c..e07c0f77cf2ef 100644 --- a/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs +++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoTypes.cs @@ -1261,14 +1261,14 @@ public enum CorJitFlag : uint CORJIT_FLAG_DEBUG_EnC = 3, // We are in Edit-n-Continue mode CORJIT_FLAG_DEBUG_INFO = 4, // generate line and local-var info CORJIT_FLAG_MIN_OPT = 5, // disable all jit optimizations (not necesarily debuggable code) - CORJIT_FLAG_GCPOLL_CALLS = 6, // Emit calls to JIT_POLLGC for thread suspension. + CORJIT_FLAG_UNUSED1 = 6, CORJIT_FLAG_MCJIT_BACKGROUND = 7, // Calling from multicore JIT background thread, do not call JitComplete - CORJIT_FLAG_UNUSED1 = 8, - CORJIT_FLAG_UNUSED2 = 9, - CORJIT_FLAG_UNUSED3 = 10, - CORJIT_FLAG_UNUSED4 = 11, - CORJIT_FLAG_UNUSED5 = 12, - CORJIT_FLAG_UNUSED6 = 13, + CORJIT_FLAG_UNUSED2 = 8, + CORJIT_FLAG_UNUSED3 = 9, + CORJIT_FLAG_UNUSED4 = 10, + CORJIT_FLAG_UNUSED5 = 11, + CORJIT_FLAG_UNUSED6 = 12, + CORJIT_FLAG_UNUSED7 = 13, CORJIT_FLAG_FEATURE_SIMD = 17, CORJIT_FLAG_MAKEFINALCODE = 18, // Use the final code generator, i.e., not the interpreter. CORJIT_FLAG_READYTORUN = 19, // Use version-resilient code generation @@ -1286,11 +1286,11 @@ public enum CorJitFlag : uint CORJIT_FLAG_FRAMED = 31, // All methods have an EBP frame CORJIT_FLAG_ALIGN_LOOPS = 32, // add NOPs before loops to align them at 16 byte boundaries CORJIT_FLAG_PUBLISH_SECRET_PARAM = 33, // JIT must place stub secret param into local 0. (used by IL stubs) - CORJIT_FLAG_GCPOLL_INLINE = 34, // JIT must inline calls to GCPoll when possible + CORJIT_FLAG_UNUSED8 = 34, CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background CORJIT_FLAG_USE_PINVOKE_HELPERS = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions CORJIT_FLAG_REVERSE_PINVOKE = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog - // CORJIT_FLAG_UNUSED = 38, + CORJIT_FLAG_UNUSED9 = 38, CORJIT_FLAG_TIER0 = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible CORJIT_FLAG_TIER1 = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code CORJIT_FLAG_RELATIVE_CODE_RELOCS = 41, // JIT should generate PC-relative address computations instead of EE relocation records diff --git a/src/coreclr/src/vm/eeconfig.cpp b/src/coreclr/src/vm/eeconfig.cpp index 9a2a0d1a7c6b0..389e4024e8c3b 100644 --- a/src/coreclr/src/vm/eeconfig.cpp +++ b/src/coreclr/src/vm/eeconfig.cpp @@ -212,8 +212,6 @@ HRESULT EEConfig::Init() dwNgenForceFailureKind = 0; #endif - iGCPollType = GCPOLL_TYPE_DEFAULT; - #ifdef _DEBUG fShouldInjectFault = 0; testThreadAbort = 0; @@ -840,21 +838,6 @@ fTrackDynamicMethodDebugInfo = CLRConfig::GetConfigValue(CLRConfig::UNSUPPORTED_ #endif #endif // FEATURE_PREJIT - DWORD iGCPollTypeOverride = GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_GCPollType, iGCPollType); - -#ifndef FEATURE_HIJACK - // Platforms that do not support hijacking MUST support GC polling. - // Reject attempts by the user to configure the GC polling type as - // GCPOLL_TYPE_HIJACK. - _ASSERTE(EEConfig::GCPOLL_TYPE_HIJACK != iGCPollTypeOverride); - if (EEConfig::GCPOLL_TYPE_HIJACK == iGCPollTypeOverride) - iGCPollTypeOverride = EEConfig::GCPOLL_TYPE_DEFAULT; -#endif - - _ASSERTE(iGCPollTypeOverride < GCPOLL_TYPE_COUNT); - if (iGCPollTypeOverride < GCPOLL_TYPE_COUNT) - iGCPollType = GCPollType(iGCPollTypeOverride); - #if defined(_DEBUG) && defined(FEATURE_EH_FUNCLETS) fSuppressLockViolationsOnReentryFromOS = (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_SuppressLockViolationsOnReentryFromOS) != 0); #endif diff --git a/src/coreclr/src/vm/eeconfig.h b/src/coreclr/src/vm/eeconfig.h index 357ffe906b9af..46616fa1f5d00 100644 --- a/src/coreclr/src/vm/eeconfig.h +++ b/src/coreclr/src/vm/eeconfig.h @@ -511,15 +511,6 @@ class EEConfig DWORD NgenForceFailureCount() { LIMITED_METHOD_CONTRACT; return dwNgenForceFailureCount; } DWORD NgenForceFailureKind() { LIMITED_METHOD_CONTRACT; return dwNgenForceFailureKind; } #endif - enum GCPollType - { - GCPOLL_TYPE_DEFAULT, // Use the default gc poll for the platform - GCPOLL_TYPE_HIJACK, // Depend on thread hijacking for gc suspension - GCPOLL_TYPE_POLL, // Emit function calls to a helper for GC Poll - GCPOLL_TYPE_INLINE, // Emit inlined tests to the helper for GC Poll - GCPOLL_TYPE_COUNT - }; - GCPollType GetGCPollType() { LIMITED_METHOD_CONTRACT; return iGCPollType; } #ifdef _DEBUG @@ -732,8 +723,6 @@ class EEConfig DWORD dwNgenForceFailureKind; #endif - GCPollType iGCPollType; - #ifdef _DEBUG DWORD fShouldInjectFault; DWORD testThreadAbort; diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp index dde3fd9dfd854..873123803ff00 100644 --- a/src/coreclr/src/vm/jitinterface.cpp +++ b/src/coreclr/src/vm/jitinterface.cpp @@ -12496,16 +12496,6 @@ CorJitResult CallCompileMethodWithSEHWrapper(EEJitManager *jitMgr, flags.Set(CORJIT_FLAGS::CORJIT_FLAG_PINVOKE_RESTORE_ESP); #endif // TARGET_X86 - //See if we should instruct the JIT to emit calls to JIT_PollGC for thread suspension. If we have a - //non-default value in the EE Config, then use that. Otherwise select the platform specific default. -#ifdef FEATURE_ENABLE_GCPOLL - EEConfig::GCPollType pollType = g_pConfig->GetGCPollType(); - if (EEConfig::GCPOLL_TYPE_POLL == pollType) - flags.Set(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_CALLS); - else if (EEConfig::GCPOLL_TYPE_INLINE == pollType) - flags.Set(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_INLINE); -#endif //FEATURE_ENABLE_GCPOLL - // Set flags based on method's ImplFlags. if (!ftn->IsNoMetadata()) { diff --git a/src/coreclr/src/vm/threadsuspend.cpp b/src/coreclr/src/vm/threadsuspend.cpp index b941d60540b3b..dacf93ef8f758 100644 --- a/src/coreclr/src/vm/threadsuspend.cpp +++ b/src/coreclr/src/vm/threadsuspend.cpp @@ -5815,18 +5815,7 @@ BOOL Thread::HandledJITCase() if (GetReturnAddressHijackInfo(&codeInfo, &returnKind)) { - -#ifdef FEATURE_ENABLE_GCPOLL - // On platforms that support both hijacking and GC polling - // decide whether to hijack based on a configuration value. - // COMPlus_GCPollType = 1 is the setting that enables hijacking - // in GCPOLL enabled builds. - EEConfig::GCPollType pollType = g_pConfig->GetGCPollType(); - if (EEConfig::GCPOLL_TYPE_HIJACK == pollType || EEConfig::GCPOLL_TYPE_DEFAULT == pollType) -#endif // FEATURE_ENABLE_GCPOLL - { - HijackThread(returnKind, &esb); - } + HijackThread(returnKind, &esb); } } } diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index 5fad49e2ff0a0..c6eba2b1601bb 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -179,13 +179,6 @@ CORJIT_FLAGS ZapInfo::ComputeJitFlags(CORINFO_METHOD_HANDLE handle) if (m_zapper->m_pOpt->m_noProcedureSplitting) jitFlags.Clear(CORJIT_FLAGS::CORJIT_FLAG_PROCSPLIT); - //never emit inlined polls for NGen'd code. The extra indirection is not optimal. - if (jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_INLINE)) - { - jitFlags.Clear(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_INLINE); - jitFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_GCPOLL_CALLS); - } - // If the method is specified for min-opts then turn everything off if (jitFlags.IsSet(CORJIT_FLAGS::CORJIT_FLAG_MIN_OPT)) {