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

Method opcodeUnit

dexfixer/src/com/android/dx/dex/code/InsnFormat.java:438–450  ·  view source on GitHub ↗

Helper method to combine an opcode and a second byte of data into the appropriate form for emitting into a code buffer. @param insn non-null; the instruction containing the opcode @param arg 0..255; arbitrary other byte value @return combined value

(DalvInsn insn, int arg)

Source from the content-addressed store, hash-verified

436 * @return combined value
437 */
438 protected static short opcodeUnit(DalvInsn insn, int arg) {
439 if ((arg & 0xff) != arg) {
440 throw new IllegalArgumentException("arg out of range 0..255");
441 }
442
443 int opcode = insn.getOpcode().getOpcode();
444
445 if ((opcode & 0xff) != opcode) {
446 throw new IllegalArgumentException("opcode out of range 0..255");
447 }
448
449 return (short) (opcode | (arg << 8));
450 }
451
452 /**
453 * Helper method to get an extended (16-bit) opcode out of an

Callers 15

writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80
writeToMethod · 0.80

Calls 1

getOpcodeMethod · 0.45

Tested by

no test coverage detected