From d9cb68e3212d31d61445fb7e8446f68991720009 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Tue, 25 Aug 2015 13:52:43 +0100 Subject: ART: Add (Fpu)RegHigh stack map location kinds When running Optimized code on 64-bit, high value of vreg pair may be stored in the high 32 bits of a CPU register. This is not reflected in stack maps which would encode both the low and high vreg as kInRegister with the same register number, making it indistinguishable from two non-wide vregs with the same value in the lower 32 bits. Deoptimization deals with this by running the verifier and thus obtaining vreg pair information, but this would be too slow for try/ catch. This patch therefore adds two new stack map location kinds: kInRegisterHigh and kInFpuRegisterHigh to differentiate between the two cases. Note that this also applies to floating-point registers on x86. Change-Id: I15092323e56a661673e77bee1f0fca4261374732 --- compiler/optimizing/code_generator.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 6568ea4915..503187bd3d 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -887,7 +887,7 @@ void CodeGenerator::EmitEnvironment(HEnvironment* environment, SlowPathCode* slo } else { stack_map_stream_.AddDexRegisterEntry(DexRegisterLocation::Kind::kInRegister, id); if (current->GetType() == Primitive::kPrimLong) { - stack_map_stream_.AddDexRegisterEntry(DexRegisterLocation::Kind::kInRegister, id); + stack_map_stream_.AddDexRegisterEntry(DexRegisterLocation::Kind::kInRegisterHigh, id); ++i; DCHECK_LT(i, environment_size); } @@ -909,7 +909,8 @@ void CodeGenerator::EmitEnvironment(HEnvironment* environment, SlowPathCode* slo } else { stack_map_stream_.AddDexRegisterEntry(DexRegisterLocation::Kind::kInFpuRegister, id); if (current->GetType() == Primitive::kPrimDouble) { - stack_map_stream_.AddDexRegisterEntry(DexRegisterLocation::Kind::kInFpuRegister, id); + stack_map_stream_.AddDexRegisterEntry( + DexRegisterLocation::Kind::kInFpuRegisterHigh, id); ++i; DCHECK_LT(i, environment_size); } -- cgit v1.2.3-59-g8ed1b