aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/arm/CodegenDriver.c
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2010-11-10 17:34:32 -0800
committerDan Bornstein <danfuzz@android.com>2010-11-10 17:34:32 -0800
commit44a38f4a6a1cde0490e78b7de3b27906c6c81078 (patch)
tree03879a2e502c3ab9afa731ebb7b646b5b01e8e06 /vm/compiler/codegen/arm/CodegenDriver.c
parentff70f76988296fe8b2521c17b6cc1968c774b641 (diff)
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
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index 5cd901e17..de0d6e6f0 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -1233,7 +1233,7 @@ static void genPuntToInterp(CompilationUnit *cUnit, unsigned int offset)
*/
static void genInterpSingleStep(CompilationUnit *cUnit, MIR *mir)
{
- int flags = dexGetInstrFlags(gDvm.instrFlags, mir->dalvikInsn.opCode);
+ int flags = dexGetInstrFlags(gDvm.instrInfo.flags, mir->dalvikInsn.opCode);
int flagsToCheck = kInstrCanBranch | kInstrCanSwitch | kInstrCanReturn |
kInstrCanThrow;
@@ -1283,7 +1283,8 @@ static void genMonitorPortable(CompilationUnit *cUnit, MIR *mir)
if (isEnter) {
/* Get dPC of next insn */
loadConstant(cUnit, r4PC, (int)(cUnit->method->insns + mir->offset +
- dexGetInstrWidthAbs(gDvm.instrWidth, OP_MONITOR_ENTER)));
+ dexGetInstrWidthAbs(gDvm.instrInfo.widths,
+ OP_MONITOR_ENTER)));
#if defined(WITH_DEADLOCK_PREDICTION)
genDispatchToHandler(cUnit, TEMPLATE_MONITOR_ENTER_DEBUG);
#else
@@ -1297,7 +1298,8 @@ static void genMonitorPortable(CompilationUnit *cUnit, MIR *mir)
ArmLIR *branchOver = genCmpImmBranch(cUnit, kArmCondNe, r0, 0);
loadConstant(cUnit, r0,
(int) (cUnit->method->insns + mir->offset +
- dexGetInstrWidthAbs(gDvm.instrWidth, OP_MONITOR_EXIT)));
+ dexGetInstrWidthAbs(gDvm.instrInfo.widths,
+ OP_MONITOR_EXIT)));
genDispatchToHandler(cUnit, TEMPLATE_THROW_EXCEPTION_COMMON);
ArmLIR *target = newLIR0(cUnit, kArmPseudoTargetLabel);
target->defMask = ENCODE_ALL;
@@ -4098,7 +4100,7 @@ void dvmCompilerMIR2LIR(CompilationUnit *cUnit)
OpCode dalvikOpCode = mir->dalvikInsn.opCode;
InstructionFormat dalvikFormat =
- dexGetInstrFormat(gDvm.instrFormat, dalvikOpCode);
+ dexGetInstrFormat(gDvm.instrInfo.formats, dalvikOpCode);
char *note;
if (mir->OptimizationFlags & MIR_INLINED) {
note = " (I)";