diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/dex/dex_to_dex_compiler.cc | 23 | ||||
| -rw-r--r-- | compiler/dex/mir_analysis.cc | 2 | ||||
| -rw-r--r-- | compiler/dex/mir_dataflow.cc | 2 | ||||
| -rw-r--r-- | compiler/dex/quick/mir_to_lir.cc | 2 | ||||
| -rw-r--r-- | compiler/dex/quick/quick_compiler.cc | 2 |
5 files changed, 15 insertions, 16 deletions
diff --git a/compiler/dex/dex_to_dex_compiler.cc b/compiler/dex/dex_to_dex_compiler.cc index fcefb6fbfc..548b6f8b63 100644 --- a/compiler/dex/dex_to_dex_compiler.cc +++ b/compiler/dex/dex_to_dex_compiler.cc @@ -180,22 +180,21 @@ void DexCompiler::Compile() { } void DexCompiler::CompileReturnVoid(Instruction* inst, uint32_t dex_pc) { - DCHECK(inst->Opcode() == Instruction::RETURN_VOID); - // Are we compiling a non-clinit constructor? - if (!unit_.IsConstructor() || unit_.IsStatic()) { - return; - } - // Do we need a constructor barrier ? - if (!driver_.RequiresConstructorBarrier(Thread::Current(), unit_.GetDexFile(), - unit_.GetClassDefIndex())) { - return; + DCHECK_EQ(inst->Opcode(), Instruction::RETURN_VOID); + if (unit_.IsConstructor()) { + // Are we compiling a non clinit constructor which needs a barrier ? + if (!unit_.IsStatic() && + driver_.RequiresConstructorBarrier(Thread::Current(), unit_.GetDexFile(), + unit_.GetClassDefIndex())) { + return; + } } - // Replace RETURN_VOID by RETURN_VOID_BARRIER. + // Replace RETURN_VOID by RETURN_VOID_NO_BARRIER. VLOG(compiler) << "Replacing " << Instruction::Name(inst->Opcode()) - << " by " << Instruction::Name(Instruction::RETURN_VOID_BARRIER) + << " by " << Instruction::Name(Instruction::RETURN_VOID_NO_BARRIER) << " at dex pc " << StringPrintf("0x%x", dex_pc) << " in method " << PrettyMethod(unit_.GetDexMethodIndex(), GetDexFile(), true); - inst->SetOpcode(Instruction::RETURN_VOID_BARRIER); + inst->SetOpcode(Instruction::RETURN_VOID_NO_BARRIER); } Instruction* DexCompiler::CompileCheckCast(Instruction* inst, uint32_t dex_pc) { diff --git a/compiler/dex/mir_analysis.cc b/compiler/dex/mir_analysis.cc index a89b2508d4..3d7a640ce3 100644 --- a/compiler/dex/mir_analysis.cc +++ b/compiler/dex/mir_analysis.cc @@ -416,7 +416,7 @@ static const uint16_t kAnalysisAttributes[kMirOpLast] = { // 72 INVOKE_INTERFACE {vD, vE, vF, vG, vA} kAnInvoke | kAnHeavyWeight, - // 73 RETURN_VOID_BARRIER + // 73 RETURN_VOID_NO_BARRIER kAnBranch, // 74 INVOKE_VIRTUAL_RANGE {vCCCC .. vNNNN} diff --git a/compiler/dex/mir_dataflow.cc b/compiler/dex/mir_dataflow.cc index dfaff6ce3d..f638b0bf4d 100644 --- a/compiler/dex/mir_dataflow.cc +++ b/compiler/dex/mir_dataflow.cc @@ -374,7 +374,7 @@ const uint64_t MIRGraph::oat_data_flow_attributes_[kMirOpLast] = { // 72 INVOKE_INTERFACE {vD, vE, vF, vG, vA} DF_FORMAT_35C | DF_NULL_CHK_OUT0 | DF_UMS, - // 73 RETURN_VOID_BARRIER + // 73 RETURN_VOID_NO_BARRIER DF_NOP, // 74 INVOKE_VIRTUAL_RANGE {vCCCC .. vNNNN} diff --git a/compiler/dex/quick/mir_to_lir.cc b/compiler/dex/quick/mir_to_lir.cc index 8edc5fc4f0..8fc45dc309 100644 --- a/compiler/dex/quick/mir_to_lir.cc +++ b/compiler/dex/quick/mir_to_lir.cc @@ -540,7 +540,7 @@ void Mir2Lir::CompileDalvikInstruction(MIR* mir, BasicBlock* bb, LIR* label_list GenMoveException(rl_dest); break; - case Instruction::RETURN_VOID_BARRIER: + case Instruction::RETURN_VOID_NO_BARRIER: case Instruction::RETURN_VOID: if (((cu_->access_flags & kAccConstructor) != 0) && cu_->compiler_driver->RequiresConstructorBarrier(Thread::Current(), cu_->dex_file, diff --git a/compiler/dex/quick/quick_compiler.cc b/compiler/dex/quick/quick_compiler.cc index 922f2f7ad7..1673312919 100644 --- a/compiler/dex/quick/quick_compiler.cc +++ b/compiler/dex/quick/quick_compiler.cc @@ -250,7 +250,7 @@ static int kAllOpcodes[] = { Instruction::INVOKE_DIRECT, Instruction::INVOKE_STATIC, Instruction::INVOKE_INTERFACE, - Instruction::RETURN_VOID_BARRIER, + Instruction::RETURN_VOID_NO_BARRIER, Instruction::INVOKE_VIRTUAL_RANGE, Instruction::INVOKE_SUPER_RANGE, Instruction::INVOKE_DIRECT_RANGE, |