Commit 588d8d3d authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan] Remove obsolete {SupportsTailCalls} flag.

R=jarin@chromium.org

Change-Id: I2b2d5095e7c5c06c509a0e1b1b1121e78a80735a
Reviewed-on: https://chromium-review.googlesource.com/796031Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49708}
parent 76c39af1
...@@ -1006,7 +1006,7 @@ TNode<Object> CodeAssembler::TailCallRuntimeImpl(Runtime::FunctionId function, ...@@ -1006,7 +1006,7 @@ TNode<Object> CodeAssembler::TailCallRuntimeImpl(Runtime::FunctionId function,
int argc = static_cast<int>(sizeof...(args)); int argc = static_cast<int>(sizeof...(args));
CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
zone(), function, argc, Operator::kNoProperties, zone(), function, argc, Operator::kNoProperties,
CallDescriptor::kSupportsTailCalls); CallDescriptor::kNoFlags);
int return_count = static_cast<int>(desc->ReturnCount()); int return_count = static_cast<int>(desc->ReturnCount());
Node* centry = Node* centry =
...@@ -1076,7 +1076,7 @@ Node* CodeAssembler::TailCallStubImpl(const CallInterfaceDescriptor& descriptor, ...@@ -1076,7 +1076,7 @@ Node* CodeAssembler::TailCallStubImpl(const CallInterfaceDescriptor& descriptor,
size_t result_size = 1; size_t result_size = 1;
CallDescriptor* desc = Linkage::GetStubCallDescriptor( CallDescriptor* desc = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, descriptor.GetStackParameterCount(), isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
CallDescriptor::kSupportsTailCalls, Operator::kNoProperties, CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), result_size); MachineType::AnyTagged(), result_size);
Node* nodes[] = {target, args..., context}; Node* nodes[] = {target, args..., context};
...@@ -1102,7 +1102,7 @@ Node* CodeAssembler::TailCallStubThenBytecodeDispatch( ...@@ -1102,7 +1102,7 @@ Node* CodeAssembler::TailCallStubThenBytecodeDispatch(
DCHECK_LE(descriptor.GetStackParameterCount(), stack_parameter_count); DCHECK_LE(descriptor.GetStackParameterCount(), stack_parameter_count);
CallDescriptor* desc = Linkage::GetStubCallDescriptor( CallDescriptor* desc = Linkage::GetStubCallDescriptor(
isolate(), zone(), descriptor, stack_parameter_count, isolate(), zone(), descriptor, stack_parameter_count,
CallDescriptor::kSupportsTailCalls, Operator::kNoProperties, CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), 0); MachineType::AnyTagged(), 0);
Node* nodes[] = {target, args..., context}; Node* nodes[] = {target, args..., context};
......
...@@ -690,6 +690,7 @@ struct CallBuffer { ...@@ -690,6 +690,7 @@ struct CallBuffer {
// InstructionSelector::VisitCall platform independent instead. // InstructionSelector::VisitCall platform independent instead.
void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer, void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
CallBufferFlags flags, CallBufferFlags flags,
bool is_tail_call,
int stack_param_delta) { int stack_param_delta) {
OperandGenerator g(this); OperandGenerator g(this);
DCHECK_LE(call->op()->ValueOutputCount(), DCHECK_LE(call->op()->ValueOutputCount(),
...@@ -787,7 +788,7 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer, ...@@ -787,7 +788,7 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
// If it was a syntactic tail call we need to drop the current frame and // If it was a syntactic tail call we need to drop the current frame and
// all the frames on top of it that are either an arguments adaptor frame // all the frames on top of it that are either an arguments adaptor frame
// or a tail caller frame. // or a tail caller frame.
if (buffer->descriptor->SupportsTailCalls()) { if (is_tail_call) {
frame_state = NodeProperties::GetFrameStateInput(frame_state); frame_state = NodeProperties::GetFrameStateInput(frame_state);
buffer->frame_state_descriptor = buffer->frame_state_descriptor =
buffer->frame_state_descriptor->outer_state(); buffer->frame_state_descriptor->outer_state();
...@@ -2565,7 +2566,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { ...@@ -2565,7 +2566,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) {
// Improve constant pool and the heuristics in the register allocator // Improve constant pool and the heuristics in the register allocator
// for where to emit constants. // for where to emit constants.
CallBufferFlags call_buffer_flags(kCallCodeImmediate | kCallAddressImmediate); CallBufferFlags call_buffer_flags(kCallCodeImmediate | kCallAddressImmediate);
InitializeCallBuffer(node, &buffer, call_buffer_flags); InitializeCallBuffer(node, &buffer, call_buffer_flags, false);
EmitPrepareArguments(&(buffer.pushed_nodes), descriptor, node); EmitPrepareArguments(&(buffer.pushed_nodes), descriptor, node);
...@@ -2630,7 +2631,6 @@ void InstructionSelector::VisitCallWithCallerSavedRegisters( ...@@ -2630,7 +2631,6 @@ void InstructionSelector::VisitCallWithCallerSavedRegisters(
void InstructionSelector::VisitTailCall(Node* node) { void InstructionSelector::VisitTailCall(Node* node) {
OperandGenerator g(this); OperandGenerator g(this);
CallDescriptor const* descriptor = CallDescriptorOf(node->op()); CallDescriptor const* descriptor = CallDescriptorOf(node->op());
DCHECK_NE(0, descriptor->flags() & CallDescriptor::kSupportsTailCalls);
CallDescriptor* caller = linkage()->GetIncomingDescriptor(); CallDescriptor* caller = linkage()->GetIncomingDescriptor();
DCHECK(caller->CanTailCall(node)); DCHECK(caller->CanTailCall(node));
...@@ -2643,7 +2643,7 @@ void InstructionSelector::VisitTailCall(Node* node) { ...@@ -2643,7 +2643,7 @@ void InstructionSelector::VisitTailCall(Node* node) {
if (IsTailCallAddressImmediate()) { if (IsTailCallAddressImmediate()) {
flags |= kCallAddressImmediate; flags |= kCallAddressImmediate;
} }
InitializeCallBuffer(node, &buffer, flags, stack_param_delta); InitializeCallBuffer(node, &buffer, flags, true, stack_param_delta);
// Select the appropriate opcode based on the call type. // Select the appropriate opcode based on the call type.
InstructionCode opcode; InstructionCode opcode;
......
...@@ -285,7 +285,8 @@ class V8_EXPORT_PRIVATE InstructionSelector final { ...@@ -285,7 +285,8 @@ class V8_EXPORT_PRIVATE InstructionSelector final {
// {call_code_immediate} to generate immediate operands to calls of code. // {call_code_immediate} to generate immediate operands to calls of code.
// {call_address_immediate} to generate immediate operands to address calls. // {call_address_immediate} to generate immediate operands to address calls.
void InitializeCallBuffer(Node* call, CallBuffer* buffer, void InitializeCallBuffer(Node* call, CallBuffer* buffer,
CallBufferFlags flags, int stack_slot_delta = 0); CallBufferFlags flags, bool is_tail_call,
int stack_slot_delta = 0);
bool IsTailCallAddressImmediate(); bool IsTailCallAddressImmediate();
int GetTempsCountForTailCallFromJSFunction(); int GetTempsCountForTailCallFromJSFunction();
......
...@@ -1455,7 +1455,6 @@ void ReduceBuiltin(Isolate* isolate, JSGraph* jsgraph, Node* node, ...@@ -1455,7 +1455,6 @@ void ReduceBuiltin(Isolate* isolate, JSGraph* jsgraph, Node* node,
const bool is_construct = (node->opcode() == IrOpcode::kJSConstruct); const bool is_construct = (node->opcode() == IrOpcode::kJSConstruct);
DCHECK(Builtins::HasCppImplementation(builtin_index)); DCHECK(Builtins::HasCppImplementation(builtin_index));
DCHECK_EQ(0, flags & CallDescriptor::kSupportsTailCalls);
Node* target = NodeProperties::GetValueInput(node, 0); Node* target = NodeProperties::GetValueInput(node, 0);
Node* new_target = is_construct Node* new_target = is_construct
......
...@@ -49,7 +49,7 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { ...@@ -49,7 +49,7 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) {
// TODO(svenpanne) Output properties etc. and be less cryptic. // TODO(svenpanne) Output properties etc. and be less cryptic.
return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount() return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount()
<< "s" << d.StackParameterCount() << "i" << d.InputCount() << "f" << "s" << d.StackParameterCount() << "i" << d.InputCount() << "f"
<< d.FrameStateCount() << "t" << d.SupportsTailCalls(); << d.FrameStateCount();
} }
MachineSignature* CallDescriptor::GetMachineSignature(Zone* zone) const { MachineSignature* CallDescriptor::GetMachineSignature(Zone* zone) const {
...@@ -462,8 +462,7 @@ CallDescriptor* Linkage::GetBytecodeDispatchCallDescriptor( ...@@ -462,8 +462,7 @@ CallDescriptor* Linkage::GetBytecodeDispatchCallDescriptor(
Operator::kNoProperties, // properties Operator::kNoProperties, // properties
kNoCalleeSaved, // callee-saved registers kNoCalleeSaved, // callee-saved registers
kNoCalleeSaved, // callee-saved fp kNoCalleeSaved, // callee-saved fp
CallDescriptor::kCanUseRoots | // flags CallDescriptor::kCanUseRoots, // flags
CallDescriptor::kSupportsTailCalls, // flags
descriptor.DebugName(isolate)); descriptor.DebugName(isolate));
} }
......
...@@ -176,19 +176,18 @@ class V8_EXPORT_PRIVATE CallDescriptor final ...@@ -176,19 +176,18 @@ class V8_EXPORT_PRIVATE CallDescriptor final
kNoFlags = 0u, kNoFlags = 0u,
kNeedsFrameState = 1u << 0, kNeedsFrameState = 1u << 0,
kHasExceptionHandler = 1u << 1, kHasExceptionHandler = 1u << 1,
kSupportsTailCalls = 1u << 2, kCanUseRoots = 1u << 2,
kCanUseRoots = 1u << 3,
// (arm64 only) native stack should be used for arguments. // (arm64 only) native stack should be used for arguments.
kUseNativeStack = 1u << 4, kUseNativeStack = 1u << 3,
// (arm64 only) call instruction has to restore JSSP or CSP. // (arm64 only) call instruction has to restore JSSP or CSP.
kRestoreJSSP = 1u << 5, kRestoreJSSP = 1u << 4,
kRestoreCSP = 1u << 6, kRestoreCSP = 1u << 5,
// Causes the code generator to initialize the root register. // Causes the code generator to initialize the root register.
kInitializeRootRegister = 1u << 7, kInitializeRootRegister = 1u << 6,
// Does not ever try to allocate space on our heap. // Does not ever try to allocate space on our heap.
kNoAllocate = 1u << 8, kNoAllocate = 1u << 7,
// Push argument count as part of function prologue. // Push argument count as part of function prologue.
kPushArgumentCount = 1u << 9 kPushArgumentCount = 1u << 8
}; };
typedef base::Flags<Flag> Flags; typedef base::Flags<Flag> Flags;
...@@ -249,7 +248,6 @@ class V8_EXPORT_PRIVATE CallDescriptor final ...@@ -249,7 +248,6 @@ class V8_EXPORT_PRIVATE CallDescriptor final
Flags flags() const { return flags_; } Flags flags() const { return flags_; }
bool NeedsFrameState() const { return flags() & kNeedsFrameState; } bool NeedsFrameState() const { return flags() & kNeedsFrameState; }
bool SupportsTailCalls() const { return flags() & kSupportsTailCalls; }
bool UseNativeStack() const { return flags() & kUseNativeStack; } bool UseNativeStack() const { return flags() & kUseNativeStack; }
bool PushArgumentCount() const { return flags() & kPushArgumentCount; } bool PushArgumentCount() const { return flags() & kPushArgumentCount; }
bool InitializeRootRegister() const { bool InitializeRootRegister() const {
......
...@@ -3076,7 +3076,7 @@ void WasmGraphBuilder::BuildWasmToWasmWrapper(WasmCodeWrapper wasm_code, ...@@ -3076,7 +3076,7 @@ void WasmGraphBuilder::BuildWasmToWasmWrapper(WasmCodeWrapper wasm_code,
args[pos++] = *control_; args[pos++] = *control_;
// Tail-call the wasm code. // Tail-call the wasm code.
CallDescriptor* desc = GetWasmCallDescriptor(jsgraph()->zone(), sig_, true); CallDescriptor* desc = GetWasmCallDescriptor(jsgraph()->zone(), sig_);
Node* tail_call = Node* tail_call =
graph()->NewNode(jsgraph()->common()->TailCall(desc), count, args); graph()->NewNode(jsgraph()->common()->TailCall(desc), count, args);
MergeControlToEnd(jsgraph(), tail_call); MergeControlToEnd(jsgraph(), tail_call);
......
...@@ -572,7 +572,7 @@ class WasmGraphBuilder { ...@@ -572,7 +572,7 @@ class WasmGraphBuilder {
constexpr int kWasmContextParameterIndex = 0; constexpr int kWasmContextParameterIndex = 0;
V8_EXPORT_PRIVATE CallDescriptor* GetWasmCallDescriptor( V8_EXPORT_PRIVATE CallDescriptor* GetWasmCallDescriptor(
Zone* zone, wasm::FunctionSig* sig, bool supports_tails_calls = false); Zone* zone, wasm::FunctionSig* signature);
V8_EXPORT_PRIVATE CallDescriptor* GetI32WasmCallDescriptor( V8_EXPORT_PRIVATE CallDescriptor* GetI32WasmCallDescriptor(
Zone* zone, CallDescriptor* descriptor); Zone* zone, CallDescriptor* descriptor);
V8_EXPORT_PRIVATE CallDescriptor* GetI32WasmCallDescriptorForSimd( V8_EXPORT_PRIVATE CallDescriptor* GetI32WasmCallDescriptorForSimd(
......
...@@ -221,8 +221,7 @@ static constexpr Allocator parameter_registers(kGPParamRegisters, ...@@ -221,8 +221,7 @@ static constexpr Allocator parameter_registers(kGPParamRegisters,
} // namespace } // namespace
// General code uses the above configuration data. // General code uses the above configuration data.
CallDescriptor* GetWasmCallDescriptor(Zone* zone, wasm::FunctionSig* fsig, CallDescriptor* GetWasmCallDescriptor(Zone* zone, wasm::FunctionSig* fsig) {
bool supports_tail_calls) {
// The '+ 1' here is to accomodate the wasm_context as first parameter. // The '+ 1' here is to accomodate the wasm_context as first parameter.
LocationSignature::Builder locations(zone, fsig->return_count(), LocationSignature::Builder locations(zone, fsig->return_count(),
fsig->parameter_count() + 1); fsig->parameter_count() + 1);
...@@ -257,7 +256,6 @@ CallDescriptor* GetWasmCallDescriptor(Zone* zone, wasm::FunctionSig* fsig, ...@@ -257,7 +256,6 @@ CallDescriptor* GetWasmCallDescriptor(Zone* zone, wasm::FunctionSig* fsig,
LinkageLocation target_loc = LinkageLocation::ForAnyRegister(target_type); LinkageLocation target_loc = LinkageLocation::ForAnyRegister(target_type);
CallDescriptor::Flags flags = CallDescriptor::kUseNativeStack; CallDescriptor::Flags flags = CallDescriptor::kUseNativeStack;
if (supports_tail_calls) flags |= CallDescriptor::kSupportsTailCalls;
CallDescriptor::Kind kind = FLAG_wasm_jit_to_native CallDescriptor::Kind kind = FLAG_wasm_jit_to_native
? CallDescriptor::kCallWasmFunction ? CallDescriptor::kCallWasmFunction
: CallDescriptor::kCallCodeObject; : CallDescriptor::kCallCodeObject;
......
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