diff options
| -rw-r--r-- | compiler/optimizing/code_generator.cc | 3 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 9 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_arm64.cc | 9 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_mips64.cc | 9 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 9 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86_64.cc | 9 |
6 files changed, 32 insertions, 16 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 00f316cf98..1da2a07462 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -547,11 +547,12 @@ void CodeGenerator::CreateLoadClassLocationSummary(HLoadClass* cls, ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall); LocationSummary* locations = new (allocator) LocationSummary(cls, call_kind); - locations->SetInAt(0, Location::RequiresRegister()); if (cls->NeedsAccessCheck()) { + locations->SetInAt(0, Location::NoLocation()); locations->AddTemp(runtime_type_index_location); locations->SetOut(runtime_return_location); } else { + locations->SetInAt(0, Location::RequiresRegister()); locations->SetOut(Location::RequiresRegister()); } } diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 54af41d420..08d8d88ca6 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -4477,15 +4477,18 @@ void LocationsBuilderARM::VisitLoadClass(HLoadClass* cls) { void InstructionCodeGeneratorARM::VisitLoadClass(HLoadClass* cls) { LocationSummary* locations = cls->GetLocations(); - Register out = locations->Out().AsRegister<Register>(); - Register current_method = locations->InAt(0).AsRegister<Register>(); if (cls->NeedsAccessCheck()) { codegen_->MoveConstant(locations->GetTemp(0), cls->GetTypeIndex()); codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pInitializeTypeAndVerifyAccess), cls, cls->GetDexPc(), nullptr); - } else if (cls->IsReferrersClass()) { + return; + } + + Register out = locations->Out().AsRegister<Register>(); + Register current_method = locations->InAt(0).AsRegister<Register>(); + if (cls->IsReferrersClass()) { DCHECK(!cls->CanCallRuntime()); DCHECK(!cls->MustGenerateClinitCheck()); __ LoadFromOffset( diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 07758e9df7..415b37ddcf 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -3026,15 +3026,18 @@ void LocationsBuilderARM64::VisitLoadClass(HLoadClass* cls) { } void InstructionCodeGeneratorARM64::VisitLoadClass(HLoadClass* cls) { - Register out = OutputRegister(cls); - Register current_method = InputRegisterAt(cls, 0); if (cls->NeedsAccessCheck()) { codegen_->MoveConstant(cls->GetLocations()->GetTemp(0), cls->GetTypeIndex()); codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pInitializeTypeAndVerifyAccess), cls, cls->GetDexPc(), nullptr); - } else if (cls->IsReferrersClass()) { + return; + } + + Register out = OutputRegister(cls); + Register current_method = InputRegisterAt(cls, 0); + if (cls->IsReferrersClass()) { DCHECK(!cls->CanCallRuntime()); DCHECK(!cls->MustGenerateClinitCheck()); __ Ldr(out, MemOperand(current_method, ArtMethod::DeclaringClassOffset().Int32Value())); diff --git a/compiler/optimizing/code_generator_mips64.cc b/compiler/optimizing/code_generator_mips64.cc index 00bb5053f2..756336d0ee 100644 --- a/compiler/optimizing/code_generator_mips64.cc +++ b/compiler/optimizing/code_generator_mips64.cc @@ -2599,15 +2599,18 @@ void LocationsBuilderMIPS64::VisitLoadClass(HLoadClass* cls) { void InstructionCodeGeneratorMIPS64::VisitLoadClass(HLoadClass* cls) { LocationSummary* locations = cls->GetLocations(); - GpuRegister out = locations->Out().AsRegister<GpuRegister>(); - GpuRegister current_method = locations->InAt(0).AsRegister<GpuRegister>(); if (cls->NeedsAccessCheck()) { codegen_->MoveConstant(locations->GetTemp(0), cls->GetTypeIndex()); codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pInitializeTypeAndVerifyAccess), cls, cls->GetDexPc(), nullptr); - } else if (cls->IsReferrersClass()) { + return; + } + + GpuRegister out = locations->Out().AsRegister<GpuRegister>(); + GpuRegister current_method = locations->InAt(0).AsRegister<GpuRegister>(); + if (cls->IsReferrersClass()) { DCHECK(!cls->CanCallRuntime()); DCHECK(!cls->MustGenerateClinitCheck()); __ LoadFromOffset(kLoadUnsignedWord, out, current_method, diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index b89ca11ad0..5ef7de01e1 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -4998,15 +4998,18 @@ void LocationsBuilderX86::VisitLoadClass(HLoadClass* cls) { void InstructionCodeGeneratorX86::VisitLoadClass(HLoadClass* cls) { LocationSummary* locations = cls->GetLocations(); - Register out = locations->Out().AsRegister<Register>(); - Register current_method = locations->InAt(0).AsRegister<Register>(); if (cls->NeedsAccessCheck()) { codegen_->MoveConstant(locations->GetTemp(0), cls->GetTypeIndex()); codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pInitializeTypeAndVerifyAccess), cls, cls->GetDexPc(), nullptr); - } else if (cls->IsReferrersClass()) { + return; + } + + Register out = locations->Out().AsRegister<Register>(); + Register current_method = locations->InAt(0).AsRegister<Register>(); + if (cls->IsReferrersClass()) { DCHECK(!cls->CanCallRuntime()); DCHECK(!cls->MustGenerateClinitCheck()); __ movl(out, Address(current_method, ArtMethod::DeclaringClassOffset().Int32Value())); diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index ad6588c359..272d86fe94 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -4703,15 +4703,18 @@ void LocationsBuilderX86_64::VisitLoadClass(HLoadClass* cls) { void InstructionCodeGeneratorX86_64::VisitLoadClass(HLoadClass* cls) { LocationSummary* locations = cls->GetLocations(); - CpuRegister out = locations->Out().AsRegister<CpuRegister>(); - CpuRegister current_method = locations->InAt(0).AsRegister<CpuRegister>(); if (cls->NeedsAccessCheck()) { codegen_->MoveConstant(locations->GetTemp(0), cls->GetTypeIndex()); codegen_->InvokeRuntime(QUICK_ENTRY_POINT(pInitializeTypeAndVerifyAccess), cls, cls->GetDexPc(), nullptr); - } else if (cls->IsReferrersClass()) { + return; + } + + CpuRegister out = locations->Out().AsRegister<CpuRegister>(); + CpuRegister current_method = locations->InAt(0).AsRegister<CpuRegister>(); + if (cls->IsReferrersClass()) { DCHECK(!cls->CanCallRuntime()); DCHECK(!cls->MustGenerateClinitCheck()); __ movl(out, Address(current_method, ArtMethod::DeclaringClassOffset().Int32Value())); |