summaryrefslogtreecommitdiff
path: root/compiler/optimizing/intrinsics_x86_64.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-01-25 09:56:06 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2024-01-29 08:47:22 +0000
commitd76551c7229060a3fe11258b490a11f4ee91e9f8 (patch)
treef8fcb5e839b1d2c0a61347b764f6a76dda117a84 /compiler/optimizing/intrinsics_x86_64.cc
parentb782659336403e125e33f829afad49b901027c22 (diff)
Revert^7 "Disable write-barrier elimination pass"
This reverts commit 1ba3516e8c3e2b86c73084893dd297f468469181. Reason for revert: PS1 is reland as-is PS2 has two related fixes (for RISC-V and arm64) taking into account that when we store zero, we use a special register. Bug: 301833859 Bug: 310755375 Bug: 260843353 Test: lunch cf_riscv64_wear-trunk_staging-userdebug && m Test: lunch starnix_wear_yukawa-trunk_staging-userdebug && m Change-Id: I5e69890fd56404ddde56ebc457179241363d9243
Diffstat (limited to 'compiler/optimizing/intrinsics_x86_64.cc')
-rw-r--r--compiler/optimizing/intrinsics_x86_64.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc
index 5177ac4d44..1876a70541 100644
--- a/compiler/optimizing/intrinsics_x86_64.cc
+++ b/compiler/optimizing/intrinsics_x86_64.cc
@@ -1153,8 +1153,7 @@ void IntrinsicCodeGeneratorX86_64::VisitSystemArrayCopy(HInvoke* invoke) {
}
// We only need one card marking on the destination array.
- codegen_->MarkGCCard(
- temp1, temp2, dest, CpuRegister(kNoRegister), /* emit_null_check= */ false);
+ codegen_->MarkGCCard(temp1, temp2, dest);
__ Bind(&skip_copy_and_write_barrier);
}
@@ -2091,11 +2090,11 @@ static void GenUnsafePut(LocationSummary* locations, DataType::Type type, bool i
if (type == DataType::Type::kReference) {
bool value_can_be_null = true; // TODO: Worth finding out this information?
- codegen->MarkGCCard(locations->GetTemp(0).AsRegister<CpuRegister>(),
- locations->GetTemp(1).AsRegister<CpuRegister>(),
- base,
- value,
- value_can_be_null);
+ codegen->MaybeMarkGCCard(locations->GetTemp(0).AsRegister<CpuRegister>(),
+ locations->GetTemp(1).AsRegister<CpuRegister>(),
+ base,
+ value,
+ value_can_be_null);
}
}
@@ -2390,7 +2389,7 @@ static void GenCompareAndSetOrExchangeRef(CodeGeneratorX86_64* codegen,
// Mark card for object assuming new value is stored.
bool value_can_be_null = true; // TODO: Worth finding out this information?
- codegen->MarkGCCard(temp1, temp2, base, value, value_can_be_null);
+ codegen->MaybeMarkGCCard(temp1, temp2, base, value, value_can_be_null);
Address field_addr(base, offset, TIMES_1, 0);
if (codegen->EmitBakerReadBarrier()) {
@@ -2701,7 +2700,7 @@ static void GenUnsafeGetAndUpdate(HInvoke* invoke,
// Mark card for object as a new value shall be stored.
bool new_value_can_be_null = true; // TODO: Worth finding out this information?
- codegen->MarkGCCard(temp1, temp2, base, /*value=*/ out, new_value_can_be_null);
+ codegen->MaybeMarkGCCard(temp1, temp2, base, /*value=*/out, new_value_can_be_null);
if (kPoisonHeapReferences) {
// Use a temp to avoid poisoning base of the field address, which might happen if `out`
@@ -4159,7 +4158,8 @@ static void GenerateVarHandleSet(HInvoke* invoke,
/*value_can_be_null=*/true,
byte_swap,
// Value can be null, and this write barrier is not being relied on for other sets.
- WriteBarrierKind::kEmitWithNullCheck);
+ value_type == DataType::Type::kReference ? WriteBarrierKind::kEmitNotBeingReliedOn :
+ WriteBarrierKind::kDontEmit);
// setVolatile needs kAnyAny barrier, but HandleFieldSet takes care of that.
@@ -4444,7 +4444,7 @@ static void GenerateVarHandleGetAndSet(HInvoke* invoke,
&temp1,
&temp2);
}
- codegen->MarkGCCard(temp1, temp2, ref, valreg, /* emit_null_check= */ false);
+ codegen->MarkGCCard(temp1, temp2, ref);
DCHECK_EQ(valreg, out.AsRegister<CpuRegister>());
if (kPoisonHeapReferences) {