Commit f4a2eda7 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC/s390: [write-barrier] Add debug check for cleared weak refs in write barrier

Port dbff2a67

R=dmercadier@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I6b34e6cd502012474c619bbcb1e473ee4f7472db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3564278Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79696}
parent 1b999119
......@@ -1112,6 +1112,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
Register scratch1 = i.TempRegister(1);
OutOfLineRecordWrite* ool;
if (FLAG_debug_code) {
// Checking that |value| is not a cleared weakref: our write barrier
// does not support that for now.
__ CmpS64(value, Operand(kClearedWeakHeapObjectLower32), kScratchReg);
__ Check(ne, AbortReason::kOperandIsCleared);
}
AddressingMode addressing_mode =
AddressingModeField::decode(instr->opcode());
if (addressing_mode == kMode_MRI) {
......
......@@ -1427,6 +1427,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
Register scratch1 = i.TempRegister(1);
OutOfLineRecordWrite* ool;
if (FLAG_debug_code) {
// Checking that |value| is not a cleared weakref: our write barrier
// does not support that for now.
__ CmpS64(value, Operand(kClearedWeakHeapObjectLower32));
__ Check(ne, AbortReason::kOperandIsCleared);
}
AddressingMode addressing_mode =
AddressingModeField::decode(instr->opcode());
if (addressing_mode == kMode_MRI) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment