summaryrefslogtreecommitdiff
path: root/runtime/dex_instruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/dex_instruction.h')
-rw-r--r--runtime/dex_instruction.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/dex_instruction.h b/runtime/dex_instruction.h
index 8eb1a79420..99b9f9dd13 100644
--- a/runtime/dex_instruction.h
+++ b/runtime/dex_instruction.h
@@ -480,6 +480,18 @@ class Instruction {
insns[1] = val;
}
+ void SetVRegA_21c(uint8_t val) {
+ DCHECK(FormatOf(Opcode()) == k21c);
+ uint16_t* insns = reinterpret_cast<uint16_t*>(this);
+ insns[0] = (val << 8) | (insns[0] & 0x00ff);
+ }
+
+ void SetVRegB_21c(uint16_t val) {
+ DCHECK(FormatOf(Opcode()) == k21c);
+ uint16_t* insns = reinterpret_cast<uint16_t*>(this);
+ insns[1] = val;
+ }
+
// Returns the format of the given opcode.
static Format FormatOf(Code opcode) {
return kInstructionFormats[opcode];