PPC/s390: Reland "[Turboprop] Move dynamic check maps immediate args to deopt exit."

Port 7bdb0fbb81

Original Commit Message:

    This is a reland of b2a611d815

    Original change's description:
    > [Turboprop] Move dynamic check maps immediate args to deopt exit.
    >
    > Rather than loading the immediate arguments required by the
    > dynamic check maps builtin into registers in the fast-path,
    > instead insert them into the instruction stream in the deopt
    > exit and have the builtin load them into registers itself.
    >
    > BUG=v8:10582
    >
    > Change-Id: I66716570b408501374eed8f5e6432df64c6deb7c
    > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2589736
    > Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
    > Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
    > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#71790}

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

Change-Id: I83fc0f3e3ebcf19ca4303e50aae94d7b353cd0ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2595708
Reviewed-by: Joran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71809}
This commit is contained in:
Milad Fa 2020-12-16 17:15:30 -05:00 committed by Commit Bot
parent a3ce2f6da2
commit 07f0b7a4c8
8 changed files with 42 additions and 6 deletions

View File

@ -3572,6 +3572,19 @@ void Builtins::Generate_DynamicCheckMapsTrampoline(MacroAssembler* masm) {
if (FLAG_debug_code) registers |= kJSCallerSaved;
__ SaveRegisters(registers);
// Load the immediate arguments from the deopt exit to pass to the builtin.
Register slot_arg =
descriptor.GetRegisterParameter(DynamicCheckMapsDescriptor::kSlot);
Register handler_arg =
descriptor.GetRegisterParameter(DynamicCheckMapsDescriptor::kHandler);
__ LoadP(handler_arg, MemOperand(fp, CommonFrameConstants::kCallerPCOffset));
__ LoadP(
slot_arg,
MemOperand(handler_arg, Deoptimizer::kEagerWithResumeImmedArgs1PcOffset));
__ LoadP(
handler_arg,
MemOperand(handler_arg, Deoptimizer::kEagerWithResumeImmedArgs2PcOffset));
__ Call(BUILTIN_CODE(masm->isolate(), DynamicCheckMaps),
RelocInfo::CODE_TARGET);

View File

@ -3593,6 +3593,19 @@ void Builtins::Generate_DynamicCheckMapsTrampoline(MacroAssembler* masm) {
if (FLAG_debug_code) registers |= kJSCallerSaved;
__ SaveRegisters(registers);
// Load the immediate arguments from the deopt exit to pass to the builtin.
Register slot_arg =
descriptor.GetRegisterParameter(DynamicCheckMapsDescriptor::kSlot);
Register handler_arg =
descriptor.GetRegisterParameter(DynamicCheckMapsDescriptor::kHandler);
__ LoadP(handler_arg, MemOperand(fp, CommonFrameConstants::kCallerPCOffset));
__ LoadP(
slot_arg,
MemOperand(handler_arg, Deoptimizer::kEagerWithResumeImmedArgs1PcOffset));
__ LoadP(
handler_arg,
MemOperand(handler_arg, Deoptimizer::kEagerWithResumeImmedArgs2PcOffset));
__ Call(BUILTIN_CODE(masm->isolate(), DynamicCheckMaps),
RelocInfo::CODE_TARGET);

View File

@ -3359,7 +3359,7 @@ void TurboAssembler::CallForDeoptimization(Builtins::Name target, int,
if (kind == DeoptimizeKind::kEagerWithResume) {
b(ret);
DCHECK_EQ(SizeOfCodeGeneratedSince(exit),
Deoptimizer::kEagerWithResumeDeoptExitSize);
Deoptimizer::kEagerWithResumeBeforeArgsSize);
}
}

View File

@ -4480,7 +4480,7 @@ void TurboAssembler::CallForDeoptimization(Builtins::Name target, int,
if (kind == DeoptimizeKind::kEagerWithResume) {
bc_long(Condition::al, ret);
DCHECK_EQ(SizeOfCodeGeneratedSince(exit),
Deoptimizer::kEagerWithResumeDeoptExitSize);
Deoptimizer::kEagerWithResumeBeforeArgsSize);
}
}

View File

@ -1130,7 +1130,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
case kArchDeoptimize: {
DeoptimizationExit* exit =
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
BuildTranslation(instr, -1, 0, 0, OutputFrameStateCombine::Ignore());
__ b(exit->label());
break;
}

View File

@ -1409,7 +1409,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
case kArchDeoptimize: {
DeoptimizationExit* exit =
BuildTranslation(instr, -1, 0, OutputFrameStateCombine::Ignore());
BuildTranslation(instr, -1, 0, 0, OutputFrameStateCombine::Ignore());
__ b(exit->label());
break;
}

View File

@ -14,7 +14,12 @@ namespace internal {
const bool Deoptimizer::kSupportsFixedDeoptExitSizes = true;
const int Deoptimizer::kNonLazyDeoptExitSize = 3 * kInstrSize;
const int Deoptimizer::kLazyDeoptExitSize = 3 * kInstrSize;
const int Deoptimizer::kEagerWithResumeDeoptExitSize = 4 * kInstrSize;
const int Deoptimizer::kEagerWithResumeBeforeArgsSize = 4 * kInstrSize;
const int Deoptimizer::kEagerWithResumeDeoptExitSize =
kEagerWithResumeBeforeArgsSize + 2 * kSystemPointerSize;
const int Deoptimizer::kEagerWithResumeImmedArgs1PcOffset = kInstrSize;
const int Deoptimizer::kEagerWithResumeImmedArgs2PcOffset =
kInstrSize + kSystemPointerSize;
Float32 RegisterValues::GetFloatRegister(unsigned n) const {
float float_val = static_cast<float>(double_registers_[n].get_scalar());

View File

@ -10,7 +10,12 @@ namespace internal {
const bool Deoptimizer::kSupportsFixedDeoptExitSizes = true;
const int Deoptimizer::kNonLazyDeoptExitSize = 6 + 2;
const int Deoptimizer::kLazyDeoptExitSize = 6 + 2;
const int Deoptimizer::kEagerWithResumeDeoptExitSize = 6 + 2 + 6;
const int Deoptimizer::kEagerWithResumeBeforeArgsSize = 6 + 2 + 6;
const int Deoptimizer::kEagerWithResumeDeoptExitSize =
kEagerWithResumeBeforeArgsSize + 2 * kSystemPointerSize;
const int Deoptimizer::kEagerWithResumeImmedArgs1PcOffset = 6;
const int Deoptimizer::kEagerWithResumeImmedArgs2PcOffset =
6 + kSystemPointerSize;
Float32 RegisterValues::GetFloatRegister(unsigned n) const {
return Float32::FromBits(