From 31b949bc4a76e5c6d00a8e18c346f123b5321a1c Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Mon, 22 Jan 2024 15:03:42 +0000 Subject: Revert^4 "Disable write-barrier elimination pass" This reverts commit b5b98b9bb31acb2deffb692c50d0fbc71476663b. Reason for revert: Breaks tests in arm64 + heap poison configurations Bug: 310755375 Bug: 260843353 Change-Id: I682c74987a365497e0dbe47eba26a9ccf0513561 --- compiler/optimizing/code_generator.cc | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 441a93c38f..b00e7e1873 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -158,25 +158,6 @@ ReadBarrierOption CodeGenerator::GetCompilerReadBarrierOption() const { return EmitReadBarrier() ? kWithReadBarrier : kWithoutReadBarrier; } -bool CodeGenerator::ShouldCheckGCCard(DataType::Type type, - HInstruction* value, - WriteBarrierKind write_barrier_kind) const { - const CompilerOptions& options = GetCompilerOptions(); - const bool result = - // Check the GC card in debug mode, - options.EmitRunTimeChecksInDebugMode() && - // only for CC GC, - options.EmitReadBarrier() && - // and if we eliminated the write barrier in WBE. - !StoreNeedsWriteBarrier(type, value, write_barrier_kind) && - CodeGenerator::StoreNeedsWriteBarrier(type, value); - - DCHECK_IMPLIES(result, write_barrier_kind == WriteBarrierKind::kDontEmit); - DCHECK_IMPLIES(result, !GetGraph()->IsCompilingBaseline()); - - return result; -} - ScopedArenaAllocator* CodeGenerator::GetScopedAllocator() { DCHECK(code_generation_data_ != nullptr); return code_generation_data_->GetScopedAllocator(); @@ -1627,17 +1608,6 @@ void CodeGenerator::EmitParallelMoves(Location from1, GetMoveResolver()->EmitNativeCode(¶llel_move); } -bool CodeGenerator::StoreNeedsWriteBarrier(DataType::Type type, - HInstruction* value, - WriteBarrierKind write_barrier_kind) const { - // Check that null value is not represented as an integer constant. - DCHECK_IMPLIES(type == DataType::Type::kReference, !value->IsIntConstant()); - // Branch profiling currently doesn't support running optimizations. - return GetGraph()->IsCompilingBaseline() - ? CodeGenerator::StoreNeedsWriteBarrier(type, value) - : write_barrier_kind != WriteBarrierKind::kDontEmit; -} - void CodeGenerator::ValidateInvokeRuntime(QuickEntrypointEnum entrypoint, HInstruction* instruction, SlowPathCode* slow_path) { -- cgit v1.2.3-59-g8ed1b