@Nonnull private BuilderInstruction20t newBuilderInstruction20t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction20t instruction) { return new BuilderInstruction20t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Override protected BuilderInstruction getRealInsn0(LabelAssigner assigner) { return new BuilderInstruction20t(opc, assigner.getOrCreateLabel(target)); }
((BuilderOffsetInstruction) instruction).getTarget()); } else { replacement = new BuilderInstruction20t(Opcode.GOTO_16, ((BuilderOffsetInstruction) instruction).getTarget());
public final void insn_format20t() throws RecognitionException { CommonTree INSTRUCTION_FORMAT20t126=null; Label label_ref127 =null; try { // smaliTreeWalker.g:873:3: ( ^( I_STATEMENT_FORMAT20t INSTRUCTION_FORMAT20t label_ref ) ) // smaliTreeWalker.g:874:5: ^( I_STATEMENT_FORMAT20t INSTRUCTION_FORMAT20t label_ref ) { match(input,I_STATEMENT_FORMAT20t,FOLLOW_I_STATEMENT_FORMAT20t_in_insn_format20t2387); match(input, Token.DOWN, null); INSTRUCTION_FORMAT20t126=(CommonTree)match(input,INSTRUCTION_FORMAT20t,FOLLOW_INSTRUCTION_FORMAT20t_in_insn_format20t2389); pushFollow(FOLLOW_label_ref_in_insn_format20t2391); label_ref127=label_ref(); state._fsp--; match(input, Token.UP, null); Opcode opcode = opcodes.getOpcodeByName((INSTRUCTION_FORMAT20t126!=null?INSTRUCTION_FORMAT20t126.getText():null)); method_stack.peek().methodBuilder.addInstruction(new BuilderInstruction20t(opcode, label_ref127)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } } // $ANTLR end "insn_format20t"
@Nonnull private BuilderInstruction20t newBuilderInstruction20t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction20t instruction) { return new BuilderInstruction20t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction20t newBuilderInstruction20t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction20t instruction) { return new BuilderInstruction20t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction20t newBuilderInstruction20t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction20t instruction) { return new BuilderInstruction20t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Nonnull private BuilderInstruction20t newBuilderInstruction20t(int codeAddress, int[] codeAddressToIndex, @Nonnull Instruction20t instruction) { return new BuilderInstruction20t( instruction.getOpcode(), newLabel(codeAddressToIndex, codeAddress + instruction.getCodeOffset())); }
@Test public void testFixGoto16ToGoto32() { MethodImplementationBuilder builder = new MethodImplementationBuilder(1); Label gotoTarget = builder.getLabel("gotoTarget"); builder.addInstruction(new BuilderInstruction20t(Opcode.GOTO_16, gotoTarget)); for (int i=0; i<70000; i++) { builder.addInstruction(new BuilderInstruction10x(Opcode.NOP)); } builder.addLabel("gotoTarget"); builder.addInstruction(new BuilderInstruction10x(Opcode.RETURN_VOID)); MethodImplementation impl = builder.getMethodImplementation(); List<? extends Instruction> instructions = Lists.newArrayList(impl.getInstructions()); Assert.assertEquals(70002, instructions.size()); Assert.assertEquals(Opcode.GOTO_32, instructions.get(0).getOpcode()); Assert.assertEquals(70003, ((OffsetInstruction)instructions.get(0)).getCodeOffset()); }
((BuilderOffsetInstruction) instruction).getTarget()); } else { replacement = new BuilderInstruction20t(Opcode.GOTO_16, ((BuilderOffsetInstruction) instruction).getTarget());
((BuilderOffsetInstruction)instruction).getTarget()); } else { replacement = new BuilderInstruction20t(Opcode.GOTO_16, ((BuilderOffsetInstruction)instruction).getTarget());
((BuilderOffsetInstruction)instruction).getTarget()); } else { replacement = new BuilderInstruction20t(Opcode.GOTO_16, ((BuilderOffsetInstruction)instruction).getTarget());
((BuilderOffsetInstruction)instruction).getTarget()); } else { replacement = new BuilderInstruction20t(Opcode.GOTO_16, ((BuilderOffsetInstruction)instruction).getTarget());
public final void insn_format20t() throws RecognitionException { CommonTree INSTRUCTION_FORMAT20t126=null; Label label_ref127 =null; try { // smaliTreeWalker.g:873:3: ( ^( I_STATEMENT_FORMAT20t INSTRUCTION_FORMAT20t label_ref ) ) // smaliTreeWalker.g:874:5: ^( I_STATEMENT_FORMAT20t INSTRUCTION_FORMAT20t label_ref ) { match(input,I_STATEMENT_FORMAT20t,FOLLOW_I_STATEMENT_FORMAT20t_in_insn_format20t2387); match(input, Token.DOWN, null); INSTRUCTION_FORMAT20t126=(CommonTree)match(input,INSTRUCTION_FORMAT20t,FOLLOW_INSTRUCTION_FORMAT20t_in_insn_format20t2389); pushFollow(FOLLOW_label_ref_in_insn_format20t2391); label_ref127=label_ref(); state._fsp--; match(input, Token.UP, null); Opcode opcode = opcodes.getOpcodeByName((INSTRUCTION_FORMAT20t126!=null?INSTRUCTION_FORMAT20t126.getText():null)); method_stack.peek().methodBuilder.addInstruction(new BuilderInstruction20t(opcode, label_ref127)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } } // $ANTLR end "insn_format20t"
public final void insn_format20t() throws RecognitionException { CommonTree INSTRUCTION_FORMAT20t116=null; Label label_ref117 =null; try { // D:\\decomplier_tools\\smali\\smali\\smali\\src\\main\\antlr3\\smaliTreeWalker.g:810:3: ( ^( I_STATEMENT_FORMAT20t INSTRUCTION_FORMAT20t label_ref ) ) // D:\\decomplier_tools\\smali\\smali\\smali\\src\\main\\antlr3\\smaliTreeWalker.g:811:5: ^( I_STATEMENT_FORMAT20t INSTRUCTION_FORMAT20t label_ref ) { match(input,I_STATEMENT_FORMAT20t,FOLLOW_I_STATEMENT_FORMAT20t_in_insn_format20t2196); match(input, Token.DOWN, null); INSTRUCTION_FORMAT20t116=(CommonTree)match(input,INSTRUCTION_FORMAT20t,FOLLOW_INSTRUCTION_FORMAT20t_in_insn_format20t2198); pushFollow(FOLLOW_label_ref_in_insn_format20t2200); label_ref117=label_ref(); state._fsp--; match(input, Token.UP, null); Opcode opcode = opcodes.getOpcodeByName((INSTRUCTION_FORMAT20t116!=null?INSTRUCTION_FORMAT20t116.getText():null)); method_stack.peek().methodBuilder.addInstruction(new BuilderInstruction20t(opcode, label_ref117)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } } // $ANTLR end "insn_format20t"
builder.addInstruction(new BuilderInstruction20t(Opcode.GOTO_16, goto16Target));