diff options
| author | 2018-05-11 13:40:39 +0000 | |
|---|---|---|
| committer | 2018-05-11 13:40:39 +0000 | |
| commit | e0230b4cc18fbaa797b4a80714322e1d9cd72c84 (patch) | |
| tree | 46f0cc6f313a2177b915bc9c3adff6f7b57d3b1a /compiler/optimizing/code_generator.cc | |
| parent | 9d93cd6518633be803cc140b51d0ad5093fc25f2 (diff) | |
| parent | dbaa5c7ba8935cf87ceb40a4054f9842929e9a51 (diff) | |
Merge "ART: Compiler support for const-method-handle"
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
| -rw-r--r-- | compiler/optimizing/code_generator.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 1e44311cb1..f57333741c 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -736,6 +736,26 @@ void CodeGenerator::GenerateLoadClassRuntimeCall(HLoadClass* cls) { } } +void CodeGenerator::CreateLoadMethodHandleRuntimeCallLocationSummary( + HLoadMethodHandle* method_handle, + Location runtime_proto_index_location, + Location runtime_return_location) { + DCHECK_EQ(method_handle->InputCount(), 1u); + LocationSummary* locations = + new (method_handle->GetBlock()->GetGraph()->GetAllocator()) LocationSummary( + method_handle, LocationSummary::kCallOnMainOnly); + locations->SetInAt(0, Location::NoLocation()); + locations->AddTemp(runtime_proto_index_location); + locations->SetOut(runtime_return_location); +} + +void CodeGenerator::GenerateLoadMethodHandleRuntimeCall(HLoadMethodHandle* method_handle) { + LocationSummary* locations = method_handle->GetLocations(); + MoveConstant(locations->GetTemp(0), method_handle->GetMethodHandleIndex()); + CheckEntrypointTypes<kQuickResolveMethodHandle, void*, uint32_t>(); + InvokeRuntime(kQuickResolveMethodHandle, method_handle, method_handle->GetDexPc()); +} + void CodeGenerator::CreateLoadMethodTypeRuntimeCallLocationSummary( HLoadMethodType* method_type, Location runtime_proto_index_location, |