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
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc
index 49f2021..a4ee21d 100644
--- a/runtime/instrumentation.cc
+++ b/runtime/instrumentation.cc
@@ -1246,18 +1246,17 @@
shorty = m->GetInterfaceMethodIfProxy(kRuntimePointerSize)->GetShorty()[0];
return false;
}
- const DexFile::CodeItem* code_item = m->GetCodeItem();
- const Instruction* instr = Instruction::At(&code_item->insns_[GetDexPc()]);
- if (instr->IsInvoke()) {
+ const Instruction& instr = m->DexInstructions().InstructionAt(GetDexPc());
+ if (instr.IsInvoke()) {
const DexFile* dex_file = m->GetDexFile();
- if (interpreter::IsStringInit(dex_file, instr->VRegB())) {
+ if (interpreter::IsStringInit(dex_file, instr.VRegB())) {
// Invoking string init constructor is turned into invoking
// StringFactory.newStringFromChars() which returns a string.
shorty = 'L';
return false;
}
// A regular invoke, use callee's shorty.
- uint32_t method_idx = instr->VRegB();
+ uint32_t method_idx = instr.VRegB();
shorty = dex_file->GetMethodShorty(method_idx)[0];
}
// Stop stack walking since we've seen a Java frame.