From e53798a7e3267305f696bf658e418c92e63e0834 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 1 Dec 2014 10:31:54 +0000 Subject: Inlining support in optimizing. Currently only inlines simple things that don't require an environment, such as: - Returning a constant. - Returning a parameter. - Returning an arithmetic operation. Change-Id: Ie844950cb44f69e104774a3cf7a8dea66bc85661 --- compiler/optimizing/code_generator.cc | 13 +++++++++++-- 1 file changed, 11 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 461409ddca..6f424ce11d 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -565,10 +565,19 @@ void CodeGenerator::RecordPcInfo(HInstruction* instruction, uint32_t dex_pc) { stack_map_stream_.AddDexRegisterEntry(DexRegisterMap::kConstant, High32Bits(value)); ++i; DCHECK_LT(i, environment_size); - } else { - DCHECK(current->IsIntConstant()); + } else if (current->IsDoubleConstant()) { + int64_t value = bit_cast(current->AsDoubleConstant()->GetValue()); + stack_map_stream_.AddDexRegisterEntry(DexRegisterMap::kConstant, Low32Bits(value)); + stack_map_stream_.AddDexRegisterEntry(DexRegisterMap::kConstant, High32Bits(value)); + ++i; + DCHECK_LT(i, environment_size); + } else if (current->IsIntConstant()) { int32_t value = current->AsIntConstant()->GetValue(); stack_map_stream_.AddDexRegisterEntry(DexRegisterMap::kConstant, value); + } else { + DCHECK(current->IsFloatConstant()); + int32_t value = bit_cast(current->AsFloatConstant()->GetValue()); + stack_map_stream_.AddDexRegisterEntry(DexRegisterMap::kConstant, value); } break; } -- cgit v1.2.3-59-g8ed1b