From 624279f3c70f9904cbaf428078981b05d3b324c0 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Thu, 4 Dec 2014 11:54:28 +0000 Subject: Add support for float-to-long in the optimizing compiler. - Add support for the float-to-long Dex instruction in the optimizing compiler. - Add a Dex PC field to art::HTypeConversion to allow the x86 and ARM code generators to produce runtime calls. - Instruct art::CodeGenerator::RecordPcInfo not to record PC information for HTypeConversion instructions. - Add S0 to the list of ARM FPU parameter registers. - Have art::x86_64::X86_64Assembler::cvttss2si work with 64-bit operands. - Generate x86, x86-64 and ARM (but not ARM64) code for float to long HTypeConversion nodes. - Add related tests to test/422-type-conversion. Change-Id: I954214f0d537187883f83f7a83a1bb2dd8a21fd4 --- compiler/optimizing/code_generator.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index e581af22aa..7f358eaa6b 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -499,6 +499,21 @@ void CodeGenerator::BuildStackMaps(std::vector* data) { } void CodeGenerator::RecordPcInfo(HInstruction* instruction, uint32_t dex_pc) { + if (instruction != nullptr && instruction->IsTypeConversion()) { + // The code generated for some type conversions may call the + // runtime, thus normally requiring a subsequent call to this + // method. However, the method verifier does not produce PC + // information for Dex type conversion instructions, as it + // considers them as "atomic" (they cannot join a GC). + // Therefore we do not currently record PC information for such + // instructions. As this may change later, we added this special + // case so that code generators may nevertheless call + // CodeGenerator::RecordPcInfo without triggering an error in + // CodeGenerator::BuildNativeGCMap ("Missing ref for dex pc 0x") + // thereafter. + return; + } + // Collect PC infos for the mapping table. struct PcInfo pc_info; pc_info.dex_pc = dex_pc; -- cgit v1.2.3-59-g8ed1b