diff options
author | 2016-06-21 16:18:10 +0000 | |
---|---|---|
committer | 2016-06-21 16:18:10 +0000 | |
commit | 4692c35c151951aa1fa901ca24bfa302a9beeacf (patch) | |
tree | 8d28d7714dd7fa0ae1ff44888ae61f3c8786bfeb /compiler/optimizing/code_generator.cc | |
parent | f6d4f6e0e61977777b7a9ca18b75bcd26e98e9f9 (diff) | |
parent | 87f3fcbd0db352157fc59148e94647ef21b73bce (diff) |
Merge "Replace String.charAt() with HIR."
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 6e851bf1ba..12aa15207c 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -146,6 +146,13 @@ uint32_t CodeGenerator::GetArrayLengthOffset(HArrayLength* array_length) { : mirror::Array::LengthOffset().Uint32Value(); } +uint32_t CodeGenerator::GetArrayDataOffset(HArrayGet* array_get) { + DCHECK(array_get->GetType() == Primitive::kPrimChar || !array_get->IsStringCharAt()); + return array_get->IsStringCharAt() + ? mirror::String::ValueOffset().Uint32Value() + : mirror::Array::DataOffset(Primitive::ComponentSize(array_get->GetType())).Uint32Value(); +} + bool CodeGenerator::GoesToNextBlock(HBasicBlock* current, HBasicBlock* next) const { DCHECK_EQ((*block_order_)[current_block_index_], current); return GetNextBlockToEmit() == FirstNonEmptyBlock(next); |