diff options
author | Mathieu Chartier <mathieuc@google.com> | 2014-05-21 17:43:44 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2014-06-09 12:46:32 -0700 |
commit | bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe (patch) | |
tree | 3d3f667c8232a9c1bb6fe9daea0d364f9ae01d8c /runtime/entrypoints/portable/portable_throw_entrypoints.cc | |
parent | 2e1ca953c7fb165da36cc26ea74d3045d7e272c8 (diff) | |
download | art-bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe.tar.gz art-bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe.tar.bz2 art-bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe.zip |
Change MethodHelper to use a Handle.
Added ConstHandle to help prevent errors where you modify the value
stored in the handle of the caller. Also fixed compaction bugs
related to not knowing MethodHelper::GetReturnType can resolve types.
This bug was present in interpreter RETURN_OBJECT.
Bug: 13077697
Change-Id: I71f964d4d810ab4debda1a09bc968af8f3c874a3
Diffstat (limited to 'runtime/entrypoints/portable/portable_throw_entrypoints.cc')
-rw-r--r-- | runtime/entrypoints/portable/portable_throw_entrypoints.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/runtime/entrypoints/portable/portable_throw_entrypoints.cc b/runtime/entrypoints/portable/portable_throw_entrypoints.cc index 1fdb8327cc..189e6b5903 100644 --- a/runtime/entrypoints/portable/portable_throw_entrypoints.cc +++ b/runtime/entrypoints/portable/portable_throw_entrypoints.cc @@ -79,8 +79,9 @@ extern "C" int32_t art_portable_find_catch_block_from_code(mirror::ArtMethod* cu return -1; } mirror::Class* exception_type = exception->GetClass(); - MethodHelper mh(current_method); - const DexFile::CodeItem* code_item = mh.GetCodeItem(); + StackHandleScope<1> hs(self); + MethodHelper mh(hs.NewHandle(current_method)); + const DexFile::CodeItem* code_item = current_method->GetCodeItem(); DCHECK_LT(ti_offset, code_item->tries_size_); const DexFile::TryItem* try_item = DexFile::GetTryItems(*code_item, ti_offset); @@ -102,7 +103,7 @@ extern "C" int32_t art_portable_find_catch_block_from_code(mirror::ArtMethod* cu // TODO: check, the verifier (class linker?) should take care of resolving all exception // classes early. LOG(WARNING) << "Unresolved exception class when finding catch block: " - << mh.GetTypeDescriptorFromTypeIdx(iter_type_idx); + << current_method->GetTypeDescriptorFromTypeIdx(iter_type_idx); } else if (iter_exception_type->IsAssignableFrom(exception_type)) { catch_dex_pc = it.GetHandlerAddress(); result = iter_index; @@ -112,13 +113,11 @@ extern "C" int32_t art_portable_find_catch_block_from_code(mirror::ArtMethod* cu } if (result != -1) { // Handler found. - Runtime::Current()->GetInstrumentation()->ExceptionCaughtEvent(self, - throw_location, - current_method, - catch_dex_pc, - exception); + Runtime::Current()->GetInstrumentation()->ExceptionCaughtEvent( + self, throw_location, current_method, catch_dex_pc, exception); // If the catch block has no move-exception then clear the exception for it. - const Instruction* first_catch_instr = Instruction::At(&mh.GetCodeItem()->insns_[catch_dex_pc]); + const Instruction* first_catch_instr = Instruction::At( + ¤t_method->GetCodeItem()->insns_[catch_dex_pc]); if (first_catch_instr->Opcode() != Instruction::MOVE_EXCEPTION) { self->ClearException(); } |