Commit 722c4c83 authored by Sven Sauleau's avatar Sven Sauleau Committed by Commit Bot

Simplify TFC builtins definitions

Removes the result_size parameter in TFC definitions which
can be infered from the provided CallInterfaceDescriptor.

Previously, the result size was added to support stubs with
custom linkage. However, In pratice, the size don't differ from
the provided CallInterfaceDescriptor (given that it's a DCHECK)
and use mostly JS linkage (only one return).

Change-Id: I8efdb3e3ce1a470735dac84ec6be506e071d2756
Bug: v8:6116
Reviewed-on: https://chromium-review.googlesource.com/c/1495554
Commit-Queue: Sven Sauleau <ssauleau@igalia.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60004}
parent 980e0d32
This diff is collapsed.
......@@ -30,8 +30,7 @@ namespace internal {
};
// Define interface descriptors for builtins with StubCall linkage.
#define DEFINE_TFC_INTERFACE_DESCRIPTOR(Name, InterfaceDescriptor, \
result_size) \
#define DEFINE_TFC_INTERFACE_DESCRIPTOR(Name, InterfaceDescriptor) \
typedef InterfaceDescriptor##Descriptor Builtin_##Name##_InterfaceDescriptor;
#define DEFINE_TFS_INTERFACE_DESCRIPTOR(Name, ...) \
......
......@@ -182,7 +182,7 @@ Code BuildWithCodeStubAssemblerJS(Isolate* isolate, int32_t builtin_index,
Code BuildWithCodeStubAssemblerCS(Isolate* isolate, int32_t builtin_index,
CodeAssemblerGenerator generator,
CallDescriptors::Key interface_descriptor,
const char* name, int result_size) {
const char* name) {
HandleScope scope(isolate);
// Canonicalize handles, so that we can share constant pool entries pointing
// to code targets without dereferencing their handles.
......@@ -195,7 +195,6 @@ Code BuildWithCodeStubAssemblerCS(Isolate* isolate, int32_t builtin_index,
// and this construction just queries the details from the descriptors table.
CallInterfaceDescriptor descriptor(interface_descriptor);
// Ensure descriptor is already initialized.
DCHECK_EQ(result_size, descriptor.GetReturnCount());
DCHECK_LE(0, descriptor.GetRegisterParameterCount());
compiler::CodeAssemblerState state(
isolate, &zone, descriptor, Code::BUILTIN, name,
......@@ -317,22 +316,23 @@ void SetupIsolateDelegate::SetupBuiltinsInternal(Isolate* isolate) {
code = BuildWithCodeStubAssemblerJS( \
isolate, index, &Builtins::Generate_##Name, Argc, #Name); \
AddBuiltin(builtins, index++, code);
#define BUILD_TFC(Name, InterfaceDescriptor, result_size) \
code = BuildWithCodeStubAssemblerCS( \
isolate, index, &Builtins::Generate_##Name, \
CallDescriptors::InterfaceDescriptor, #Name, result_size); \
#define BUILD_TFC(Name, InterfaceDescriptor) \
/* Return size is from the provided CallInterfaceDescriptor. */ \
code = BuildWithCodeStubAssemblerCS( \
isolate, index, &Builtins::Generate_##Name, \
CallDescriptors::InterfaceDescriptor, #Name); \
AddBuiltin(builtins, index++, code);
#define BUILD_TFS(Name, ...) \
/* Return size for generic TF builtins (stub linkage) is always 1. */ \
code = \
BuildWithCodeStubAssemblerCS(isolate, index, &Builtins::Generate_##Name, \
CallDescriptors::Name, #Name, 1); \
CallDescriptors::Name, #Name); \
AddBuiltin(builtins, index++, code);
#define BUILD_TFH(Name, InterfaceDescriptor) \
/* Return size for IC builtins/handlers is always 1. */ \
code = BuildWithCodeStubAssemblerCS( \
isolate, index, &Builtins::Generate_##Name, \
CallDescriptors::InterfaceDescriptor, #Name, 1); \
#define BUILD_TFH(Name, InterfaceDescriptor) \
/* Return size for IC builtins/handlers is always 1. */ \
code = BuildWithCodeStubAssemblerCS( \
isolate, index, &Builtins::Generate_##Name, \
CallDescriptors::InterfaceDescriptor, #Name); \
AddBuiltin(builtins, index++, code);
#define BUILD_BCH(Name, OperandScale, Bytecode) \
......
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