Commit fb8efb12 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

Revert "[arm64] Preparation for padding of arguments"

This reverts commit bcf11729.

Reason for revert:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20nosnap%20-%20debug/builds/16791

The test cctest/test-run-tail-calls/FuzzStackParamCount hangs on
the nosnap debug bot and times out.

Original change's description:
> [arm64] Preparation for padding of arguments
> 
> As part of JSSP removal, we need to align the arguments passed to functions
> on the stack, by adding a padding slot when the total number of arguments
> is odd.
> 
> This patch introduces the kPadArguments flag (which is currently set to
> false for all architectures), which will control padding of arguments in
> architecture-independent parts of the code (deoptimizer, instruction
> selector).
> 
> It also adds some executable tests for tail calls with various stack
> parameter counts on the caller and callee sides.
> 
> This will be turned on for arm64 together with arm64-specific changes to
> the code generator, the MacroAsembler and the builtins, in a later patch.
> 
> Bug: v8:6644
> Change-Id: I79a5c149123fe8130cedd1ccffec3d9b50361e08
> Reviewed-on: https://chromium-review.googlesource.com/806554
> Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#50134}

TBR=rmcilroy@chromium.org,jarin@chromium.org,georgia.kouveli@arm.com

Change-Id: Iff4d7da418204834822842b160eacb8980058172
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6644
Reviewed-on: https://chromium-review.googlesource.com/830847Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50144}
parent 738b5c27
......@@ -173,7 +173,6 @@ GENERAL_REGISTERS(DECLARE_REGISTER)
#undef DECLARE_REGISTER
constexpr Register no_reg = Register::no_reg();
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = false;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -295,9 +295,6 @@ class Register : public CPURegister {
static_assert(IS_TRIVIALLY_COPYABLE(Register),
"Register can efficiently be passed by value");
// TODO(arm64): Switch this on when the rest of the argument padding changes
// are done.
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -101,24 +101,7 @@ int CallDescriptor::GetStackParameterDelta(
}
}
}
int stack_param_delta = callee_slots_above_sp - tail_caller_slots_above_sp;
if (kPadArguments) {
// Adjust stack delta when it is odd.
if (stack_param_delta % 2 != 0) {
if (callee_slots_above_sp % 2 != 0) {
// The delta is odd due to the callee - we will need to add one slot
// of padding.
++stack_param_delta;
} else {
// The delta is odd because of the caller. We already have one slot of
// padding that we can reuse for arguments, so we will need one fewer
// slot.
--stack_param_delta;
}
}
}
return stack_param_delta;
return callee_slots_above_sp - tail_caller_slots_above_sp;
}
bool CallDescriptor::CanTailCall(const Node* node) const {
......
......@@ -298,7 +298,7 @@ class V8_EXPORT_PRIVATE CallDescriptor final
bool HasSameReturnLocationsAs(const CallDescriptor* other) const;
int GetStackParameterDelta(const CallDescriptor* tail_caller) const;
int GetStackParameterDelta(const CallDescriptor* tail_caller = nullptr) const;
bool CanTailCall(const Node* call) const;
......
......@@ -556,10 +556,6 @@ int LookupCatchHandler(TranslatedFrame* translated_frame, int* data_out) {
return -1;
}
bool ShouldPadArguments(int arg_count) {
return kPadArguments && (arg_count % 2 != 0);
}
} // namespace
// We rely on this function not causing a GC. It is called from generated code
......@@ -732,8 +728,7 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame,
}
// The 'fixed' part of the frame consists of the incoming parameters and
// the part described by InterpreterFrameConstants. This will include
// argument padding, when needed.
// the part described by InterpreterFrameConstants.
unsigned fixed_frame_size = ComputeInterpretedFixedSize(shared);
unsigned output_frame_size = height_in_bytes + fixed_frame_size;
......@@ -758,20 +753,12 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame,
// Compute the incoming parameter translation.
unsigned output_offset = output_frame_size;
if (ShouldPadArguments(parameter_count)) {
output_offset -= kPointerSize;
WriteValueToOutput(isolate()->heap()->the_hole_value(), 0, frame_index,
output_offset, "padding ");
}
for (int i = 0; i < parameter_count; ++i) {
output_offset -= kPointerSize;
WriteTranslatedValueToOutput(&value_iterator, &input_index, frame_index,
output_offset);
}
DCHECK_EQ(output_offset, output_frame->GetLastArgumentSlotOffset());
if (trace_scope_ != nullptr) {
PrintF(trace_scope_->file(), " -------------------------\n");
}
......@@ -991,9 +978,6 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(
unsigned height = translated_frame->height();
unsigned height_in_bytes = height * kPointerSize;
int parameter_count = height;
if (ShouldPadArguments(parameter_count)) height_in_bytes += kPointerSize;
TranslatedFrame::iterator function_iterator = value_iterator;
Object* function = value_iterator->GetRawValue();
value_iterator++;
......@@ -1007,6 +991,7 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(
unsigned output_frame_size = height_in_bytes + fixed_frame_size;
// Allocate and store the output frame description.
int parameter_count = height;
FrameDescription* output_frame = new (output_frame_size)
FrameDescription(output_frame_size, parameter_count);
......@@ -1025,21 +1010,14 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(
}
output_frame->SetTop(top_address);
unsigned output_offset = output_frame_size;
if (ShouldPadArguments(parameter_count)) {
output_offset -= kPointerSize;
WriteValueToOutput(isolate()->heap()->the_hole_value(), 0, frame_index,
output_offset, "padding ");
}
// Compute the incoming parameter translation.
unsigned output_offset = output_frame_size;
for (int i = 0; i < parameter_count; ++i) {
output_offset -= kPointerSize;
WriteTranslatedValueToOutput(&value_iterator, &input_index, frame_index,
output_offset);
}
DCHECK_EQ(output_offset, output_frame->GetLastArgumentSlotOffset());
// Read caller's PC from the previous frame.
output_offset -= kPCOnStackSize;
intptr_t value;
......@@ -1152,9 +1130,6 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame,
if (PadTopOfStackRegister()) height_in_bytes += kPointerSize;
}
int parameter_count = height;
if (ShouldPadArguments(parameter_count)) height_in_bytes += kPointerSize;
JSFunction* function = JSFunction::cast(value_iterator->GetRawValue());
value_iterator++;
input_index++;
......@@ -1170,8 +1145,8 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame,
unsigned output_frame_size = height_in_bytes + fixed_frame_size;
// Allocate and store the output frame description.
FrameDescription* output_frame = new (output_frame_size)
FrameDescription(output_frame_size, parameter_count);
FrameDescription* output_frame =
new (output_frame_size) FrameDescription(output_frame_size);
// Construct stub can not be topmost.
DCHECK(frame_index > 0 && frame_index < output_count_);
......@@ -1184,15 +1159,9 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame,
top_address = output_[frame_index - 1]->GetTop() - output_frame_size;
output_frame->SetTop(top_address);
unsigned output_offset = output_frame_size;
if (ShouldPadArguments(parameter_count)) {
output_offset -= kPointerSize;
WriteValueToOutput(isolate()->heap()->the_hole_value(), 0, frame_index,
output_offset, "padding ");
}
// Compute the incoming parameter translation.
int parameter_count = height;
unsigned output_offset = output_frame_size;
for (int i = 0; i < parameter_count; ++i) {
output_offset -= kPointerSize;
// The allocated receiver of a construct stub frame is passed as the
......@@ -1203,7 +1172,6 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame,
(i == 0) ? reinterpret_cast<Address>(top_address) : nullptr);
}
DCHECK_EQ(output_offset, output_frame->GetLastArgumentSlotOffset());
// Read caller's PC from the previous frame.
output_offset -= kPCOnStackSize;
intptr_t callers_pc = output_[frame_index - 1]->GetPc();
......@@ -1268,12 +1236,7 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame,
output_offset, "padding");
output_offset -= kPointerSize;
if (ShouldPadArguments(parameter_count)) {
value = output_frame->GetFrameSlot(output_frame_size - 2 * kPointerSize);
} else {
value = output_frame->GetFrameSlot(output_frame_size - kPointerSize);
}
value = output_frame->GetFrameSlot(output_frame_size - kPointerSize);
output_frame->SetFrameSlot(output_offset, value);
if (bailout_id == BailoutId::ConstructStubCreate()) {
......@@ -1419,7 +1382,7 @@ void Deoptimizer::DoComputeBuiltinContinuation(
// parameter count.
int stack_param_count = height_in_words - register_parameter_count - 1;
if (must_handle_result) stack_param_count++;
unsigned output_frame_size =
int output_frame_size =
kPointerSize * (stack_param_count + allocatable_register_count +
padding_slot_count) +
BuiltinContinuationFrameConstants::kFixedFrameSize;
......@@ -1461,12 +1424,9 @@ void Deoptimizer::DoComputeBuiltinContinuation(
stack_param_count);
}
int translated_stack_parameters =
must_handle_result ? stack_param_count - 1 : stack_param_count;
if (ShouldPadArguments(stack_param_count)) output_frame_size += kPointerSize;
FrameDescription* output_frame = new (output_frame_size)
FrameDescription(output_frame_size, stack_param_count);
unsigned output_frame_offset = output_frame_size;
FrameDescription* output_frame =
new (output_frame_size) FrameDescription(output_frame_size);
output_[frame_index] = output_frame;
// The top address of the frame is computed from the previous frame's top and
......@@ -1497,12 +1457,8 @@ void Deoptimizer::DoComputeBuiltinContinuation(
intptr_t value;
unsigned output_frame_offset = output_frame_size;
if (ShouldPadArguments(stack_param_count)) {
output_frame_offset -= kPointerSize;
WriteValueToOutput(isolate()->heap()->the_hole_value(), 0, frame_index,
output_frame_offset, "padding ");
}
int translated_stack_parameters =
must_handle_result ? stack_param_count - 1 : stack_param_count;
for (int i = 0; i < translated_stack_parameters; ++i) {
output_frame_offset -= kPointerSize;
......@@ -1517,8 +1473,6 @@ void Deoptimizer::DoComputeBuiltinContinuation(
"placeholder for return result on lazy deopt ");
}
DCHECK_EQ(output_frame_offset, output_frame->GetLastArgumentSlotOffset());
for (int i = 0; i < register_parameter_count; ++i) {
Object* object = value_iterator->GetRawValue();
int code = continuation_descriptor.GetRegisterParameter(i).code();
......@@ -1800,6 +1754,14 @@ unsigned Deoptimizer::ComputeInputFrameSize() const {
return result;
}
// static
unsigned Deoptimizer::ComputeJavascriptFixedSize(SharedFunctionInfo* shared) {
// The fixed part of the frame consists of the return address, frame
// pointer, function, context, and all the incoming arguments.
return ComputeIncomingArgumentSize(shared) +
StandardFrameConstants::kFixedFrameSize;
}
// static
unsigned Deoptimizer::ComputeInterpretedFixedSize(SharedFunctionInfo* shared) {
// The fixed part of the frame consists of the return address, frame
......@@ -1810,9 +1772,7 @@ unsigned Deoptimizer::ComputeInterpretedFixedSize(SharedFunctionInfo* shared) {
// static
unsigned Deoptimizer::ComputeIncomingArgumentSize(SharedFunctionInfo* shared) {
int parameter_slots = shared->internal_formal_parameter_count() + 1;
if (kPadArguments) parameter_slots = RoundUp(parameter_slots, 2);
return parameter_slots * kPointerSize;
return (shared->internal_formal_parameter_count() + 1) * kPointerSize;
}
void Deoptimizer::EnsureCodeForDeoptimizationEntry(Isolate* isolate,
......
......@@ -547,6 +547,7 @@ class Deoptimizer : public Malloced {
unsigned ComputeInputFrameAboveFpFixedSize() const;
unsigned ComputeInputFrameSize() const;
static unsigned ComputeJavascriptFixedSize(SharedFunctionInfo* shared);
static unsigned ComputeInterpretedFixedSize(SharedFunctionInfo* shared);
static unsigned ComputeIncomingArgumentSize(SharedFunctionInfo* shared);
......@@ -699,15 +700,9 @@ class FrameDescription {
return *GetFrameSlotPointer(offset);
}
unsigned GetLastArgumentSlotOffset() {
int parameter_slots = parameter_count();
if (kPadArguments) parameter_slots = RoundUp(parameter_slots, 2);
return GetFrameSize() - parameter_slots * kPointerSize;
}
Address GetFramePointerAddress() {
int fp_offset =
GetLastArgumentSlotOffset() - StandardFrameConstants::kCallerSPOffset;
int fp_offset = GetFrameSize() - parameter_count() * kPointerSize -
StandardFrameConstants::kCallerSPOffset;
return reinterpret_cast<Address>(GetFrameSlotPointer(fp_offset));
}
......
......@@ -113,7 +113,6 @@ GENERAL_REGISTERS(DEFINE_REGISTER)
#undef DEFINE_REGISTER
constexpr Register no_reg = Register::no_reg();
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -238,7 +238,6 @@ int ToNumber(Register reg);
Register ToRegister(int num);
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -238,7 +238,6 @@ int ToNumber(Register reg);
Register ToRegister(int num);
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -303,7 +303,6 @@ constexpr Register kConstantPoolRegister = r28; // Constant pool.
constexpr Register kRootRegister = r29; // Roots array pointer.
constexpr Register cp = r30; // JavaScript context pointer.
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -276,7 +276,6 @@ constexpr Register kLithiumScratch = r1; // lithium scratch.
constexpr Register kRootRegister = r10; // Roots array pointer.
constexpr Register cp = r13; // JavaScript context pointer.
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -182,7 +182,6 @@ constexpr Register arg_reg_4 = rcx;
V(xmm13) \
V(xmm14)
constexpr bool kPadArguments = false;
constexpr bool kSimpleFPAliasing = true;
constexpr bool kSimdMaskRegisters = false;
......
......@@ -84,7 +84,6 @@ v8_source_set("cctest_sources") {
"compiler/test-run-native-calls.cc",
"compiler/test-run-stackcheck.cc",
"compiler/test-run-stubs.cc",
"compiler/test-run-tail-calls.cc",
"compiler/test-run-unwinding-info.cc",
"compiler/test-run-variables.cc",
"compiler/test-run-wasm-machops.cc",
......
......@@ -73,7 +73,6 @@
'compiler/test-run-native-calls.cc',
'compiler/test-run-stackcheck.cc',
'compiler/test-run-stubs.cc',
'compiler/test-run-tail-calls.cc',
'compiler/test-run-variables.cc',
'compiler/test-run-wasm-machops.cc',
'compiler/value-helper.cc',
......
......@@ -36,11 +36,10 @@ class CodeAssemblerTester {
scope_(isolate),
state_(isolate, &zone_, 0, kind, "test") {}
CodeAssemblerTester(Isolate* isolate, CallDescriptor* call_descriptor,
const char* name = "test")
CodeAssemblerTester(Isolate* isolate, CallDescriptor* call_descriptor)
: zone_(isolate->allocator(), ZONE_NAME),
scope_(isolate),
state_(isolate, &zone_, call_descriptor, Code::STUB, name, 0, -1) {}
state_(isolate, &zone_, call_descriptor, Code::STUB, "test", 0, -1) {}
CodeAssemblerState* state() { return &state_; }
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/assembler-inl.h"
#include "src/base/utils/random-number-generator.h"
#include "src/code-stub-assembler.h"
#include "test/cctest/cctest.h"
#include "test/cctest/compiler/code-assembler-tester.h"
#include "test/cctest/compiler/function-tester.h"
namespace v8 {
namespace internal {
namespace compiler {
#define __ assembler.
namespace {
// Function that takes a number of pointer-sized integer arguments, calculates a
// weighted sum of them and returns it.
Handle<Code> BuildCallee(Isolate* isolate, CallDescriptor* descriptor) {
CodeAssemblerTester tester(isolate, descriptor, "callee");
CodeStubAssembler assembler(tester.state());
int param_count = static_cast<int>(descriptor->StackParameterCount());
Node* sum = __ IntPtrConstant(0);
for (int i = 0; i < param_count; ++i) {
Node* product = __ IntPtrMul(__ Parameter(i), __ IntPtrConstant(i + 1));
sum = __ IntPtrAdd(sum, product);
}
__ Return(sum);
return tester.GenerateCodeCloseAndEscape();
}
// Function that tail-calls another function with a number of pointer-sized
// integer arguments.
Handle<Code> BuildCaller(Isolate* isolate, CallDescriptor* descriptor,
CallDescriptor* callee_descriptor) {
CodeAssemblerTester tester(isolate, descriptor, "caller");
CodeStubAssembler assembler(tester.state());
std::vector<Node*> params;
// The first parameter is always the callee.
params.push_back(__ HeapConstant(BuildCallee(isolate, callee_descriptor)));
int param_count = static_cast<int>(callee_descriptor->StackParameterCount());
for (int i = 0; i < param_count; ++i) {
params.push_back(__ IntPtrConstant(i));
}
DCHECK_EQ(param_count + 1, params.size());
tester.raw_assembler_for_testing()->TailCallN(callee_descriptor,
param_count + 1, params.data());
return tester.GenerateCodeCloseAndEscape();
}
// Setup function, which calls "caller".
Handle<Code> BuildSetupFunction(Isolate* isolate,
CallDescriptor* caller_descriptor,
CallDescriptor* callee_descriptor) {
CodeAssemblerTester tester(isolate, 0);
CodeStubAssembler assembler(tester.state());
std::vector<Node*> params;
// The first parameter is always the callee.
params.push_back(__ HeapConstant(
BuildCaller(isolate, caller_descriptor, callee_descriptor)));
// Set up arguments for "Caller".
int param_count = static_cast<int>(caller_descriptor->StackParameterCount());
for (int i = 0; i < param_count; ++i) {
// Use values that are different from the ones we will pass to this
// function's callee later.
params.push_back(__ IntPtrConstant(i + 42));
}
DCHECK_EQ(param_count + 1, params.size());
Node* raw_result = tester.raw_assembler_for_testing()->CallN(
caller_descriptor, param_count + 1, params.data());
__ Return(__ SmiTag(raw_result));
return tester.GenerateCodeCloseAndEscape();
}
CallDescriptor* CreateDescriptorForStackArguments(Zone* zone,
int stack_param_count) {
LocationSignature::Builder locations(zone, 1,
static_cast<size_t>(stack_param_count));
locations.AddReturn(LinkageLocation::ForRegister(kReturnRegister0.code(),
MachineType::IntPtr()));
for (int i = 0; i < stack_param_count; ++i) {
locations.AddParam(LinkageLocation::ForCallerFrameSlot(
i - stack_param_count, MachineType::IntPtr()));
}
return new (zone)
CallDescriptor(CallDescriptor::kCallCodeObject, // kind
MachineType::AnyTagged(), // target MachineType
LinkageLocation::ForAnyRegister(
MachineType::AnyTagged()), // target location
locations.Build(), // location_sig
stack_param_count, // stack_parameter_count
Operator::kNoProperties, // properties
kNoCalleeSaved, // callee-saved registers
kNoCalleeSaved, // callee-saved fp
CallDescriptor::kNoFlags); // flags
}
// Test a tail call from a caller with n parameters to a callee with m
// parameters. All parameters are pointer-sized.
void TestHelper(int n, int m) {
HandleAndZoneScope scope;
Isolate* isolate = scope.main_isolate();
Zone* zone = scope.main_zone();
CallDescriptor* caller_descriptor =
CreateDescriptorForStackArguments(zone, n);
CallDescriptor* callee_descriptor =
CreateDescriptorForStackArguments(zone, m);
Handle<Code> setup =
BuildSetupFunction(isolate, caller_descriptor, callee_descriptor);
FunctionTester ft(setup, 0);
Handle<Object> result = ft.Call().ToHandleChecked();
int expected = 0;
for (int i = 0; i < m; ++i) expected += (i + 1) * i;
CHECK_EQ(expected, Handle<Smi>::cast(result)->value());
}
} // namespace
#undef __
TEST(CallerOddCalleeEven) {
TestHelper(1, 0);
TestHelper(1, 2);
TestHelper(3, 2);
TestHelper(3, 4);
}
TEST(CallerOddCalleeOdd) {
TestHelper(1, 1);
TestHelper(1, 3);
TestHelper(3, 1);
TestHelper(3, 3);
}
TEST(CallerEvenCalleeEven) {
TestHelper(0, 0);
TestHelper(0, 2);
TestHelper(2, 0);
TestHelper(2, 2);
}
TEST(CallerEvenCalleeOdd) {
TestHelper(0, 1);
TestHelper(0, 3);
TestHelper(2, 1);
TestHelper(2, 3);
}
TEST(FuzzStackParamCount) {
const int kNumTests = 1000;
const int kMaxSlots = 30;
base::RandomNumberGenerator* const rng = CcTest::random_number_generator();
for (int i = 0; i < kNumTests; ++i) {
int n = rng->NextInt(kMaxSlots);
int m = rng->NextInt(kMaxSlots);
TestHelper(n, m);
}
}
} // namespace compiler
} // namespace internal
} // namespace v8
......@@ -157,9 +157,7 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCallee) {
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
// We might need to add one slot of padding to the callee arguments.
int expected = kPadArguments ? 2 : 1;
EXPECT_EQ(expected, stack_param_delta);
EXPECT_EQ(1, stack_param_delta);
}
......@@ -180,9 +178,7 @@ TEST_F(LinkageTailCall, MoreRegisterAndStackParametersCaller) {
Node* const node = Node::New(zone(), 1, op, 0, nullptr, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
// We might need to drop one slot of padding from the caller's arguments.
int expected = kPadArguments ? -2 : -1;
EXPECT_EQ(expected, stack_param_delta);
EXPECT_EQ(-1, stack_param_delta);
}
......@@ -317,9 +313,7 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCallerRegistersAndStack) {
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
// We might need to add one slot of padding to the callee arguments.
int expected = kPadArguments ? 0 : -1;
EXPECT_EQ(expected, stack_param_delta);
EXPECT_EQ(-1, stack_param_delta);
}
......@@ -347,9 +341,7 @@ TEST_F(LinkageTailCall, MatchingStackParametersExtraCalleeRegistersAndStack) {
Node::New(zone(), 1, op, arraysize(parameters), parameters, false);
EXPECT_TRUE(desc1->CanTailCall(node));
int stack_param_delta = desc2->GetStackParameterDelta(desc1);
// We might need to drop one slot of padding from the caller's arguments.
int expected = kPadArguments ? 0 : 1;
EXPECT_EQ(expected, stack_param_delta);
EXPECT_EQ(1, stack_param_delta);
}
} // namespace compiler
......
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