@Nonnull private BuilderInstruction30t newBuilderInstruction30t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction30t instruction) { return new BuilderInstruction30t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Override protected BuilderInstruction getRealInsn0(LabelAssigner assigner) { return new BuilderInstruction30t(opc, assigner.getOrCreateLabel(target)); }
BuilderOffsetInstruction original = (BuilderOffsetInstruction) manipulator.getInstruction(address); Label target = original.getTarget(); replacement = new BuilderInstruction30t(Opcode.GOTO_32, target);
BuilderOffsetInstruction replacement; if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction) instruction).getTarget()); } else { int offset = ((BuilderOffsetInstruction) instruction).internalGetCodeOffset(); if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { BuilderOffsetInstruction replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction) instruction).getTarget()); replaceInstruction(location.index, replacement);
public final void insn_format30t() throws RecognitionException { CommonTree INSTRUCTION_FORMAT30t163=null; Label label_ref164 =null; try { // smaliTreeWalker.g:1075:3: ( ^( I_STATEMENT_FORMAT30t INSTRUCTION_FORMAT30t label_ref ) ) // smaliTreeWalker.g:1076:5: ^( I_STATEMENT_FORMAT30t INSTRUCTION_FORMAT30t label_ref ) { match(input,I_STATEMENT_FORMAT30t,FOLLOW_I_STATEMENT_FORMAT30t_in_insn_format30t2944); match(input, Token.DOWN, null); INSTRUCTION_FORMAT30t163=(CommonTree)match(input,INSTRUCTION_FORMAT30t,FOLLOW_INSTRUCTION_FORMAT30t_in_insn_format30t2946); pushFollow(FOLLOW_label_ref_in_insn_format30t2948); label_ref164=label_ref(); state._fsp--; match(input, Token.UP, null); Opcode opcode = opcodes.getOpcodeByName((INSTRUCTION_FORMAT30t163!=null?INSTRUCTION_FORMAT30t163.getText():null)); method_stack.peek().methodBuilder.addInstruction(new BuilderInstruction30t(opcode, label_ref164)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } } // $ANTLR end "insn_format30t"
@Test public void replaceInstructionExecutesNewNodeCorrectly() { manipulator = OptimizerTester.getGraphManipulator(CLASS_NAME, "constantPredicate()I"); BuilderInstruction returnVoid = manipulator.getNodePile(4).get(0).getOp().getInstruction(); Label target = returnVoid.getLocation().addNewLabel(); // GOTO_32 shifts addresses around so mappings could break BuilderInstruction replacement = new BuilderInstruction30t(Opcode.GOTO_32, target); manipulator.replaceInstruction(1, replacement); testHeritage(manipulator, 0); }
@Nonnull private BuilderInstruction30t newBuilderInstruction30t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction30t instruction) { return new BuilderInstruction30t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction30t newBuilderInstruction30t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction30t instruction) { return new BuilderInstruction30t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction30t newBuilderInstruction30t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction30t instruction) { return new BuilderInstruction30t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction30t newBuilderInstruction30t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction30t instruction) { return new BuilderInstruction30t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
BuilderOffsetInstruction replacement; if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction)instruction).getTarget()); } else { int offset = ((BuilderOffsetInstruction)instruction).internalGetCodeOffset(); if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { BuilderOffsetInstruction replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction)instruction).getTarget()); replaceInstruction(location.index, replacement);
BuilderOffsetInstruction replacement; if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction)instruction).getTarget()); } else { int offset = ((BuilderOffsetInstruction)instruction).internalGetCodeOffset(); if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { BuilderOffsetInstruction replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction)instruction).getTarget()); replaceInstruction(location.index, replacement);
BuilderOffsetInstruction replacement; if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction)instruction).getTarget()); } else { int offset = ((BuilderOffsetInstruction)instruction).internalGetCodeOffset(); if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { BuilderOffsetInstruction replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction)instruction).getTarget()); replaceInstruction(location.index, replacement);
BuilderOffsetInstruction replacement; if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction) instruction).getTarget()); } else { int offset = ((BuilderOffsetInstruction) instruction).internalGetCodeOffset(); if (offset < Short.MIN_VALUE || offset > Short.MAX_VALUE) { BuilderOffsetInstruction replacement = new BuilderInstruction30t(Opcode.GOTO_32, ((BuilderOffsetInstruction) instruction).getTarget()); replaceInstruction(location.index, replacement);
public final void insn_format30t() throws RecognitionException { CommonTree INSTRUCTION_FORMAT30t163=null; Label label_ref164 =null; try { // smaliTreeWalker.g:1075:3: ( ^( I_STATEMENT_FORMAT30t INSTRUCTION_FORMAT30t label_ref ) ) // smaliTreeWalker.g:1076:5: ^( I_STATEMENT_FORMAT30t INSTRUCTION_FORMAT30t label_ref ) { match(input,I_STATEMENT_FORMAT30t,FOLLOW_I_STATEMENT_FORMAT30t_in_insn_format30t2944); match(input, Token.DOWN, null); INSTRUCTION_FORMAT30t163=(CommonTree)match(input,INSTRUCTION_FORMAT30t,FOLLOW_INSTRUCTION_FORMAT30t_in_insn_format30t2946); pushFollow(FOLLOW_label_ref_in_insn_format30t2948); label_ref164=label_ref(); state._fsp--; match(input, Token.UP, null); Opcode opcode = opcodes.getOpcodeByName((INSTRUCTION_FORMAT30t163!=null?INSTRUCTION_FORMAT30t163.getText():null)); method_stack.peek().methodBuilder.addInstruction(new BuilderInstruction30t(opcode, label_ref164)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } } // $ANTLR end "insn_format30t"
public final void insn_format30t() throws RecognitionException { CommonTree INSTRUCTION_FORMAT30t149=null; Label label_ref150 =null; try { // D:\\decomplier_tools\\smali\\smali\\smali\\src\\main\\antlr3\\smaliTreeWalker.g:986:3: ( ^( I_STATEMENT_FORMAT30t INSTRUCTION_FORMAT30t label_ref ) ) // D:\\decomplier_tools\\smali\\smali\\smali\\src\\main\\antlr3\\smaliTreeWalker.g:987:5: ^( I_STATEMENT_FORMAT30t INSTRUCTION_FORMAT30t label_ref ) { match(input,I_STATEMENT_FORMAT30t,FOLLOW_I_STATEMENT_FORMAT30t_in_insn_format30t2687); match(input, Token.DOWN, null); INSTRUCTION_FORMAT30t149=(CommonTree)match(input,INSTRUCTION_FORMAT30t,FOLLOW_INSTRUCTION_FORMAT30t_in_insn_format30t2689); pushFollow(FOLLOW_label_ref_in_insn_format30t2691); label_ref150=label_ref(); state._fsp--; match(input, Token.UP, null); Opcode opcode = opcodes.getOpcodeByName((INSTRUCTION_FORMAT30t149!=null?INSTRUCTION_FORMAT30t149.getText():null)); method_stack.peek().methodBuilder.addInstruction(new BuilderInstruction30t(opcode, label_ref150)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } } // $ANTLR end "insn_format30t"