From 2e59994c3c586d8b753e4b14a94c81bce3dba1a9 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Fri, 22 Sep 2017 16:17:41 +0100 Subject: ART: support for const-method-{handle,type} Adds support for const-method-handle and const-method-type bytecodes. Bug: 66562269 Test: art/test/run-test --host 979 Test: art/test/dexdump/run-all-tests Change-Id: I812eaf0f2439d6126b4287483fe2348366cacf90 --- runtime/interpreter/interpreter_switch_impl.cc | 28 +++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'runtime/interpreter/interpreter_switch_impl.cc') diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc index 850419bd9d..2514f0c383 100644 --- a/runtime/interpreter/interpreter_switch_impl.cc +++ b/runtime/interpreter/interpreter_switch_impl.cc @@ -525,6 +525,30 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, } break; } + case Instruction::CONST_METHOD_HANDLE: { + PREAMBLE(); + ObjPtr mh = + Runtime::Current()->GetClassLinker()->ResolveMethodHandle(inst->VRegB_21c(), method); + if (UNLIKELY(mh == nullptr)) { + HANDLE_PENDING_EXCEPTION(); + } else { + shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), mh.Ptr()); + inst = inst->Next_2xx(); + } + break; + } + case Instruction::CONST_METHOD_TYPE: { + PREAMBLE(); + ObjPtr mt = + Runtime::Current()->GetClassLinker()->ResolveMethodType(inst->VRegB_21c(), method); + if (UNLIKELY(mt == nullptr)) { + HANDLE_PENDING_EXCEPTION(); + } else { + shadow_frame.SetVRegReference(inst->VRegA_21c(inst_data), mt.Ptr()); + inst = inst->Next_2xx(); + } + break; + } case Instruction::MONITOR_ENTER: { PREAMBLE(); ObjPtr obj = shadow_frame.GetVRegReference(inst->VRegA_11x(inst_data)); @@ -2435,10 +2459,8 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, inst = inst->Next_2xx(); break; case Instruction::UNUSED_3E ... Instruction::UNUSED_43: + case Instruction::UNUSED_79 ... Instruction::UNUSED_7A: case Instruction::UNUSED_F3 ... Instruction::UNUSED_F9: - case Instruction::UNUSED_FE ... Instruction::UNUSED_FF: - case Instruction::UNUSED_79: - case Instruction::UNUSED_7A: UnexpectedOpcode(inst, shadow_frame); } } while (!interpret_one_instruction); -- cgit v1.2.3-59-g8ed1b