本文整理汇总了C#中Window.DeletePrevious方法的典型用法代码示例。如果您正苦于以下问题:C# Window.DeletePrevious方法的具体用法?C# Window.DeletePrevious怎么用?C# Window.DeletePrevious使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.DeletePrevious方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ImproveBranchAndJump
/// <summary>
/// Improves the branch and jump.
/// </summary>
/// <param name="window">The window.</param>
/// <returns></returns>
private bool ImproveBranchAndJump(Window window)
{
if (window.Size < 3)
return false;
if (!(window.Previous.Instruction is Instructions.Jmp))
return false;
if (!(window.PreviousPrevious.Instruction is Instructions.Branch))
return false;
if (window.Previous.BasicBlock != window.PreviousPrevious.BasicBlock)
return false;
if (window.Current.BasicBlock == window.Previous.BasicBlock)
return false;
if (window.PreviousPrevious.BranchTargets[0] != window.Current.BasicBlock.Label)
return false;
Debug.Assert(window.PreviousPrevious.BranchTargets.Length == 1);
// Negate branch condition
window.PreviousPrevious.ConditionCode = GetOppositeConditionCode(window.PreviousPrevious.ConditionCode);
// Change branch target
window.PreviousPrevious.BranchTargets[0] = window.Previous.BranchTargets[0];
// Delete jump
window.DeletePrevious();
return true;
}
示例2: RemoveSingleLineJump
/// <summary>
/// Removes the single line jump.
/// </summary>
/// <param name="window">The window.</param>
/// <returns></returns>
private bool RemoveSingleLineJump(Window window)
{
if (window.Size < 2)
return false;
if (!(window.Previous.Instruction is Instructions.Jmp))
return false;
if (window.Current.BasicBlock == window.Previous.BasicBlock)
return false;
if (window.Previous.BranchTargets[0] != window.Current.BasicBlock.Label)
return false;
window.DeletePrevious();
return true;
}
示例3: RemoveSingleLineJump
/// <summary>
/// Removes the single line jump.
/// </summary>
/// <param name="window">The window.</param>
/// <returns></returns>
private bool RemoveSingleLineJump(Window window)
{
if (window.Size < 2)
return false;
if (window.Previous.Instruction is CPUx86.JmpInstruction)
if (window.Current.BasicBlock != window.Previous.BasicBlock) // should always be true
if (window.Previous.Branch.Targets[0] == window.Current.BasicBlock.Label)
{
window.DeletePrevious();
return true;
}
return false;
}