diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-10-07 12:24:52 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-10-07 12:24:52 +0100 |
commit | 7adfcc8cfdf5fe3a8a0aefa08bfc3249fca55c8b (patch) | |
tree | 51f231854e404edcd2019afa393697a6a08ee9cf /compiler/optimizing | |
parent | 9800e55b059d4a0fdc0ceebd5652a53f7a8d837a (diff) | |
download | art-7adfcc8cfdf5fe3a8a0aefa08bfc3249fca55c8b.zip art-7adfcc8cfdf5fe3a8a0aefa08bfc3249fca55c8b.tar.gz art-7adfcc8cfdf5fe3a8a0aefa08bfc3249fca55c8b.tar.bz2 |
Do not use kDiesAtEntry when inputs must be in specific reg.
The way the register allocator blocks registers currently
does not handle these cases. Since it only applies to x86 for now,
just ensure such requests cannot happen.
Change-Id: Idfa25532b9b4996a192d05800f56c6e44edd3a8a
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 6791003..899db77 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -1160,8 +1160,12 @@ void LocationsBuilderX86::VisitInstanceFieldSet(HInstanceFieldSet* instruction) locations->SetInAt(0, Location::RequiresRegister()); Primitive::Type field_type = instruction->GetFieldType(); bool is_object_type = field_type == Primitive::kPrimNot; - bool dies_at_entry = !is_object_type; - if (field_type == Primitive::kPrimBoolean || field_type == Primitive::kPrimByte) { + bool is_byte_type = (field_type == Primitive::kPrimBoolean) + || (field_type == Primitive::kPrimByte); + // The register allocator does not support multiple + // inputs that die at entry with one in a specific register. + bool dies_at_entry = !is_object_type && !is_byte_type; + if (is_byte_type) { // Ensure the value is in a byte register. locations->SetInAt(1, X86CpuLocation(EAX), dies_at_entry); } else { @@ -1436,12 +1440,16 @@ void LocationsBuilderX86::VisitArraySet(HArraySet* instruction) { locations->SetInAt(1, X86CpuLocation(calling_convention.GetRegisterAt(1))); locations->SetInAt(2, X86CpuLocation(calling_convention.GetRegisterAt(2))); } else { + bool is_byte_type = (value_type == Primitive::kPrimBoolean) + || (value_type == Primitive::kPrimByte); // We need the inputs to be different than the output in case of long operation. - bool dies_at_entry = value_type != Primitive::kPrimLong; + // In case of a byte operation, the register allocator does not support multiple + // inputs that die at entry with one in a specific register. + bool dies_at_entry = value_type != Primitive::kPrimLong && !is_byte_type; locations->SetInAt(0, Location::RequiresRegister(), dies_at_entry); locations->SetInAt( 1, Location::RegisterOrConstant(instruction->InputAt(1)), dies_at_entry); - if (value_type == Primitive::kPrimBoolean || value_type == Primitive::kPrimByte) { + if (is_byte_type) { // Ensure the value is in a byte register. locations->SetInAt(2, X86CpuLocation(EAX), dies_at_entry); } else { |