Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ static void ProcessIsDirectBinding (MethodDefinition caller, Instruction ins)
Nop (ins); // ldfld MonoTouch.Foundation.IsDirectBinding
Instruction next = ins.Next; // brfalse IL_x (SuperHandle processing)
Instruction end = null;
// unoptimized compiled code can produce a (unneeeded) store/load combo, leave it there
while (next.OpCode.FlowControl != FlowControl.Cond_Branch)
next = next.Next; // leave the code there (the JIT/AOT will deal with it)
ins = (next.Operand as Instruction).Previous; // br end (ret)
if (ins.OpCode.Code == Code.Ret) { // if there's not branch but it returns immediately then do not remove the 'ret' instruction
ins = ins.Next;
Expand Down