diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-12-01 10:31:54 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-12-15 22:52:27 +0000 |
commit | e53798a7e3267305f696bf658e418c92e63e0834 (patch) | |
tree | 8979bbed96b107a5a6bbae9285ff4e0c362dad95 /compiler/optimizing/code_generator.cc | |
parent | e6c0cdd11097dd72275ac24f1e98217c299d973e (diff) | |
download | android_art-e53798a7e3267305f696bf658e418c92e63e0834.tar.gz android_art-e53798a7e3267305f696bf658e418c92e63e0834.tar.bz2 android_art-e53798a7e3267305f696bf658e418c92e63e0834.zip |
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
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 13 |
1 files changed, 11 insertions, 2 deletions
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<double, int64_t>(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<float, int32_t>(current->AsFloatConstant()->GetValue()); + stack_map_stream_.AddDexRegisterEntry(DexRegisterMap::kConstant, value); } break; } |