Commit d8df3dbf authored by Lu Yahan's avatar Lu Yahan Committed by V8 LUCI CQ

[riscv64] Add Label::Distance flag to control emit Branchshort.

Add Label::Distance flag to control emit Branchshort.

Change-Id: I418024ea530ae41788c5684bb8bd2044311a99d5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2959266
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Reviewed-by: 's avatarBrice Dobry <brice.dobry@futurewei.com>
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/master@{#75447}
parent bf44d3ab
......@@ -614,7 +614,7 @@ void BaselineAssembler::EmitReturn(MacroAssembler* masm) {
// arguments.
Label corrected_args_count;
__ masm()->Branch(&corrected_args_count, ge, params_size,
Operand(actual_params_size));
Operand(actual_params_size), Label::Distance::kNear);
__ masm()->Move(params_size, actual_params_size);
__ Bind(&corrected_args_count);
......
This diff is collapsed.
......@@ -2559,7 +2559,7 @@ void TurboAssembler::Branch(int32_t offset) {
}
void TurboAssembler::Branch(int32_t offset, Condition cond, Register rs,
const Operand& rt) {
const Operand& rt, Label::Distance near_jump) {
bool is_near = BranchShortCheck(offset, nullptr, cond, rs, rt);
DCHECK(is_near);
USE(is_near);
......@@ -2582,7 +2582,7 @@ void TurboAssembler::Branch(Label* L) {
}
void TurboAssembler::Branch(Label* L, Condition cond, Register rs,
const Operand& rt) {
const Operand& rt, Label::Distance near_jump) {
if (L->is_bound()) {
if (!BranchShortCheck(0, L, cond, rs, rt)) {
if (cond != cc_always) {
......@@ -2597,7 +2597,7 @@ void TurboAssembler::Branch(Label* L, Condition cond, Register rs,
}
}
} else {
if (is_trampoline_emitted()) {
if (is_trampoline_emitted() && near_jump == Label::Distance::kFar) {
if (cond != cc_always) {
Label skip;
Condition neg_cond = NegateCondition(cond);
......
......@@ -146,10 +146,15 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
DECLARE_NORELOC_PROTOTYPE(Name, Label*) \
DECLARE_NORELOC_PROTOTYPE(Name, int32_t)
DECLARE_BRANCH_PROTOTYPES(Branch)
DECLARE_BRANCH_PROTOTYPES(BranchAndLink)
DECLARE_BRANCH_PROTOTYPES(BranchShort)
void Branch(Label* target);
void Branch(int32_t target);
void Branch(Label* target, Condition cond, Register r1, const Operand& r2,
Label::Distance near_jump = Label::kFar);
void Branch(int32_t target, Condition cond, Register r1, const Operand& r2,
Label::Distance near_jump = Label::kFar);
#undef DECLARE_BRANCH_PROTOTYPES
#undef COND_TYPED_ARGS
#undef COND_ARGS
......
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