From d0b51838d5cbec18a9b3a6de7bd9bd2a7a3905d5 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Thu, 26 Jan 2017 19:04:23 +0000 Subject: Don't use VIXL's temp registers in LocationsBuilderARM64::HandleFieldGet. Before this CL, when emitting a volatile field load with a large offset, it was possible to deplete the pool of VIXL ARM64 temporary registers (IP0, IP1) in the concurrent collector configuration. To avoid this, we now request a temporary register from the register allocator instead. Test: m test-art-target-run-test-635-checker-arm64-volatile-load-cc Bug: 34726333 Change-Id: Idf73a0306142c6133e259783aacaf7ad5401a2fd --- compiler/optimizing/code_generator_arm64.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 9762ee81b1..e685d598d6 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -1903,6 +1903,9 @@ void LocationsBuilderARM64::HandleFieldGet(HInstruction* instruction) { LocationSummary::kNoCall); if (object_field_get_with_read_barrier && kUseBakerReadBarrier) { locations->SetCustomSlowPathCallerSaves(RegisterSet::Empty()); // No caller-save registers. + // We need a temporary register for the read barrier marking slow + // path in CodeGeneratorARM64::GenerateFieldLoadWithBakerReadBarrier. + locations->AddTemp(Location::RequiresRegister()); } locations->SetInAt(0, Location::RequiresRegister()); if (Primitive::IsFloatingPointType(instruction->GetType())) { @@ -1930,11 +1933,9 @@ void InstructionCodeGeneratorARM64::HandleFieldGet(HInstruction* instruction, if (field_type == Primitive::kPrimNot && kEmitCompilerReadBarrier && kUseBakerReadBarrier) { // Object FieldGet with Baker's read barrier case. - MacroAssembler* masm = GetVIXLAssembler(); - UseScratchRegisterScope temps(masm); // /* HeapReference */ out = *(base + offset) Register base = RegisterFrom(base_loc, Primitive::kPrimNot); - Register temp = temps.AcquireW(); + Register temp = WRegisterFrom(locations->GetTemp(0)); // Note that potential implicit null checks are handled in this // CodeGeneratorARM64::GenerateFieldLoadWithBakerReadBarrier call. codegen_->GenerateFieldLoadWithBakerReadBarrier( -- cgit v1.2.3-59-g8ed1b