diff options
Diffstat (limited to 'deps/v8/src/compiler/linkage.cc')
-rw-r--r-- | deps/v8/src/compiler/linkage.cc | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/deps/v8/src/compiler/linkage.cc b/deps/v8/src/compiler/linkage.cc index 1d88a27a5f..39c93c0328 100644 --- a/deps/v8/src/compiler/linkage.cc +++ b/deps/v8/src/compiler/linkage.cc @@ -7,9 +7,7 @@ #include "src/codegen/assembler-inl.h" #include "src/codegen/macro-assembler.h" #include "src/codegen/optimized-compilation-info.h" -#include "src/compiler/common-operator.h" #include "src/compiler/frame.h" -#include "src/compiler/node.h" #include "src/compiler/osr.h" #include "src/compiler/pipeline.h" @@ -75,15 +73,6 @@ MachineSignature* CallDescriptor::GetMachineSignature(Zone* zone) const { return new (zone) MachineSignature(return_count, param_count, types); } -bool CallDescriptor::HasSameReturnLocationsAs( - const CallDescriptor* other) const { - if (ReturnCount() != other->ReturnCount()) return false; - for (size_t i = 0; i < ReturnCount(); ++i) { - if (GetReturnLocation(i) != other->GetReturnLocation(i)) return false; - } - return true; -} - int CallDescriptor::GetFirstUnusedStackSlot() const { int slots_above_sp = 0; for (size_t i = 0; i < InputCount(); ++i) { @@ -104,19 +93,16 @@ int CallDescriptor::GetStackParameterDelta( int callee_slots_above_sp = GetFirstUnusedStackSlot(); int tail_caller_slots_above_sp = tail_caller->GetFirstUnusedStackSlot(); 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; - } + if (ShouldPadArguments(stack_param_delta)) { + 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; @@ -133,8 +119,14 @@ int CallDescriptor::GetTaggedParameterSlots() const { return result; } -bool CallDescriptor::CanTailCall(const Node* node) const { - return HasSameReturnLocationsAs(CallDescriptorOf(node->op())); +bool CallDescriptor::CanTailCall(const CallDescriptor* callee) const { + if (ReturnCount() != callee->ReturnCount()) return false; + for (size_t i = 0; i < ReturnCount(); ++i) { + if (!LinkageLocation::IsSameLocation(GetReturnLocation(i), + callee->GetReturnLocation(i))) + return false; + } + return true; } // TODO(jkummerow, sigurds): Arguably frame size calculation should be |