summaryrefslogtreecommitdiff
path: root/compiler/optimizing/code_generator_arm.cc
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2015-09-08 19:56:31 +0100
committerCalin Juravle <calin@google.com>2015-09-17 12:29:59 +0100
commit23a8e35481face09183a24b9d11e505597c75ebb (patch)
treebcaafb6ea001349acbf160c2cc89334fab4a38dc /compiler/optimizing/code_generator_arm.cc
parent175dc732c80e6f2afd83209348124df349290ba8 (diff)
Support unresolved fields in optimizing
Change-Id: I9941fa5fcb6ef0a7a253c7a0b479a44a0210aad4
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r--compiler/optimizing/code_generator_arm.cc113
1 files changed, 113 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc
index 6f89293018..15fc446c07 100644
--- a/compiler/optimizing/code_generator_arm.cc
+++ b/compiler/optimizing/code_generator_arm.cc
@@ -969,6 +969,59 @@ void CodeGeneratorARM::MoveConstant(Location location, int32_t value) {
__ LoadImmediate(location.AsRegister<Register>(), value);
}
+void CodeGeneratorARM::AddLocationAsTemp(Location location, LocationSummary* locations) {
+ if (location.IsRegister()) {
+ locations->AddTemp(location);
+ } else if (location.IsRegisterPair()) {
+ locations->AddTemp(Location::RegisterLocation(location.AsRegisterPairLow<Register>()));
+ locations->AddTemp(Location::RegisterLocation(location.AsRegisterPairHigh<Register>()));
+ } else {
+ UNIMPLEMENTED(FATAL) << "AddLocationAsTemp not implemented for location " << location;
+ }
+}
+
+void CodeGeneratorARM::MoveLocationToTemp(Location source,
+ const LocationSummary& locations,
+ int temp_index,
+ Primitive::Type type) {
+ if (!Primitive::IsFloatingPointType(type)) {
+ UNIMPLEMENTED(FATAL) << "MoveLocationToTemp not implemented for type " << type;
+ }
+
+ if (type == Primitive::kPrimFloat) {
+ DCHECK(source.IsFpuRegister()) << source;
+ __ vmovrs(locations.GetTemp(temp_index).AsRegister<Register>(),
+ source.AsFpuRegister<SRegister>());
+ } else {
+ DCHECK_EQ(type, Primitive::kPrimDouble) << type;
+ DCHECK(source.IsFpuRegisterPair()) << source;
+ __ vmovrrd(locations.GetTemp(temp_index).AsRegister<Register>(),
+ locations.GetTemp(temp_index + 1).AsRegister<Register>(),
+ FromLowSToD(source.AsFpuRegisterPairLow<SRegister>()));
+ }
+}
+
+void CodeGeneratorARM::MoveTempToLocation(const LocationSummary& locations,
+ int temp_index,
+ Location destination,
+ Primitive::Type type) {
+ if (!Primitive::IsFloatingPointType(type)) {
+ UNIMPLEMENTED(FATAL) << "MoveLocationToTemp not implemented for type " << type;
+ }
+
+ if (type == Primitive::kPrimFloat) {
+ DCHECK(destination.IsFpuRegister()) << destination;
+ __ vmovsr(destination.AsFpuRegister<SRegister>(),
+ locations.GetTemp(temp_index).AsRegister<Register>());
+ } else {
+ DCHECK(type == Primitive::kPrimDouble);
+ DCHECK(destination.IsFpuRegisterPair()) << destination;
+ __ vmovdrr(FromLowSToD(destination.AsFpuRegisterPairLow<SRegister>()),
+ locations.GetTemp(temp_index).AsRegister<Register>(),
+ locations.GetTemp(temp_index + 1).AsRegister<Register>());
+ }
+}
+
void CodeGeneratorARM::InvokeRuntime(QuickEntrypointEnum entrypoint,
HInstruction* instruction,
uint32_t dex_pc,
@@ -3536,6 +3589,66 @@ void InstructionCodeGeneratorARM::VisitStaticFieldSet(HStaticFieldSet* instructi
HandleFieldSet(instruction, instruction->GetFieldInfo(), instruction->GetValueCanBeNull());
}
+void LocationsBuilderARM::VisitUnresolvedInstanceFieldGet(
+ HUnresolvedInstanceFieldGet* instruction) {
+ FieldAccessCallingConvetionARM calling_convention;
+ codegen_->CreateUnresolvedFieldLocationSummary(
+ instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorARM::VisitUnresolvedInstanceFieldGet(
+ HUnresolvedInstanceFieldGet* instruction) {
+ codegen_->GenerateUnresolvedFieldAccess(instruction,
+ instruction->GetFieldType(),
+ instruction->GetFieldIndex(),
+ instruction->GetDexPc());
+}
+
+void LocationsBuilderARM::VisitUnresolvedInstanceFieldSet(
+ HUnresolvedInstanceFieldSet* instruction) {
+ FieldAccessCallingConvetionARM calling_convention;
+ codegen_->CreateUnresolvedFieldLocationSummary(
+ instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorARM::VisitUnresolvedInstanceFieldSet(
+ HUnresolvedInstanceFieldSet* instruction) {
+ codegen_->GenerateUnresolvedFieldAccess(instruction,
+ instruction->GetFieldType(),
+ instruction->GetFieldIndex(),
+ instruction->GetDexPc());
+}
+
+void LocationsBuilderARM::VisitUnresolvedStaticFieldGet(
+ HUnresolvedStaticFieldGet* instruction) {
+ FieldAccessCallingConvetionARM calling_convention;
+ codegen_->CreateUnresolvedFieldLocationSummary(
+ instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorARM::VisitUnresolvedStaticFieldGet(
+ HUnresolvedStaticFieldGet* instruction) {
+ codegen_->GenerateUnresolvedFieldAccess(instruction,
+ instruction->GetFieldType(),
+ instruction->GetFieldIndex(),
+ instruction->GetDexPc());
+}
+
+void LocationsBuilderARM::VisitUnresolvedStaticFieldSet(
+ HUnresolvedStaticFieldSet* instruction) {
+ FieldAccessCallingConvetionARM calling_convention;
+ codegen_->CreateUnresolvedFieldLocationSummary(
+ instruction, instruction->GetFieldType(), calling_convention);
+}
+
+void InstructionCodeGeneratorARM::VisitUnresolvedStaticFieldSet(
+ HUnresolvedStaticFieldSet* instruction) {
+ codegen_->GenerateUnresolvedFieldAccess(instruction,
+ instruction->GetFieldType(),
+ instruction->GetFieldIndex(),
+ instruction->GetDexPc());
+}
+
void LocationsBuilderARM::VisitNullCheck(HNullCheck* instruction) {
LocationSummary::CallKind call_kind = instruction->CanThrowIntoCatchBlock()
? LocationSummary::kCallOnSlowPath