diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-11-24 18:25:35 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-12-10 16:48:06 +0000 |
commit | 917d01680714b2295f109f8fea0aa06764a30b70 (patch) | |
tree | 1da1b936fcc2318dced0d0aa9d2f987af1a05169 /compiler/optimizing/code_generator_arm.cc | |
parent | d48015603a54b820d287d92709825765159615f0 (diff) |
Don't generate a slow path for strings in the dex cache.
Change-Id: I1d258f1a89bf0ec7c7ddd134be9215d480f0b09a
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 0a26786a87..a999c4c369 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -5067,16 +5067,15 @@ void InstructionCodeGeneratorARM::GenerateClassInitializationCheck( } void LocationsBuilderARM::VisitLoadString(HLoadString* load) { - LocationSummary* locations = - new (GetGraph()->GetArena()) LocationSummary(load, LocationSummary::kCallOnSlowPath); + LocationSummary::CallKind call_kind = (!load->IsInDexCache() || kEmitCompilerReadBarrier) + ? LocationSummary::kCallOnSlowPath + : LocationSummary::kNoCall; + LocationSummary* locations = new (GetGraph()->GetArena()) LocationSummary(load, call_kind); locations->SetInAt(0, Location::RequiresRegister()); locations->SetOut(Location::RequiresRegister()); } void InstructionCodeGeneratorARM::VisitLoadString(HLoadString* load) { - SlowPathCode* slow_path = new (GetGraph()->GetArena()) LoadStringSlowPathARM(load); - codegen_->AddSlowPath(slow_path); - LocationSummary* locations = load->GetLocations(); Location out_loc = locations->Out(); Register out = out_loc.AsRegister<Register>(); @@ -5107,8 +5106,12 @@ void InstructionCodeGeneratorARM::VisitLoadString(HLoadString* load) { __ LoadFromOffset(kLoadWord, out, out, cache_offset); } - __ CompareAndBranchIfZero(out, slow_path->GetEntryLabel()); - __ Bind(slow_path->GetExitLabel()); + if (!load->IsInDexCache()) { + SlowPathCode* slow_path = new (GetGraph()->GetArena()) LoadStringSlowPathARM(load); + codegen_->AddSlowPath(slow_path); + __ CompareAndBranchIfZero(out, slow_path->GetEntryLabel()); + __ Bind(slow_path->GetExitLabel()); + } } static int32_t GetExceptionTlsOffset() { |