Actually this

This commit is contained in:
Adam
2016-01-03 19:58:46 -05:00
parent 261e195ea5
commit eef43dd913
11 changed files with 34 additions and 18 deletions

View File

@@ -7,5 +7,5 @@ public interface MappableInstruction
{
void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other);
boolean isSame(MappableInstruction other);
boolean isSame(InstructionContext thisIc, InstructionContext otherIc);
}

View File

@@ -120,8 +120,8 @@ public abstract class If extends Instruction implements JumpingInstruction, Comp
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -118,8 +118,8 @@ public abstract class If0 extends Instruction implements JumpingInstruction, Com
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -2,6 +2,8 @@ package net.runelite.deob.attributes.code.instructions;
import net.runelite.deob.attributes.code.InstructionType;
import net.runelite.deob.attributes.code.Instructions;
import net.runelite.deob.attributes.code.instruction.types.MappableInstruction;
import net.runelite.deob.execution.InstructionContext;
public class IfNe extends If0
{
@@ -10,4 +12,17 @@ public class IfNe extends If0
super(instructions, type, pc);
}
@Override
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
if (super.isSame(thisIc, otherIc))
return true;
if (otherIc.getInstruction() instanceof IfCmpNe)
{
// check for one side being 0
}
return false;
}
}

View File

@@ -173,8 +173,8 @@ public class InvokeInterface extends Instruction implements InvokeInstruction
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -168,8 +168,8 @@ public class InvokeSpecial extends Instruction implements InvokeInstruction
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -176,8 +176,8 @@ public class InvokeStatic extends Instruction implements InvokeInstruction
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -177,8 +177,8 @@ public class InvokeVirtual extends Instruction implements InvokeInstruction
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -124,8 +124,8 @@ public class PutField extends Instruction implements SetFieldInstruction
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -106,8 +106,8 @@ public class PutStatic extends Instruction implements SetFieldInstruction
}
@Override
public boolean isSame(MappableInstruction other)
public boolean isSame(InstructionContext thisIc, InstructionContext otherIc)
{
return this.getClass() == other.getClass();
return thisIc.getInstruction().getClass() == otherIc.getInstruction().getClass();
}
}

View File

@@ -100,7 +100,8 @@ public class MappingExecutorUtil
MappableInstruction mi1 = (MappableInstruction) p1.getInstruction(),
mi2 = (MappableInstruction) p2.getInstruction();
assert mi1.isSame(mi2);
assert mi1.isSame(p1, p2);
//assert p1.getInstruction().getClass().equals(p2.getInstruction().getClass());
mi1.map(mappings, p1, p2);