MCPcopy Create free account
hub / github.com/Youlor/unpacker / writeTo

Method writeTo

dexfixer/src/com/android/dx/dex/code/form/Form35c.java:122–138  ·  view source on GitHub ↗

{@inheritDoc}

(AnnotatedOutput out, DalvInsn insn)

Source from the content-addressed store, hash-verified

120
121 /** {@inheritDoc} */
122 @Override
123 public void writeTo(AnnotatedOutput out, DalvInsn insn) {
124 int cpi = ((CstInsn) insn).getIndex();
125 RegisterSpecList regs = explicitize(insn.getRegisters());
126 int sz = regs.size();
127 int r0 = (sz > 0) ? regs.get(0).getReg() : 0;
128 int r1 = (sz > 1) ? regs.get(1).getReg() : 0;
129 int r2 = (sz > 2) ? regs.get(2).getReg() : 0;
130 int r3 = (sz > 3) ? regs.get(3).getReg() : 0;
131 int r4 = (sz > 4) ? regs.get(4).getReg() : 0;
132
133 write(out,
134 opcodeUnit(insn,
135 makeByte(r4, sz)), // encode the fifth operand here
136 (short) cpi,
137 codeUnit(r0, r1, r2, r3));
138 }
139
140 /**
141 * Gets the number of words required for the given register list, where

Callers

nothing calls this directly

Calls 10

explicitizeMethod · 0.95
getMethod · 0.95
getRegistersMethod · 0.80
getRegMethod · 0.80
opcodeUnitMethod · 0.80
getIndexMethod · 0.65
sizeMethod · 0.65
writeMethod · 0.65
makeByteMethod · 0.45
codeUnitMethod · 0.45

Tested by

no test coverage detected