Commit e5e59323 authored by Yahan Lu's avatar Yahan Lu Committed by Commit Bot

[riscv64]Clean call/jump register

Change-Id: I33d7bdfc14af9ad169c79a3efd6af6ba2f2362c2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2814726
Commit-Queue: Brice Dobry <brice.dobry@futurewei.com>
Reviewed-by: 's avatarBrice Dobry <brice.dobry@futurewei.com>
Cr-Commit-Position: refs/heads/master@{#74124}
parent 7c5e99c0
...@@ -1727,12 +1727,12 @@ void Generate_ContinueToBuiltinHelper(MacroAssembler* masm, ...@@ -1727,12 +1727,12 @@ void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
sp, BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp)); sp, BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp));
// Load builtin index (stored as a Smi) and use it to get the builtin start // Load builtin index (stored as a Smi) and use it to get the builtin start
// address from the builtins table. // address from the builtins table.
__ Pop(t0); __ Pop(t6);
__ Add64(sp, sp, __ Add64(sp, sp,
Operand(BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp)); Operand(BuiltinContinuationFrameConstants::kFixedFrameSizeFromFp));
__ Pop(ra); __ Pop(ra);
__ LoadEntryFromBuiltinIndex(t0); __ LoadEntryFromBuiltinIndex(t6);
__ Jump(t0); __ Jump(t6);
} }
} // namespace } // namespace
...@@ -3476,9 +3476,9 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm, ...@@ -3476,9 +3476,9 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
} }
} }
__ pop(t3); // Get continuation, leave pc on stack. __ pop(t6); // Get continuation, leave pc on stack.
__ pop(ra); __ pop(ra);
__ Jump(t3); __ Jump(t6);
__ stop(); __ stop();
} }
......
...@@ -4584,12 +4584,10 @@ void TurboAssembler::ResetSpeculationPoisonRegister() { ...@@ -4584,12 +4584,10 @@ void TurboAssembler::ResetSpeculationPoisonRegister() {
void TurboAssembler::CallForDeoptimization(Builtins::Name target, int, void TurboAssembler::CallForDeoptimization(Builtins::Name target, int,
Label* exit, DeoptimizeKind kind, Label* exit, DeoptimizeKind kind,
Label* ret, Label*) { Label* ret, Label*) {
UseScratchRegisterScope temps(this);
BlockTrampolinePoolScope block_trampoline_pool(this); BlockTrampolinePoolScope block_trampoline_pool(this);
Register scratch = temps.Acquire(); Ld(t6,
Ld(scratch,
MemOperand(kRootRegister, IsolateData::builtin_entry_slot_offset(target))); MemOperand(kRootRegister, IsolateData::builtin_entry_slot_offset(target)));
Call(scratch); Call(t6);
DCHECK_EQ(SizeOfCodeGeneratedSince(exit), DCHECK_EQ(SizeOfCodeGeneratedSince(exit),
(kind == DeoptimizeKind::kLazy) (kind == DeoptimizeKind::kLazy)
? Deoptimizer::kLazyDeoptExitSize ? Deoptimizer::kLazyDeoptExitSize
......
...@@ -337,7 +337,7 @@ constexpr Register kJavaScriptCallTargetRegister = kJSFunctionRegister; ...@@ -337,7 +337,7 @@ constexpr Register kJavaScriptCallTargetRegister = kJSFunctionRegister;
constexpr Register kJavaScriptCallNewTargetRegister = a3; constexpr Register kJavaScriptCallNewTargetRegister = a3;
constexpr Register kJavaScriptCallExtraArg1Register = a2; constexpr Register kJavaScriptCallExtraArg1Register = a2;
constexpr Register kOffHeapTrampolineRegister = t3; constexpr Register kOffHeapTrampolineRegister = t6;
constexpr Register kRuntimeCallFunctionRegister = a1; constexpr Register kRuntimeCallFunctionRegister = a1;
constexpr Register kRuntimeCallArgCountRegister = a0; constexpr Register kRuntimeCallArgCountRegister = a0;
constexpr Register kRuntimeCallArgvRegister = a2; constexpr Register kRuntimeCallArgvRegister = a2;
......
...@@ -611,8 +611,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -611,8 +611,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
Address wasm_code = static_cast<Address>(constant.ToInt64()); Address wasm_code = static_cast<Address>(constant.ToInt64());
__ Call(wasm_code, constant.rmode()); __ Call(wasm_code, constant.rmode());
} else { } else {
__ Add64(kScratchReg, i.InputRegister(0), 0); __ Add64(t6, i.InputRegister(0), 0);
__ Call(kScratchReg); __ Call(t6);
} }
RecordCallPosition(instr); RecordCallPosition(instr);
frame_access_state()->ClearSPDelta(); frame_access_state()->ClearSPDelta();
......
...@@ -2557,8 +2557,8 @@ void LiftoffAssembler::CallIndirect(const ValueKindSig* sig, ...@@ -2557,8 +2557,8 @@ void LiftoffAssembler::CallIndirect(const ValueKindSig* sig,
compiler::CallDescriptor* call_descriptor, compiler::CallDescriptor* call_descriptor,
Register target) { Register target) {
if (target == no_reg) { if (target == no_reg) {
pop(kScratchReg); pop(t6);
Call(kScratchReg); Call(t6);
} else { } else {
Call(target); Call(target);
} }
...@@ -2566,8 +2566,8 @@ void LiftoffAssembler::CallIndirect(const ValueKindSig* sig, ...@@ -2566,8 +2566,8 @@ void LiftoffAssembler::CallIndirect(const ValueKindSig* sig,
void LiftoffAssembler::TailCallIndirect(Register target) { void LiftoffAssembler::TailCallIndirect(Register target) {
if (target == no_reg) { if (target == no_reg) {
Pop(kScratchReg); Pop(t6);
Jump(kScratchReg); Jump(t6);
} else { } else {
Jump(target); Jump(target);
} }
......
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