Make dex instruction size a lookup.
Add ostream operators for dex instruction enums.
Move simple methods to header file.
Change-Id: I9644bfb975896a491ee73ef9a8ef13c062c5fcbd
diff --git a/src/compiler/Dataflow.cc b/src/compiler/Dataflow.cc
index 6fe0659..0058575 100644
--- a/src/compiler/Dataflow.cc
+++ b/src/compiler/Dataflow.cc
@@ -875,7 +875,7 @@
flags = 0;
} else {
str.append(Instruction::Name(insn.opcode));
- flags = Instruction::Flags(insn.opcode);
+ flags = Instruction::FlagsOf(insn.opcode);
}
if (note) {
@@ -983,7 +983,7 @@
}
/* For branches, decode the instructions to print out the branch targets */
- if (Instruction::Flags(insn->opcode) & Instruction::kBranch) {
+ if (Instruction::FlagsOf(insn->opcode) & Instruction::kBranch) {
Instruction::Format dalvikFormat = Instruction::FormatOf(insn->opcode);
int delta = 0;
switch (dalvikFormat) {
@@ -1265,7 +1265,7 @@
// If not a pseudo-op, note non-leaf or can throw
if (static_cast<int>(mir->dalvikInsn.opcode) <
static_cast<int>(kNumPackedOpcodes)) {
- int flags = Instruction::Flags(mir->dalvikInsn.opcode);
+ int flags = Instruction::FlagsOf(mir->dalvikInsn.opcode);
if (flags & Instruction::kThrow) {
cUnit->attrs &= ~METHOD_IS_THROW_FREE;
@@ -2292,7 +2292,7 @@
return false;
}
Instruction::Code opcode = bb->lastMIRInsn->dalvikInsn.opcode;
- if (Instruction::Flags(opcode) & Instruction::kBranch) {
+ if (Instruction::FlagsOf(opcode) & Instruction::kBranch) {
if (bb->taken && (bb->taken->startOffset <= bb->startOffset)) {
DCHECK(bb->dominators != NULL);
if (oatIsBitSet(bb->dominators, bb->taken->id)) {
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc
index 1a09427..31d8aa5 100644
--- a/src/compiler/Frontend.cc
+++ b/src/compiler/Frontend.cc
@@ -986,7 +986,7 @@
oatAppendMIR(curBlock, insn);
codePtr += width;
- int flags = Instruction::Flags(insn->dalvikInsn.opcode);
+ int flags = Instruction::FlagsOf(insn->dalvikInsn.opcode);
int dfFlags = oatDataFlowAttributes[insn->dalvikInsn.opcode];
diff --git a/src/compiler/Ralloc.cc b/src/compiler/Ralloc.cc
index 623d4ea..bf69ce4 100644
--- a/src/compiler/Ralloc.cc
+++ b/src/compiler/Ralloc.cc
@@ -214,7 +214,7 @@
// Special-case handling for format 35c/3rc invokes
Instruction::Code opcode = mir->dalvikInsn.opcode;
int flags = (static_cast<int>(opcode) >= kNumPackedOpcodes)
- ? 0 : Instruction::Flags(mir->dalvikInsn.opcode);
+ ? 0 : Instruction::FlagsOf(mir->dalvikInsn.opcode);
if ((flags & Instruction::kInvoke) &&
(attrs & (DF_FORMAT_35C | DF_FORMAT_3RC))) {
DCHECK_EQ(next, 0);