Commit c894fee0 authored by Marja Hölttä's avatar Marja Hölttä Committed by V8 LUCI CQ

[baseline] Use a more obvious error message when the accumulator is clobbered

This error type is very common and deserves its own error message
instead of the generic "Unexpected value" one.

Change-Id: I07a0de8b190db58e97fae98d0f7347872efd9995
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3892694
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83180}
parent c8a2d899
......@@ -610,7 +610,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) {
assembler_->masm()->cmp(reg, kInterpreterAccumulatorRegister);
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue);
assembler_->masm()->Assert(eq, AbortReason::kAccumulatorClobbered);
}
} // namespace baseline
......
......@@ -677,7 +677,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) {
assembler_->masm()->CmpTagged(reg, kInterpreterAccumulatorRegister);
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue);
assembler_->masm()->Assert(eq, AbortReason::kAccumulatorClobbered);
}
} // namespace baseline
......
......@@ -577,7 +577,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) {
assembler_->masm()->cmp(reg, kInterpreterAccumulatorRegister);
assembler_->masm()->Assert(equal, AbortReason::kUnexpectedValue);
assembler_->masm()->Assert(equal, AbortReason::kAccumulatorClobbered);
}
} // namespace baseline
......
......@@ -569,7 +569,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) {
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue, reg,
assembler_->masm()->Assert(eq, AbortReason::kAccumulatorClobbered, reg,
Operand(kInterpreterAccumulatorRegister));
}
......
......@@ -581,7 +581,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) {
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue, reg,
assembler_->masm()->Assert(eq, AbortReason::kAccumulatorClobbered, reg,
Operand(kInterpreterAccumulatorRegister));
}
......
......@@ -754,7 +754,7 @@ inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
} else {
assembler_->masm()->CmpU64(reg, kInterpreterAccumulatorRegister);
}
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue);
assembler_->masm()->Assert(eq, AbortReason::kAccumulatorClobbered);
}
} // namespace baseline
......
......@@ -602,7 +602,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) {
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue, reg,
assembler_->masm()->Assert(eq, AbortReason::kAccumulatorClobbered, reg,
Operand(kInterpreterAccumulatorRegister));
}
} // namespace baseline
......
......@@ -752,7 +752,7 @@ inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
} else {
assembler_->masm()->CmpU64(reg, kInterpreterAccumulatorRegister);
}
assembler_->masm()->Assert(eq, AbortReason::kUnexpectedValue);
assembler_->masm()->Assert(eq, AbortReason::kAccumulatorClobbered);
}
} // namespace baseline
......
......@@ -639,7 +639,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
inline void EnsureAccumulatorPreservedScope::AssertEqualToAccumulator(
Register reg) {
assembler_->masm()->cmp_tagged(reg, kInterpreterAccumulatorRegister);
assembler_->masm()->Assert(equal, AbortReason::kUnexpectedValue);
assembler_->masm()->Assert(equal, AbortReason::kAccumulatorClobbered);
}
} // namespace baseline
......
......@@ -17,6 +17,7 @@ namespace internal {
"32 bit value in register is not zero-extended") \
V(kSignedBitOfSmiIsNotZero, "Signed bit of 31 bit smi register is not zero") \
V(kAPICallReturnedInvalidObject, "API call returned invalid object") \
V(kAccumulatorClobbered, "Accumulator clobbered") \
V(kAllocatingNonEmptyPackedArray, "Allocating non-empty packed array") \
V(kAllocationIsNotDoubleAligned, "Allocation is not double aligned") \
V(kExpectedOptimizationSentinel, \
......
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