Commit cf8f2308 authored by jgruber's avatar jgruber Committed by Commit Bot

[ia32] Remove kRootRegister from default interface descriptors

This is another step towards a kRootRegister on ia32 and removes
kRootRegister from generic interface descriptors.

Drive-by: Better error message for type mismatches in machine graph
verification.
Drive-by: Use PreserveRootIA32 register config for all builtins.

Bug: v8:6666
Change-Id: I920d4d6f3085da9734f6aa3bd3ee020abbc289fc
Reviewed-on: https://chromium-review.googlesource.com/1186330Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55338}
parent b10a967f
......@@ -782,7 +782,8 @@ class MachineRepresentationChecker {
str << std::endl;
}
str << " * input " << i << " (" << input->id() << ":" << *input->op()
<< ") doesn't have a " << expected_input_type << " representation.";
<< ") has a " << input_type
<< " representation (expected: " << expected_input_type << ").";
}
}
if (should_log_error) {
......
......@@ -2407,8 +2407,8 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) {
AllocateRegisters(RegisterConfiguration::Poisoning(), call_descriptor,
run_verifier);
#if defined(V8_TARGET_ARCH_IA32) && defined(V8_EMBEDDED_BUILTINS)
} else if (data_->assembler_options().isolate_independent_code) {
// TODO(v8:6666): Extend support to all builtins and user code. Ensure that
} else if (Builtins::IsBuiltinId(data_->info()->builtin_index())) {
// TODO(v8:6666): Extend support to user code. Ensure that
// it is mutually exclusive with the Poisoning configuration above; and that
// it cooperates with restricted allocatable registers above.
static_assert(kRootRegister == kSpeculationPoisonRegister,
......
......@@ -13,7 +13,14 @@ const Register CallInterfaceDescriptor::ContextRegister() { return esi; }
void CallInterfaceDescriptor::DefaultInitializePlatformSpecific(
CallInterfaceDescriptorData* data, int register_parameter_count) {
const Register default_stub_registers[] = {eax, ebx, ecx, edx, edi};
#if defined(V8_TARGET_ARCH_IA32) && defined(V8_EMBEDDED_BUILTINS)
// TODO(jgruber,v8:6666): Keep kRootRegister free unconditionally.
constexpr Register default_stub_registers[] = {eax, ecx, edx, edi};
DCHECK(!AreAliased(eax, ecx, edx, edi, kRootRegister));
#else
constexpr Register default_stub_registers[] = {eax, ebx, ecx, edx, edi};
#endif
STATIC_ASSERT(arraysize(default_stub_registers) == kMaxBuiltinRegisterParams);
CHECK_LE(static_cast<size_t>(register_parameter_count),
arraysize(default_stub_registers));
data->InitializePlatformSpecific(register_parameter_count,
......
......@@ -289,7 +289,12 @@ class V8_EXPORT_PRIVATE CallInterfaceDescriptor {
explicit name() : base(key()) {} \
static inline CallDescriptors::Key key();
#if defined(V8_TARGET_ARCH_IA32) && defined(V8_EMBEDDED_BUILTINS)
// TODO(jgruber,v8:6666): Keep kRootRegister free unconditionally.
constexpr int kMaxBuiltinRegisterParams = 4;
#else
constexpr int kMaxBuiltinRegisterParams = 5;
#endif
#define DECLARE_DEFAULT_DESCRIPTOR(name, base) \
DECLARE_DESCRIPTOR_WITH_BASE(name, base) \
......
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