Add a new index type table for instruction decoding.
This is in prep for -- recurring theme here -- adding the new extended
opcode formats. It turns out that we can avoid a lot of duplicated code
if we determine the type of thing referred to in index-bearing instructions
inside the general instruction decoder. To do so straightforwardly, this
means adding a new opcode info table and then passing it into the decoder.
Rather than add another argument to the decoder, I defined a struct to
contain all the info tables together, and a pointer to that can get passed
in.
I simplified the setting up of the info tables, too, so all the
allocation is handled within InstrUtils, rather than being (partially)
duplicated in a couple places. The only downside is that dexdump will
construct one more table than it actually needs, but given that
construction is quick and the table is only 256 bytes (though will
soon be growing to -- gasp! -- 294 bytes), I figure it's not such a
big deal.
Most of the files that changed only had edits for how to refer to these
info tables.
Change-Id: Ia6f1cb25da6e558ac90c6dd3af6bce36b82a6b4d
diff --git a/vm/analysis/CodeVerify.c b/vm/analysis/CodeVerify.c
index 49c1a3e..3986aee 100644
--- a/vm/analysis/CodeVerify.c
+++ b/vm/analysis/CodeVerify.c
@@ -3513,9 +3513,9 @@
#ifndef NDEBUG
memset(&decInsn, 0x81, sizeof(decInsn));
#endif
- dexDecodeInstruction(gDvm.instrFormat, insns, &decInsn);
+ dexDecodeInstruction(&gDvm.instrInfo, insns, &decInsn);
- int nextFlags = dexGetInstrFlags(gDvm.instrFlags, decInsn.opCode);
+ int nextFlags = dexGetInstrFlags(gDvm.instrInfo.flags, decInsn.opCode);
/*
* Make a copy of the previous register state. If the instruction