diff options
author | 2024-01-23 13:55:50 +0000 | |
---|---|---|
committer | 2024-01-24 13:33:33 +0000 | |
commit | 1be176f5a78750e2f0e32470f8c83e3d1643954d (patch) | |
tree | 5b6ba41dc94cebac7f65a2bb97355398094964b3 /compiler/optimizing/intrinsics_x86_64.cc | |
parent | 6799d71854007cb1efe2bb4dcceda9f0f4f0e0a3 (diff) |
Revert^5 "Disable write-barrier elimination pass"
This reverts commit 31b949bc4a76e5c6d00a8e18c346f123b5321a1c.
Reason for revert:
PS1 is reland as-is
PS2 has two fixes:
* Missed poisoning heap references in a code path
* Removed incorrect DCHECK
Change-Id: I81b317ddc704dbd8a173f5d5c624dbc69e2d9e60
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: art/test/testrunner/testrunner.py --target --64 --optimizing -b
Both commnands with `export ART_HEAP_POISONING=true`
Bug: 301833859
Bug: 310755375
Bug: 260843353
Diffstat (limited to 'compiler/optimizing/intrinsics_x86_64.cc')
-rw-r--r-- | compiler/optimizing/intrinsics_x86_64.cc | 22 |
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) { |