Avoid compile time rewriting of dex code by verifier.
Compile time rewriting of dex code leads to dead code that is causing
issues with the LLVM compiler. Make instantiation and incompatible class
change errors be detected in slow path field and invoke logic so its
safe for the compile time verification just to softly fail the effected
classes.
This change places incompatible class change logic into the class
linkers ResolveMethod and consequently changes a number of APIs.
Change-Id: Ifb25f09accea348d15180f6ff041e38dfe0d536e
diff --git a/src/compiler/codegen/CodegenUtil.cc b/src/compiler/codegen/CodegenUtil.cc
index dd7daba..3aea76a 100644
--- a/src/compiler/codegen/CodegenUtil.cc
+++ b/src/compiler/codegen/CodegenUtil.cc
@@ -646,9 +646,9 @@
uint32_t target = dataLIR->operands[0];
cUnit->compiler->AddCodePatch(cUnit->dex_file,
cUnit->method_idx,
- cUnit->access_flags,
+ cUnit->invoke_type,
target,
- IsDirect(dataLIR->operands[1]),
+ static_cast<InvokeType>(dataLIR->operands[1]),
cUnit->codeBuffer.size());
const DexFile::MethodId& id = cUnit->dex_file->GetMethodId(target);
// unique based on target to ensure code deduplication works
@@ -661,9 +661,9 @@
uint32_t target = dataLIR->operands[0];
cUnit->compiler->AddMethodPatch(cUnit->dex_file,
cUnit->method_idx,
- cUnit->access_flags,
+ cUnit->invoke_type,
target,
- IsDirect(dataLIR->operands[1]),
+ static_cast<InvokeType>(dataLIR->operands[1]),
cUnit->codeBuffer.size());
const DexFile::MethodId& id = cUnit->dex_file->GetMethodId(target);
// unique based on target to ensure code deduplication works