Commit 1dec99f5 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[ia32,root] Remove ebx from ALLOCATABLE_GENERAL_REGISTERS

This CL restores consistency with other platforms. ebx is now the
kRootRegister on ia32, and thus not an allocatable register any more.

The PreserveRootIA32 register configuration can be removed since it is
now identical to the Default configuration.

Bug: v8:6666
Change-Id: If4e2b4c52aa8b5db40bcd3b4469004b29c0e3d99
Reviewed-on: https://chromium-review.googlesource.com/c/1299078
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57018}
parent 38a13ea2
......@@ -1334,8 +1334,7 @@ namespace {
void Generate_ContinueToBuiltinHelper(MacroAssembler* masm,
bool java_script_builtin,
bool with_result) {
const RegisterConfiguration* config(
RegisterConfiguration::PreserveRootIA32());
const RegisterConfiguration* config(RegisterConfiguration::Default());
int allocatable_register_count = config->num_allocatable_general_registers();
if (with_result) {
// Overwrite the hole inserted by the deoptimizer with the return value from
......
......@@ -2448,24 +2448,18 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) {
std::unique_ptr<const RegisterConfiguration> config;
config.reset(RegisterConfiguration::RestrictGeneralRegisters(registers));
AllocateRegisters(config.get(), call_descriptor, run_verifier);
#ifdef V8_TARGET_ARCH_IA32
} else {
// TODO(v8:6666): Ensure that that this configuration cooperates with
// restricted allocatable registers above, i.e. that we guarantee a
// restricted configuration cannot allocate kRootRegister on ia32.
AllocateRegisters(RegisterConfiguration::PreserveRootIA32(),
call_descriptor, run_verifier);
}
#else
} else if (data->info()->GetPoisoningMitigationLevel() !=
PoisoningMitigationLevel::kDontPoison) {
#ifdef V8_TARGET_ARCH_IA32
FATAL("Poisoning is not supported on ia32.");
#else
AllocateRegisters(RegisterConfiguration::Poisoning(), call_descriptor,
run_verifier);
#endif // V8_TARGET_ARCH_IA32
} else {
AllocateRegisters(RegisterConfiguration::Default(), call_descriptor,
run_verifier);
}
#endif // V8_TARGET_ARCH_IA32
// Verify the instruction sequence has the same hash in two stages.
VerifyGeneratedCodeIsIdempotent();
......
......@@ -1477,13 +1477,7 @@ void Deoptimizer::DoComputeBuiltinContinuation(
const bool must_handle_result =
!is_topmost || deopt_kind_ == DeoptimizeKind::kLazy;
#ifdef V8_TARGET_ARCH_IA32
// TODO(v8:6666): Fold into Default config once root is fully supported.
const RegisterConfiguration* config(
RegisterConfiguration::PreserveRootIA32());
#else
const RegisterConfiguration* config(RegisterConfiguration::Default());
#endif
const int allocatable_register_count =
config->num_allocatable_general_registers();
const int padding_slot_count =
......
......@@ -63,7 +63,6 @@ namespace internal {
V(eax) \
V(ecx) \
V(edx) \
V(ebx) \
V(esi) \
V(edi)
......
......@@ -166,55 +166,6 @@ static base::LazyInstance<ArchDefaultPoisoningRegisterConfiguration,
PoisoningRegisterConfigurationInitializer>::type
kDefaultPoisoningRegisterConfiguration = LAZY_INSTANCE_INITIALIZER;
#ifdef V8_TARGET_ARCH_IA32
// Allocatable registers with the root register removed.
// TODO(v8:6666): Once all builtins have been migrated, we could remove this
// configuration and remove kRootRegister from ALLOCATABLE_GENERAL_REGISTERS
// instead.
class ArchPreserveRootIA32RegisterConfiguration : public RegisterConfiguration {
public:
ArchPreserveRootIA32RegisterConfiguration()
: RegisterConfiguration(
Register::kNumRegisters, DoubleRegister::kNumRegisters,
kMaxAllocatableGeneralRegisterCount - 1,
get_num_allocatable_double_registers(),
InitializeGeneralRegisterCodes(), get_allocatable_double_codes(),
kSimpleFPAliasing ? AliasingKind::OVERLAP : AliasingKind::COMBINE,
kGeneralRegisterNames, kFloatRegisterNames, kDoubleRegisterNames,
kSimd128RegisterNames) {}
private:
static const int* InitializeGeneralRegisterCodes() {
int filtered_index = 0;
for (int i = 0; i < kMaxAllocatableGeneralRegisterCount; ++i) {
if (kAllocatableGeneralCodes[i] != kRootRegister.code()) {
allocatable_general_codes_[filtered_index] =
kAllocatableGeneralCodes[i];
filtered_index++;
}
}
DCHECK_EQ(filtered_index, kMaxAllocatableGeneralRegisterCount - 1);
return allocatable_general_codes_;
}
static int
allocatable_general_codes_[kMaxAllocatableGeneralRegisterCount - 1];
};
int ArchPreserveRootIA32RegisterConfiguration::allocatable_general_codes_
[kMaxAllocatableGeneralRegisterCount - 1];
struct PreserveRootIA32RegisterConfigurationInitializer {
static void Construct(void* config) {
new (config) ArchPreserveRootIA32RegisterConfiguration();
}
};
static base::LazyInstance<ArchPreserveRootIA32RegisterConfiguration,
PreserveRootIA32RegisterConfigurationInitializer>::
type kPreserveRootIA32RegisterConfiguration = LAZY_INSTANCE_INITIALIZER;
#endif // V8_TARGET_ARCH_IA32
// RestrictedRegisterConfiguration uses the subset of allocatable general
// registers the architecture support, which results into generating assembly
// to use less registers. Currently, it's only used by RecordWrite code stub.
......@@ -267,12 +218,6 @@ const RegisterConfiguration* RegisterConfiguration::Poisoning() {
return &kDefaultPoisoningRegisterConfiguration.Get();
}
#ifdef V8_TARGET_ARCH_IA32
const RegisterConfiguration* RegisterConfiguration::PreserveRootIA32() {
return &kPreserveRootIA32RegisterConfiguration.Get();
}
#endif // V8_TARGET_ARCH_IA32
const RegisterConfiguration* RegisterConfiguration::RestrictGeneralRegisters(
RegList registers) {
int num = NumRegs(registers);
......
......@@ -34,9 +34,6 @@ class V8_EXPORT_PRIVATE RegisterConfiguration {
// Register configuration with reserved masking register.
static const RegisterConfiguration* Poisoning();
// Register configuration with reserved root register on ia32.
static const RegisterConfiguration* PreserveRootIA32();
static const RegisterConfiguration* RestrictGeneralRegisters(
RegList registers);
......
......@@ -51,12 +51,7 @@ class RandomNumberGenerator;
namespace internal {
#ifdef V8_TARGET_ARCH_IA32
// TODO(v8:6666): Fold into Default config once root is fully supported.
const auto GetRegConfig = RegisterConfiguration::PreserveRootIA32;
#else
const auto GetRegConfig = RegisterConfiguration::Default;
#endif
class HandleScope;
class Zone;
......
......@@ -314,9 +314,9 @@ class ParallelMoveCreator : public HandleAndZoneScope {
UNREACHABLE();
}
// min(num_alloctable_general_registers for each arch) == 6 from
// min(num_alloctable_general_registers for each arch) == 5 from
// assembler-ia32.h
const int kMaxIndex = 6;
const int kMaxIndex = 5;
const int kMaxIndices = kMaxIndex + 1;
// Non-FP slots shouldn't overlap FP slots.
......
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