diff options
author | 2017-12-15 11:19:33 -0800 | |
---|---|---|
committer | 2017-12-22 09:41:17 -0800 | |
commit | 808c7a57bb913b13c22884f57cdacd59bf1fdb3f (patch) | |
tree | d7f0d7cabaac5a7646c25bae584a82a9aa279cc0 /runtime/class_linker.cc | |
parent | 64bae9fb677aa0e2406d13ea9f8ebaa92e16f978 (diff) |
Make CodeItem fields private
Make code item fields private and use accessors. Added a hand full of
friend classes to reduce the size of the change.
Changed default to be nullable and removed CreateNullable.
CreateNullable was a bad API since it defaulted to the unsafe, may
add a CreateNonNullable if it's important for performance.
Motivation:
Have a different layout for code items in cdex.
Bug: 63756964
Test: test-art-host-gtest
Test: test/testrunner/testrunner.py --host
Test: art/tools/run-jdwp-tests.sh '--mode=host' '--variant=X32' --debug
Change-Id: I42bc7435e20358682075cb6de52713b595f95bf9
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 55fa6328f5..45b761893f 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -4317,15 +4317,14 @@ void ClassLinker::ResolveClassExceptionHandlerTypes(Handle<mirror::Class> klass) void ClassLinker::ResolveMethodExceptionHandlerTypes(ArtMethod* method) { // similar to DexVerifier::ScanTryCatchBlocks and dex2oat's ResolveExceptionsForMethod. - const DexFile::CodeItem* code_item = - method->GetDexFile()->GetCodeItem(method->GetCodeItemOffset()); - if (code_item == nullptr) { + CodeItemDataAccessor accessor(method); + if (!accessor.HasCodeItem()) { return; // native or abstract method } - if (code_item->tries_size_ == 0) { + if (accessor.TriesSize() == 0) { return; // nothing to process } - const uint8_t* handlers_ptr = DexFile::GetCatchHandlerData(*code_item, 0); + const uint8_t* handlers_ptr = accessor.GetCatchHandlerData(0); uint32_t handlers_size = DecodeUnsignedLeb128(&handlers_ptr); for (uint32_t idx = 0; idx < handlers_size; idx++) { CatchHandlerIterator iterator(handlers_ptr); |