@@ -4198,8 +4198,6 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4198
4198
4199
4199
OPCODE opcode;
4200
4200
4201
- const char * inlineFailReason = NULL;
4202
-
4203
4201
var_types varType = DUMMY_INIT(TYP_UNDEF); // TYP_ type
4204
4202
typeInfo ti; // Verifier type.
4205
4203
@@ -4436,10 +4434,13 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4436
4434
4437
4435
#ifdef FEATURE_LEGACYNETCF
4438
4436
4439
- if (stateNetCFQuirks >= 0)
4437
+ if (compIsForInlining())
4440
4438
{
4441
- inlineFailReason = "Windows Phone OS 7 compatibility - Inlinee contains control flow.";
4442
- goto InlineNever;
4439
+ if (stateNetCFQuirks >= 0)
4440
+ {
4441
+ compInlineResult->setNever("Windows Phone OS 7 compatibility - Inlinee contains control flow");
4442
+ return;
4443
+ }
4443
4444
}
4444
4445
4445
4446
#endif // FEATURE_LEGACYNETCF
@@ -4483,14 +4484,14 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4483
4484
4484
4485
if (stateNetCFQuirks >= 0)
4485
4486
{
4486
- inlineFailReason = "Windows Phone OS 7 compatibility - Inlinee contains control flow." ;
4487
- goto InlineNever ;
4487
+ compInlineResult->setNever( "Windows Phone OS 7 compatibility - Inlinee contains control flow") ;
4488
+ return ;
4488
4489
}
4489
4490
4490
4491
#endif // FEATURE_LEGACYNETCF
4491
4492
4492
- inlineFailReason = "Inlinee contains SWITCH instruction." ;
4493
- goto InlineFailed ;
4493
+ compInlineResult->setNever( "Inlinee contains SWITCH instruction") ;
4494
+ return ;
4494
4495
}
4495
4496
4496
4497
// Make sure we don't go past the end reading the number of cases
@@ -4549,10 +4550,13 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4549
4550
4550
4551
#ifdef FEATURE_LEGACYNETCF
4551
4552
4552
- if (stateNetCFQuirks >= 0 )
4553
+ if (compIsForInlining() )
4553
4554
{
4554
- inlineFailReason = "Windows Phone OS 7 compatibility - Inlinee contains prefix.";
4555
- goto InlineNever;
4555
+ if (stateNetCFQuirks >= 0)
4556
+ {
4557
+ compInlineResult->setNever("Windows Phone OS 7 compatibility - Inlinee contains prefix");
4558
+ return;
4559
+ }
4556
4560
}
4557
4561
4558
4562
#endif // FEATURE_LEGACYNETCF
@@ -4572,10 +4576,13 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4572
4576
4573
4577
#ifdef FEATURE_LEGACYNETCF
4574
4578
4575
- if (stateNetCFQuirks >= 0 )
4579
+ if (compIsForInlining() )
4576
4580
{
4577
- inlineFailReason = "Windows Phone OS 7 compatibility - Inlinee contains throw.";
4578
- goto InlineNever;
4581
+ if (stateNetCFQuirks >= 0)
4582
+ {
4583
+ compInlineResult->setNever("Windows Phone OS 7 compatibility - Inlinee contains throw");
4584
+ return;
4585
+ }
4579
4586
}
4580
4587
4581
4588
#endif // FEATURE_LEGACYNETCF
@@ -4624,14 +4631,16 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4624
4631
//Consider making this only for not force inline.
4625
4632
if (compIsForInlining())
4626
4633
{
4634
+ char *message;
4627
4635
#ifdef DEBUG
4628
- inlineFailReason = (char*)compAllocator->nraAlloc(128);
4629
- sprintf((char*)inlineFailReason , "Unsupported opcode for inlining: %s\n",
4636
+ message = (char*)compAllocator->nraAlloc(128);
4637
+ sprintf((char*)message , "Unsupported opcode for inlining: %s\n",
4630
4638
opcodeNames[opcode]);
4631
4639
#else
4632
- inlineFailReason = "Unsupported opcode for inlining. ";
4640
+ message = "Unsupported opcode for inlining";
4633
4641
#endif
4634
- goto InlineFailed;
4642
+ compInlineResult->setNever(message);
4643
+ return;
4635
4644
}
4636
4645
break;
4637
4646
@@ -4755,8 +4764,8 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4755
4764
stateNetCFQuirks++;
4756
4765
if (varNum != expectedVarNum)
4757
4766
{
4758
- inlineFailReason = "Windows Phone OS 7 compatibility - out of order ldarg." ;
4759
- goto InlineNever ;
4767
+ compInlineResult->setNever( "Windows Phone OS 7 compatibility - out of order ldarg") ;
4768
+ return ;
4760
4769
}
4761
4770
}
4762
4771
@@ -4770,10 +4779,13 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4770
4779
4771
4780
#ifdef FEATURE_LEGACYNETCF
4772
4781
4773
- if (stateNetCFQuirks >= 0 )
4782
+ if (compIsForInlining() )
4774
4783
{
4775
- inlineFailReason = "Windows Phone OS 7 compatibility - address taken.";
4776
- goto InlineNever;
4784
+ if (stateNetCFQuirks >= 0)
4785
+ {
4786
+ compInlineResult->setNever("Windows Phone OS 7 compatibility - address taken");
4787
+ return;
4788
+ }
4777
4789
}
4778
4790
4779
4791
#endif // FEATURE_LEGACYNETCF
@@ -4898,8 +4910,8 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
4898
4910
/* The inliner keeps the args as trees and clones them. Storing the arguments breaks that
4899
4911
* simplification. To allow this, flag the argument as written to and spill it before
4900
4912
* inlining. That way the STARG in the inlinee is trivial. */
4901
- inlineFailReason = "Inlinee writes to an argument." ;
4902
- goto InlineNever ;
4913
+ compInlineResult->setNever( "Inlinee writes to an argument") ;
4914
+ return ;
4903
4915
}
4904
4916
else
4905
4917
{
@@ -5045,28 +5057,6 @@ void Compiler::fgFindJumpTargets(const BYTE * codeAddr,
5045
5057
}
5046
5058
5047
5059
return;
5048
-
5049
- CorInfoInline failResult;
5050
- InlineNever:
5051
- compInlineResult->setNever(inlineFailReason);
5052
- goto Report;
5053
- InlineFailed:
5054
- compInlineResult->setFailure(inlineFailReason);
5055
-
5056
- Report:
5057
- #ifdef DEBUG
5058
- if (verbose)
5059
- {
5060
- impCurOpcName = opcodeNames[opcode];
5061
- printf("\n\nInline expansion aborted due to opcode [%02u] OP_%s in method %s\n",
5062
- codeAddr-codeBegp-1, impCurOpcName, info.compFullName);
5063
- }
5064
- #endif
5065
-
5066
- noway_assert(compIsForInlining());
5067
- noway_assert(impInlineInfo->fncHandle == info.compMethodHnd);
5068
-
5069
- return;
5070
5060
}
5071
5061
#ifdef _PREFAST_
5072
5062
#pragma warning(pop)
0 commit comments