Commit db9e3428 authored by Junliang Yan's avatar Junliang Yan Committed by V8 LUCI CQ

s390x: [baseline] fix ptr-compr issue

Change-Id: I8f0235877f9f31a5f81467a9f0ccfbc7491faa14
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3757888Reviewed-by: 's avatarMilad Farazmand <mfarazma@redhat.com>
Commit-Queue: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#81688}
parent 8d52262b
...@@ -135,12 +135,23 @@ inline bool IsSignedCondition(Condition cond) { ...@@ -135,12 +135,23 @@ inline bool IsSignedCondition(Condition cond) {
#define __ assm-> #define __ assm->
// s390x helper // s390x helper
template <int width = 64>
static void JumpIfHelper(MacroAssembler* assm, Condition cc, Register lhs, static void JumpIfHelper(MacroAssembler* assm, Condition cc, Register lhs,
Register rhs, Label* target) { Register rhs, Label* target) {
if (IsSignedCondition(cc)) { static_assert(width == 64 || width == 32,
__ CmpS64(lhs, rhs); "only support 64 and 32 bit compare");
if (width == 64) {
if (IsSignedCondition(cc)) {
__ CmpS64(lhs, rhs);
} else {
__ CmpU64(lhs, rhs);
}
} else { } else {
__ CmpU64(lhs, rhs); if (IsSignedCondition(cc)) {
__ CmpS32(lhs, rhs);
} else {
__ CmpU32(lhs, rhs);
}
} }
__ b(AsMasmCondition(cc), target); __ b(AsMasmCondition(cc), target);
} }
...@@ -308,16 +319,16 @@ void BaselineAssembler::JumpIfTagged(Condition cc, Register value, ...@@ -308,16 +319,16 @@ void BaselineAssembler::JumpIfTagged(Condition cc, Register value,
MemOperand operand, Label* target, MemOperand operand, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_); ASM_CODE_COMMENT(masm_);
__ LoadU64(r0, operand); __ LoadTaggedPointerField(ip, operand, r0);
JumpIfHelper(masm_, cc, value, r0, target); JumpIfHelper<COMPRESS_POINTERS_BOOL ? 32 : 64>(masm_, cc, value, ip, target);
} }
void BaselineAssembler::JumpIfTagged(Condition cc, MemOperand operand, void BaselineAssembler::JumpIfTagged(Condition cc, MemOperand operand,
Register value, Label* target, Register value, Label* target,
Label::Distance) { Label::Distance) {
ASM_CODE_COMMENT(masm_); ASM_CODE_COMMENT(masm_);
__ LoadU64(r0, operand); __ LoadTaggedPointerField(ip, operand, r0);
JumpIfHelper(masm_, cc, r0, value, target); JumpIfHelper<COMPRESS_POINTERS_BOOL ? 32 : 64>(masm_, cc, ip, value, target);
} }
void BaselineAssembler::JumpIfByte(Condition cc, Register value, int32_t byte, void BaselineAssembler::JumpIfByte(Condition cc, Register value, int32_t byte,
Label* target, Label::Distance) { Label* target, Label::Distance) {
...@@ -702,7 +713,11 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) { ...@@ -702,7 +713,11 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator( inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) { Register reg) {
assembler_->masm()->CmpU64(reg, kInterpreterAccumulatorRegister); if (COMPRESS_POINTERS_BOOL) {
assembler_->masm()->CmpU32(reg, kInterpreterAccumulatorRegister);
} else {
assembler_->masm()->CmpU64(reg, kInterpreterAccumulatorRegister);
}
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue); assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue);
} }
......
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