diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-02-18 09:17:52 -0800 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-02-18 09:17:52 -0800 |
commit | d1cc1cc104e4ad5e32a9f287b717c6ceba33e124 (patch) | |
tree | 00f8dba31fe2e5add6a445d19d251666347742f8 | |
parent | 692e7cbeebe3017c8ff87453c50cf41748c19d6b (diff) | |
download | coreclr-d1cc1cc104e4ad5e32a9f287b717c6ceba33e124.tar.gz coreclr-d1cc1cc104e4ad5e32a9f287b717c6ceba33e124.tar.bz2 coreclr-d1cc1cc104e4ad5e32a9f287b717c6ceba33e124.zip |
Delete NetCF quirks from RyuJIT
-rw-r--r-- | src/jit/flowgraph.cpp | 138 | ||||
-rw-r--r-- | src/jit/importer.cpp | 46 | ||||
-rw-r--r-- | src/jit/inline.def | 15 |
3 files changed, 1 insertions, 198 deletions
diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp index 5a302ac05b..f84cc2c611 100644 --- a/src/jit/flowgraph.cpp +++ b/src/jit/flowgraph.cpp @@ -4261,33 +4261,6 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr, pSm->Start(this); } -#ifdef FEATURE_LEGACYNETCF - - // NetCF had some strict restrictions on inlining. Specifically they - // would only inline methods that fit a specific pattern of loading - // arguments inorder, starting with zero, with no skipping, but not - // needing to load all of them. Then a 'body' section that could do - // anything besides control flow. And a final ending ret opcode. - // Lastly they did not allow starg or ldarga. - // These simplifications allowed them to skip past the ldargs, when - // inlining, and just use the caller's EE stack as the callee's EE - // stack, after optionally popping a few 'arguments' from the end. - // - // stateNetCFQuirks is a simple state machine to track that state - // and allow us to match those restrictions. - // State -1 means we're not tracking (no quirks mode) - // State 0 though 0x0000FFFF tracks what the *next* ldarg should be - // to match the pattern - // State 0x00010000 and above means we are in the 'body' section and - // thus no more ldarg's are allowed. - int stateNetCFQuirks = -1; - if (compIsForInlining() && (opts.eeFlags & CORJIT_FLG_NETCF_QUIRKS)) - { - stateNetCFQuirks = 0; - } - -#endif // FEATURE_LEGACYNETCF - while (codeAddr < codeEndp) { unsigned sz; @@ -4303,20 +4276,6 @@ DECODE_OPCODE: if (opcode >= CEE_COUNT) BADCODE3("Illegal opcode", ": %02X", (int) opcode); -#ifdef FEATURE_LEGACYNETCF - - // If this is the first non-ldarg, then transition states - if ((0 == (stateNetCFQuirks & 0x10000)) && - ((opcode < CEE_LDARG_0) || (opcode > CEE_LDARG_3)) && - (opcode != CEE_LDARG_S) && (opcode != CEE_LDARG) && (opcode != CEE_PREFIX1)) - { - // Maximum number of arguments is 2^16 - 1 - // so this value will never line up with any ldarg - stateNetCFQuirks = 0x10000; - } - -#endif // FEATURE_LEGACYNETCF - if ((opcode >= CEE_LDARG_0 && opcode <= CEE_STLOC_S) || (opcode >= CEE_LDARG && opcode <= CEE_STLOC)) { @@ -4432,19 +4391,6 @@ DECODE_OPCODE: if (codeAddr > codeEndp - sz) goto TOO_FAR; -#ifdef FEATURE_LEGACYNETCF - - if (compIsForInlining()) - { - if (stateNetCFQuirks >= 0) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_CONTROL_FLOW); - return; - } - } - -#endif // FEATURE_LEGACYNETCF - /* Compute the target address of the jump */ jmpDist = (sz==1) ? getI1LittleEndian(codeAddr) @@ -4479,17 +4425,6 @@ DECODE_OPCODE: if (compIsForInlining()) { - -#ifdef FEATURE_LEGACYNETCF - - if (stateNetCFQuirks >= 0) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_CONTROL_FLOW); - return; - } - -#endif // FEATURE_LEGACYNETCF - compInlineResult->noteFatal(InlineObservation::CALLEE_HAS_SWITCH); return; } @@ -4547,20 +4482,6 @@ DECODE_OPCODE: case CEE_TAILCALL: if (codeAddr >= codeEndp) goto TOO_FAR; - -#ifdef FEATURE_LEGACYNETCF - - if (compIsForInlining()) - { - if (stateNetCFQuirks >= 0) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_PREFIX); - return; - } - } - -#endif // FEATURE_LEGACYNETCF - break; case CEE_STARG: @@ -4573,20 +4494,6 @@ DECODE_OPCODE: // Other opcodes that we know inliner won't handle. case CEE_THROW: - -#ifdef FEATURE_LEGACYNETCF - - if (compIsForInlining()) - { - if (stateNetCFQuirks >= 0) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_THROW); - return; - } - } - -#endif // FEATURE_LEGACYNETCF - if (seenJump) break; case CEE_ISINST: @@ -4747,41 +4654,11 @@ ARG_PUSH: if (compIsForInlining()) { pushedStack.pushArgument(varNum); - -#ifdef FEATURE_LEGACYNETCF - - if (stateNetCFQuirks >= 0) - { - unsigned expectedVarNum = (unsigned)stateNetCFQuirks; - stateNetCFQuirks++; - if (varNum != expectedVarNum) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_LDARG_ORDER); - return; - } - } - -#endif // FEATURE_LEGACYNETCF - - } + } break; ADDR_TAKEN: - -#ifdef FEATURE_LEGACYNETCF - - if (compIsForInlining()) - { - if (stateNetCFQuirks >= 0) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_ADDRESS_TAKEN); - return; - } - } - -#endif // FEATURE_LEGACYNETCF - noway_assert(sz == sizeof(BYTE) || sz == sizeof(WORD)); if (codeAddr > codeEndp - sz) goto TOO_FAR; @@ -5630,19 +5507,6 @@ GOT_ENDP: curBBdesc->bbJumpOffs = jmpAddr; break; -#ifdef FEATURE_LEGACYNETCF - case BBJ_EHFILTERRET: - if (opts.eeFlags & CORJIT_FLG_NETCF_QUIRKS) - { - // NetCF incorrectly allowed sequence of endfilter instructions at the end of the filter. Ignore the redundant endfilter instructions. - while (codeAddr + 1 < codeEndp && getU1LittleEndian(codeAddr) == CEE_PREFIX1 && getU1LittleEndian(codeAddr+1) == (CEE_ENDFILTER & 0xFF)) - codeAddr += 2; - - nxtBBoffs = (IL_OFFSET)(codeAddr - codeBegp); - } - break; -#endif - default: break; } diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 4a7e195a0a..f5b1fd3594 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -11558,10 +11558,6 @@ DO_LDFTN: // and the field it is reading, thus it is now unverifiable to not immediately precede with // ldtoken <filed token>, and we now check accessibility if ((callInfo.methodFlags & CORINFO_FLG_INTRINSIC) && -#ifdef FEATURE_LEGACYNETCF - // Obfluscators are producing non-standard patterns that are causing old phone apps to fail - !(opts.eeFlags & CORJIT_FLG_NETCF_QUIRKS) && -#endif (info.compCompHnd->getIntrinsicID(callInfo.hMethod) == CORINFO_INTRINSIC_InitializeArray)) { if (prevOpcode != CEE_LDTOKEN) @@ -15876,48 +15872,6 @@ void Compiler::impCanInlineIL(CORINFO_METHOD_HANDLE fncHandle, return; } -#ifdef FEATURE_LEGACYNETCF - - // Check for NetCF quirks mode and the NetCF restrictions - if (opts.eeFlags & CORJIT_FLG_NETCF_QUIRKS) - { - if (codeSize > 16) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_IL_TOO_BIG); - return; - } - - if (methInfo->EHcount) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_HAS_EH); - return; - } - - if (methInfo->locals.numArgs > 0) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_HAS_LOCALS); - return; - } - - if (methInfo->args.retType == CORINFO_TYPE_FLOAT) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_HAS_FP_RET); - return; - } - - CORINFO_ARG_LIST_HANDLE argLst = methInfo->args.args; - for(unsigned i = methInfo->args.numArgs; i > 0; --i, argLst = info.compCompHnd->getArgNext(argLst)) - { - if (TYP_FLOAT == eeGetArgType(argLst, &methInfo->args)) - { - compInlineResult->noteFatal(InlineObservation::CALLEE_WP7QUIRK_HAS_FP_ARG); - return; - } - } - } - -#endif // FEATURE_LEGACYNETCF - // Still a viable candidate... inlineResult->setCandidate("impCanInlineIL"); } diff --git a/src/jit/inline.def b/src/jit/inline.def index f054eb5ee4..330ab6a189 100644 --- a/src/jit/inline.def +++ b/src/jit/inline.def @@ -64,21 +64,6 @@ INLINE_OBSERVATION(TOO_MANY_ARGUMENTS, bool, "too many arguments", INLINE_OBSERVATION(TOO_MANY_LOCALS, bool, "too many locals", FATAL, CALLEE) INLINE_OBSERVATION(UNSUPPORTED_OPCODE, bool, "unsupported opcode", FATAL, CALLEE) -#ifdef FEATURE_LEGACYNETCF - -INLINE_OBSERVATION(WP7QUIRK_ADDRESS_TAKEN, bool, "WinPhone7 quirk address taken", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_CONTROL_FLOW, bool, "WinPhone7 quirk has ctl flow", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_HAS_EH, bool, "WinPhone7 quirk has eh", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_HAS_FP_ARG, bool, "WinPhone7 quirk has float arg", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_HAS_FP_RET, bool, "WinPhone7 quirk has float ret", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_HAS_LOCALS, bool, "WinPhone7 quirk has locals", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_IL_TOO_BIG, bool, "WinPhone7 quirk il too big", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_LDARG_ORDER, bool, "WinPhone7 quirk ldarg order", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_PREFIX, bool, "WinPhone7 quirk has prefix", FATAL, CALLEE) -INLINE_OBSERVATION(WP7QUIRK_THROW, bool, "WinPhone7 quirk has throw", FATAL, CALLEE) - -#endif // FEATURE_LEGACYNETCF - // ------ Callee Performance ------- INLINE_OBSERVATION(LDFLD_STATIC_VALUECLASS, bool, "ldsfld of value class", PERFORMANCE, CALLEE) |