Commit e7195170 authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

PPC/s390: [sparkplug] Use return to jump to optimized code to keep the RSB balanced

Port af3c5307

Original Commit Message:

    This threads through a JumpMode kJump/kReturn to JumpCodeObject so we
    can use a return instruction to jump instead by first pushing the jump
    target and then using a return instruction.

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

Change-Id: I354329238d00503a234556f25adccd920d26d320
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2700036Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#72816}
parent 862c6281
......@@ -3336,7 +3336,8 @@ void TurboAssembler::CallCodeObject(Register code_object) {
Call(code_object);
}
void TurboAssembler::JumpCodeObject(Register code_object) {
void TurboAssembler::JumpCodeObject(Register code_object, JumpMode jump_mode) {
DCHECK_EQ(JumpMode::kJump, jump_mode);
LoadCodeObjectEntry(code_object, code_object);
Jump(code_object);
}
......
......@@ -443,7 +443,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void LoadEntryFromBuiltinIndex(Register builtin_index);
void LoadCodeObjectEntry(Register destination, Register code_object) override;
void CallCodeObject(Register code_object) override;
void JumpCodeObject(Register code_object) override;
void JumpCodeObject(Register code_object,
JumpMode jump_mode = JumpMode::kJump) override;
void CallBuiltinByIndex(Register builtin_index) override;
void CallForDeoptimization(Builtins::Name target, int deopt_id, Label* exit,
......
......@@ -4654,7 +4654,8 @@ void TurboAssembler::CallCodeObject(Register code_object) {
Call(code_object);
}
void TurboAssembler::JumpCodeObject(Register code_object) {
void TurboAssembler::JumpCodeObject(Register code_object, JumpMode jump_mode) {
DCHECK_EQ(JumpMode::kJump, jump_mode);
LoadCodeObjectEntry(code_object, code_object);
Jump(code_object);
}
......
......@@ -102,7 +102,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void LoadEntryFromBuiltinIndex(Register builtin_index);
void LoadCodeObjectEntry(Register destination, Register code_object) override;
void CallCodeObject(Register code_object) override;
void JumpCodeObject(Register code_object) override;
void JumpCodeObject(Register code_object,
JumpMode jump_mode = JumpMode::kJump) override;
void CallBuiltinByIndex(Register builtin_index) override;
......
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