diff options
author | Vladimir Marko <vmarko@google.com> | 2016-06-21 16:18:10 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-06-21 16:18:10 +0000 |
commit | 4692c35c151951aa1fa901ca24bfa302a9beeacf (patch) | |
tree | 8d28d7714dd7fa0ae1ff44888ae61f3c8786bfeb /compiler/optimizing/code_generator_arm.cc | |
parent | f6d4f6e0e61977777b7a9ca18b75bcd26e98e9f9 (diff) | |
parent | 87f3fcbd0db352157fc59148e94647ef21b73bce (diff) |
Merge "Replace String.charAt() with HIR."
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index f5befa65c1..b9466ba212 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -176,8 +176,11 @@ class BoundsCheckSlowPathARM : public SlowPathCode { locations->InAt(1), Location::RegisterLocation(calling_convention.GetRegisterAt(1)), Primitive::kPrimInt); - arm_codegen->InvokeRuntime( - QUICK_ENTRY_POINT(pThrowArrayBounds), instruction_, instruction_->GetDexPc(), this); + uint32_t entry_point_offset = instruction_->AsBoundsCheck()->IsStringCharAt() + ? QUICK_ENTRY_POINT(pThrowStringBounds) + : QUICK_ENTRY_POINT(pThrowArrayBounds); + arm_codegen->InvokeRuntime(entry_point_offset, instruction_, instruction_->GetDexPc(), this); + CheckEntrypointTypes<kQuickThrowStringBounds, void, int32_t, int32_t>(); CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>(); } @@ -4289,11 +4292,11 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { Register obj = obj_loc.AsRegister<Register>(); Location index = locations->InAt(1); Location out_loc = locations->Out(); + uint32_t data_offset = CodeGenerator::GetArrayDataOffset(instruction); Primitive::Type type = instruction->GetType(); switch (type) { case Primitive::kPrimBoolean: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(uint8_t)).Uint32Value(); Register out = out_loc.AsRegister<Register>(); if (index.IsConstant()) { size_t offset = @@ -4307,7 +4310,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { } case Primitive::kPrimByte: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(int8_t)).Uint32Value(); Register out = out_loc.AsRegister<Register>(); if (index.IsConstant()) { size_t offset = @@ -4321,7 +4323,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { } case Primitive::kPrimShort: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(int16_t)).Uint32Value(); Register out = out_loc.AsRegister<Register>(); if (index.IsConstant()) { size_t offset = @@ -4335,7 +4336,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { } case Primitive::kPrimChar: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(uint16_t)).Uint32Value(); Register out = out_loc.AsRegister<Register>(); if (index.IsConstant()) { size_t offset = @@ -4349,7 +4349,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { } case Primitive::kPrimInt: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(int32_t)).Uint32Value(); Register out = out_loc.AsRegister<Register>(); if (index.IsConstant()) { size_t offset = @@ -4366,7 +4365,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { static_assert( sizeof(mirror::HeapReference<mirror::Object>) == sizeof(int32_t), "art::mirror::HeapReference<art::mirror::Object> and int32_t have different sizes."); - uint32_t data_offset = mirror::Array::DataOffset(sizeof(int32_t)).Uint32Value(); // /* HeapReference<Object> */ out = // *(obj + data_offset + index * sizeof(HeapReference<Object>)) if (kEmitCompilerReadBarrier && kUseBakerReadBarrier) { @@ -4401,7 +4399,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { } case Primitive::kPrimLong: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(int64_t)).Uint32Value(); if (index.IsConstant()) { size_t offset = (index.GetConstant()->AsIntConstant()->GetValue() << TIMES_8) + data_offset; @@ -4414,7 +4411,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { } case Primitive::kPrimFloat: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(float)).Uint32Value(); SRegister out = out_loc.AsFpuRegister<SRegister>(); if (index.IsConstant()) { size_t offset = (index.GetConstant()->AsIntConstant()->GetValue() << TIMES_4) + data_offset; @@ -4427,7 +4423,6 @@ void InstructionCodeGeneratorARM::VisitArrayGet(HArrayGet* instruction) { } case Primitive::kPrimDouble: { - uint32_t data_offset = mirror::Array::DataOffset(sizeof(double)).Uint32Value(); SRegister out = out_loc.AsFpuRegisterPairLow<SRegister>(); if (index.IsConstant()) { size_t offset = (index.GetConstant()->AsIntConstant()->GetValue() << TIMES_8) + data_offset; |