Fix dex2dex logic
There was a bug in the dex2dex logic where would only dex2dex if
IsCandidateForCompilation was true or method verifier had check casts.
The bug was caused by not adding verification results, which caused
verification_results_->GetVerifiedMethod to not have verified methods
in most cases for interpreter-only and verify-none compilation.
Caffeinemark interpret-only before:
Sieve score = 1184
Loop score = 630
Logic score = 3519
String score = 1532
Float score = 882
Method score = 686
Overall score = 1159
After:
Sieve score = 2820
Loop score = 1942
Logic score = 4694
String score = 1679
Float score = 2288
Method score = 1294
Overall score = 2244
Bug: 17950037
Change-Id: I535ab8784b434b0a8e3f66e3ab4936d10a1b04bf
diff --git a/compiler/dex/verification_results.cc b/compiler/dex/verification_results.cc
index 150bdac..a4df00e 100644
--- a/compiler/dex/verification_results.cc
+++ b/compiler/dex/verification_results.cc
@@ -49,11 +49,6 @@
DCHECK(method_verifier != NULL);
MethodReference ref = method_verifier->GetMethodReference();
bool compile = IsCandidateForCompilation(ref, method_verifier->GetAccessFlags());
- // TODO: Check also for virtual/interface invokes when DEX-to-DEX supports devirtualization.
- if (!compile && !method_verifier->HasCheckCasts()) {
- return true;
- }
-
const VerifiedMethod* verified_method = VerifiedMethod::Create(method_verifier, compile);
if (verified_method == nullptr) {
// Do not report an error to the verifier. We'll just punt this later.