diff options
| author | 2014-07-10 18:56:00 +0000 | |
|---|---|---|
| committer | 2014-07-10 18:27:51 +0000 | |
| commit | fe12035ea434be9b24f578cf51e53c3bb34d945c (patch) | |
| tree | 5f90290c17fb643d9a2064261a1f397f36136237 /compiler/dex | |
| parent | 49b874b65412a95f3bf0b1e6f60f3d457dca68da (diff) | |
| parent | f2466a766947f952c5c41186a6c5e26fb862bb37 (diff) | |
Merge "ART: Handle Extended MIRs in a uniform manner"
Diffstat (limited to 'compiler/dex')
| -rw-r--r-- | compiler/dex/mir_dataflow.cc | 26 | ||||
| -rw-r--r-- | compiler/dex/mir_graph.h | 6 |
2 files changed, 32 insertions, 0 deletions
diff --git a/compiler/dex/mir_dataflow.cc b/compiler/dex/mir_dataflow.cc index bc99a272a6..b5fdcf0628 100644 --- a/compiler/dex/mir_dataflow.cc +++ b/compiler/dex/mir_dataflow.cc @@ -909,6 +909,16 @@ void MIRGraph::HandleDef(ArenaBitVector* def_v, int dalvik_reg_id) { def_v->SetBit(dalvik_reg_id); } +void MIRGraph::HandleExtended(ArenaBitVector* use_v, ArenaBitVector* def_v, + ArenaBitVector* live_in_v, + const MIR::DecodedInstruction& d_insn) { + switch (static_cast<int>(d_insn.opcode)) { + default: + LOG(ERROR) << "Unexpected Extended Opcode " << d_insn.opcode; + break; + } +} + /* * Find out live-in variables for natural loops. Variables that are live-in in * the main loop body are considered to be defined in the entry block. @@ -966,6 +976,9 @@ bool MIRGraph::FindLocalLiveIn(BasicBlock* bb) { HandleDef(def_v, d_insn->vA+1); } } + if (df_attributes & DF_FORMAT_EXTENDED) { + HandleExtended(use_v, def_v, live_in_v, mir->dalvikInsn); + } } return true; } @@ -1048,6 +1061,14 @@ void MIRGraph::DataFlowSSAFormat3RC(MIR* mir) { } } +void MIRGraph::DataFlowSSAFormatExtended(MIR* mir) { + switch (static_cast<int>(mir->dalvikInsn.opcode)) { + default: + LOG(ERROR) << "Missing case for extended MIR: " << mir->dalvikInsn.opcode; + break; + } +} + /* Entry function to convert a block into SSA representation */ bool MIRGraph::DoSSAConversion(BasicBlock* bb) { MIR* mir; @@ -1083,6 +1104,11 @@ bool MIRGraph::DoSSAConversion(BasicBlock* bb) { continue; } + if (df_attributes & DF_FORMAT_EXTENDED) { + DataFlowSSAFormatExtended(mir); + continue; + } + if (df_attributes & DF_HAS_USES) { if (df_attributes & DF_UA) { num_uses++; diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h index 6ee48a494a..43c9c3c15c 100644 --- a/compiler/dex/mir_graph.h +++ b/compiler/dex/mir_graph.h @@ -80,6 +80,7 @@ enum DataFlowAttributePos { kSetsConst, kFormat35c, kFormat3rc, + kFormatExtended, // Extended format for extended MIRs. kNullCheckSrc0, // Null check of uses[0]. kNullCheckSrc1, // Null check of uses[1]. kNullCheckSrc2, // Null check of uses[2]. @@ -118,6 +119,7 @@ enum DataFlowAttributePos { #define DF_SETS_CONST (UINT64_C(1) << kSetsConst) #define DF_FORMAT_35C (UINT64_C(1) << kFormat35c) #define DF_FORMAT_3RC (UINT64_C(1) << kFormat3rc) +#define DF_FORMAT_EXTENDED (UINT64_C(1) << kFormatExtended) #define DF_NULL_CHK_0 (UINT64_C(1) << kNullCheckSrc0) #define DF_NULL_CHK_1 (UINT64_C(1) << kNullCheckSrc1) #define DF_NULL_CHK_2 (UINT64_C(1) << kNullCheckSrc2) @@ -1059,6 +1061,9 @@ class MIRGraph { void HandleLiveInUse(ArenaBitVector* use_v, ArenaBitVector* def_v, ArenaBitVector* live_in_v, int dalvik_reg_id); void HandleDef(ArenaBitVector* def_v, int dalvik_reg_id); + void HandleExtended(ArenaBitVector* use_v, ArenaBitVector* def_v, + ArenaBitVector* live_in_v, + const MIR::DecodedInstruction& d_insn); bool DoSSAConversion(BasicBlock* bb); bool InvokeUsesMethodStar(MIR* mir); int ParseInsn(const uint16_t* code_ptr, MIR::DecodedInstruction* decoded_instruction); @@ -1080,6 +1085,7 @@ class MIRGraph { void HandleSSAUse(int* uses, int dalvik_reg, int reg_index); void DataFlowSSAFormat35C(MIR* mir); void DataFlowSSAFormat3RC(MIR* mir); + void DataFlowSSAFormatExtended(MIR* mir); bool FindLocalLiveIn(BasicBlock* bb); bool VerifyPredInfo(BasicBlock* bb); BasicBlock* NeedsVisit(BasicBlock* bb); |