diff options
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/instruction_simplifier.cc | 16 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics.h | 5 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_arm.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_arm64.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_mips.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_mips64.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_x86.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/intrinsics_x86_64.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/nodes.h | 1 | ||||
| -rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 4 |
10 files changed, 24 insertions, 20 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc index f8a9a94e62..b95ece5a31 100644 --- a/compiler/optimizing/instruction_simplifier.cc +++ b/compiler/optimizing/instruction_simplifier.cc @@ -94,6 +94,7 @@ class InstructionSimplifierVisitor : public HGraphDelegateVisitor { void SimplifyCompare(HInvoke* invoke, bool has_zero_op); void SimplifyIsNaN(HInvoke* invoke); void SimplifyFP2Int(HInvoke* invoke); + void SimplifyMemBarrier(HInvoke* invoke, MemBarrierKind barrier_kind); OptimizingCompilerStats* stats_; bool simplification_occurred_ = false; @@ -1594,6 +1595,12 @@ void InstructionSimplifierVisitor::SimplifyFP2Int(HInvoke* invoke) { invoke->ReplaceWithExceptInReplacementAtIndex(select, 0); // false at index 0 } +void InstructionSimplifierVisitor::SimplifyMemBarrier(HInvoke* invoke, MemBarrierKind barrier_kind) { + uint32_t dex_pc = invoke->GetDexPc(); + HMemoryBarrier* mem_barrier = new (GetGraph()->GetArena()) HMemoryBarrier(barrier_kind, dex_pc); + invoke->GetBlock()->ReplaceAndRemoveInstructionWith(invoke, mem_barrier); +} + void InstructionSimplifierVisitor::VisitInvoke(HInvoke* instruction) { switch (instruction->GetIntrinsic()) { case Intrinsics::kStringEquals: @@ -1626,6 +1633,15 @@ void InstructionSimplifierVisitor::VisitInvoke(HInvoke* instruction) { case Intrinsics::kDoubleDoubleToLongBits: SimplifyFP2Int(instruction); break; + case Intrinsics::kUnsafeLoadFence: + SimplifyMemBarrier(instruction, MemBarrierKind::kLoadAny); + break; + case Intrinsics::kUnsafeStoreFence: + SimplifyMemBarrier(instruction, MemBarrierKind::kAnyStore); + break; + case Intrinsics::kUnsafeFullFence: + SimplifyMemBarrier(instruction, MemBarrierKind::kAnyAny); + break; default: break; } diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h index 0cec5ccfd3..3da82851a6 100644 --- a/compiler/optimizing/intrinsics.h +++ b/compiler/optimizing/intrinsics.h @@ -231,7 +231,10 @@ UNREACHABLE_INTRINSIC(Arch, LongRotateRight) \ UNREACHABLE_INTRINSIC(Arch, IntegerCompare) \ UNREACHABLE_INTRINSIC(Arch, LongCompare) \ UNREACHABLE_INTRINSIC(Arch, IntegerSignum) \ -UNREACHABLE_INTRINSIC(Arch, LongSignum) +UNREACHABLE_INTRINSIC(Arch, LongSignum) \ +UNREACHABLE_INTRINSIC(Arch, UnsafeLoadFence) \ +UNREACHABLE_INTRINSIC(Arch, UnsafeStoreFence) \ +UNREACHABLE_INTRINSIC(Arch, UnsafeFullFence) } // namespace art diff --git a/compiler/optimizing/intrinsics_arm.cc b/compiler/optimizing/intrinsics_arm.cc index b599d42c4b..c7d9a0d2ce 100644 --- a/compiler/optimizing/intrinsics_arm.cc +++ b/compiler/optimizing/intrinsics_arm.cc @@ -2008,9 +2008,6 @@ UNIMPLEMENTED_INTRINSIC(ARM, UnsafeGetAndAddLong) UNIMPLEMENTED_INTRINSIC(ARM, UnsafeGetAndSetInt) UNIMPLEMENTED_INTRINSIC(ARM, UnsafeGetAndSetLong) UNIMPLEMENTED_INTRINSIC(ARM, UnsafeGetAndSetObject) -UNIMPLEMENTED_INTRINSIC(ARM, UnsafeLoadFence) -UNIMPLEMENTED_INTRINSIC(ARM, UnsafeStoreFence) -UNIMPLEMENTED_INTRINSIC(ARM, UnsafeFullFence) UNREACHABLE_INTRINSICS(ARM) diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc index ccbbd43258..8a444412f3 100644 --- a/compiler/optimizing/intrinsics_arm64.cc +++ b/compiler/optimizing/intrinsics_arm64.cc @@ -1959,9 +1959,6 @@ UNIMPLEMENTED_INTRINSIC(ARM64, UnsafeGetAndAddLong) UNIMPLEMENTED_INTRINSIC(ARM64, UnsafeGetAndSetInt) UNIMPLEMENTED_INTRINSIC(ARM64, UnsafeGetAndSetLong) UNIMPLEMENTED_INTRINSIC(ARM64, UnsafeGetAndSetObject) -UNIMPLEMENTED_INTRINSIC(ARM64, UnsafeLoadFence) -UNIMPLEMENTED_INTRINSIC(ARM64, UnsafeStoreFence) -UNIMPLEMENTED_INTRINSIC(ARM64, UnsafeFullFence) UNREACHABLE_INTRINSICS(ARM64) diff --git a/compiler/optimizing/intrinsics_mips.cc b/compiler/optimizing/intrinsics_mips.cc index 697b8fe882..e159701a46 100644 --- a/compiler/optimizing/intrinsics_mips.cc +++ b/compiler/optimizing/intrinsics_mips.cc @@ -1838,9 +1838,6 @@ UNIMPLEMENTED_INTRINSIC(MIPS, UnsafeGetAndAddLong) UNIMPLEMENTED_INTRINSIC(MIPS, UnsafeGetAndSetInt) UNIMPLEMENTED_INTRINSIC(MIPS, UnsafeGetAndSetLong) UNIMPLEMENTED_INTRINSIC(MIPS, UnsafeGetAndSetObject) -UNIMPLEMENTED_INTRINSIC(MIPS, UnsafeLoadFence) -UNIMPLEMENTED_INTRINSIC(MIPS, UnsafeStoreFence) -UNIMPLEMENTED_INTRINSIC(MIPS, UnsafeFullFence) UNREACHABLE_INTRINSICS(MIPS) diff --git a/compiler/optimizing/intrinsics_mips64.cc b/compiler/optimizing/intrinsics_mips64.cc index 83dff33ec0..0dc602f1ef 100644 --- a/compiler/optimizing/intrinsics_mips64.cc +++ b/compiler/optimizing/intrinsics_mips64.cc @@ -1735,9 +1735,6 @@ UNIMPLEMENTED_INTRINSIC(MIPS64, UnsafeGetAndAddLong) UNIMPLEMENTED_INTRINSIC(MIPS64, UnsafeGetAndSetInt) UNIMPLEMENTED_INTRINSIC(MIPS64, UnsafeGetAndSetLong) UNIMPLEMENTED_INTRINSIC(MIPS64, UnsafeGetAndSetObject) -UNIMPLEMENTED_INTRINSIC(MIPS64, UnsafeLoadFence) -UNIMPLEMENTED_INTRINSIC(MIPS64, UnsafeStoreFence) -UNIMPLEMENTED_INTRINSIC(MIPS64, UnsafeFullFence) UNREACHABLE_INTRINSICS(MIPS64) diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc index 048590e1be..4c802c0a1a 100644 --- a/compiler/optimizing/intrinsics_x86.cc +++ b/compiler/optimizing/intrinsics_x86.cc @@ -2643,9 +2643,6 @@ UNIMPLEMENTED_INTRINSIC(X86, UnsafeGetAndAddLong) UNIMPLEMENTED_INTRINSIC(X86, UnsafeGetAndSetInt) UNIMPLEMENTED_INTRINSIC(X86, UnsafeGetAndSetLong) UNIMPLEMENTED_INTRINSIC(X86, UnsafeGetAndSetObject) -UNIMPLEMENTED_INTRINSIC(X86, UnsafeLoadFence) -UNIMPLEMENTED_INTRINSIC(X86, UnsafeStoreFence) -UNIMPLEMENTED_INTRINSIC(X86, UnsafeFullFence) UNREACHABLE_INTRINSICS(X86) diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc index 35e13a6540..41095cd485 100644 --- a/compiler/optimizing/intrinsics_x86_64.cc +++ b/compiler/optimizing/intrinsics_x86_64.cc @@ -2721,9 +2721,6 @@ UNIMPLEMENTED_INTRINSIC(X86_64, UnsafeGetAndAddLong) UNIMPLEMENTED_INTRINSIC(X86_64, UnsafeGetAndSetInt) UNIMPLEMENTED_INTRINSIC(X86_64, UnsafeGetAndSetLong) UNIMPLEMENTED_INTRINSIC(X86_64, UnsafeGetAndSetObject) -UNIMPLEMENTED_INTRINSIC(X86_64, UnsafeLoadFence) -UNIMPLEMENTED_INTRINSIC(X86_64, UnsafeStoreFence) -UNIMPLEMENTED_INTRINSIC(X86_64, UnsafeFullFence) UNREACHABLE_INTRINSICS(X86_64) diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index b684cc697f..ecb690ff62 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -26,6 +26,7 @@ #include "base/arena_object.h" #include "base/stl_util.h" #include "dex/compiler_enums.h" +#include "dex_instruction-inl.h" #include "entrypoints/quick/quick_entrypoints_enum.h" #include "handle.h" #include "handle_scope.h" diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index b49b91d984..42f22afd80 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -913,7 +913,8 @@ bool OptimizingCompiler::JitCompile(Thread* self, return false; } - if (GetCompilerDriver()->GetCompilerOptions().GetGenerateDebugInfo()) { + const CompilerOptions& compiler_options = GetCompilerDriver()->GetCompilerOptions(); + if (compiler_options.GetGenerateDebugInfo()) { const auto* method_header = reinterpret_cast<const OatQuickMethodHeader*>(code); const uintptr_t code_address = reinterpret_cast<uintptr_t>(method_header->GetCode()); CompiledMethod compiled_method( @@ -936,6 +937,7 @@ bool OptimizingCompiler::JitCompile(Thread* self, access_flags, code_item, false, // deduped. + compiler_options.GetNativeDebuggable(), code_address, code_address + code_allocator.GetSize(), &compiled_method |