summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2016-11-30 15:49:40 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-11-30 15:49:41 +0000
commit725466c0207d4b3d997633f5c321adee2dcd5483 (patch)
tree0dda746395e490e16a4209d0bca1c3a366ed19ea /compiler
parent07e6a7947f3279f66f14f7af045065b5297294c2 (diff)
parent8d2c459d3f694743ac6e75042d1cf9b1efb1194e (diff)
Merge "ARM: VIXL32: Implement HClassTableGet Visitor."
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/code_generator_arm_vixl.cc32
1 files changed, 25 insertions, 7 deletions
diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc
index bb6857d0a6..1b5138f6f2 100644
--- a/compiler/optimizing/code_generator_arm_vixl.cc
+++ b/compiler/optimizing/code_generator_arm_vixl.cc
@@ -6242,17 +6242,35 @@ void CodeGeneratorARMVIXL::MoveFromReturnRegister(Location trg, Primitive::Type
}
}
-void LocationsBuilderARMVIXL::VisitClassTableGet(
- HClassTableGet* instruction ATTRIBUTE_UNUSED) {
- TODO_VIXL32(FATAL);
+void LocationsBuilderARMVIXL::VisitClassTableGet(HClassTableGet* instruction) {
+ LocationSummary* locations =
+ new (GetGraph()->GetArena()) LocationSummary(instruction, LocationSummary::kNoCall);
+ locations->SetInAt(0, Location::RequiresRegister());
+ locations->SetOut(Location::RequiresRegister());
}
-void InstructionCodeGeneratorARMVIXL::VisitClassTableGet(
- HClassTableGet* instruction ATTRIBUTE_UNUSED) {
- TODO_VIXL32(FATAL);
+void InstructionCodeGeneratorARMVIXL::VisitClassTableGet(HClassTableGet* instruction) {
+ if (instruction->GetTableKind() == HClassTableGet::TableKind::kVTable) {
+ uint32_t method_offset = mirror::Class::EmbeddedVTableEntryOffset(
+ instruction->GetIndex(), kArmPointerSize).SizeValue();
+ GetAssembler()->LoadFromOffset(kLoadWord,
+ OutputRegister(instruction),
+ InputRegisterAt(instruction, 0),
+ method_offset);
+ } else {
+ uint32_t method_offset = static_cast<uint32_t>(ImTable::OffsetOfElement(
+ instruction->GetIndex(), kArmPointerSize));
+ GetAssembler()->LoadFromOffset(kLoadWord,
+ OutputRegister(instruction),
+ InputRegisterAt(instruction, 0),
+ mirror::Class::ImtPtrOffset(kArmPointerSize).Uint32Value());
+ GetAssembler()->LoadFromOffset(kLoadWord,
+ OutputRegister(instruction),
+ OutputRegister(instruction),
+ method_offset);
+ }
}
-
#undef __
#undef QUICK_ENTRY_POINT
#undef TODO_VIXL32