diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-10-07 11:29:10 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-10-07 11:29:11 +0000 |
commit | 41abdb6ec97978df7c6d79abce4efb664c994ce8 (patch) | |
tree | ec341468d5881c62251a354f31c8081b57e08687 /compiler/optimizing | |
parent | e9da5d17fb6e8fde383c943c184905d63ed0c644 (diff) | |
parent | 7adfcc8cfdf5fe3a8a0aefa08bfc3249fca55c8b (diff) | |
download | art-41abdb6ec97978df7c6d79abce4efb664c994ce8.zip art-41abdb6ec97978df7c6d79abce4efb664c994ce8.tar.gz art-41abdb6ec97978df7c6d79abce4efb664c994ce8.tar.bz2 |
Merge "Do not use kDiesAtEntry when inputs must be in specific reg."
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 658aed9..9fb4cc2 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 { @@ -1440,12 +1444,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, Location::ByteRegisterOrConstant( X86ManagedRegister::FromCpuRegister(EAX), instruction->InputAt(2)), dies_at_entry); |