Faster instance-of for final classes.
If a class is final and not and array we can generate a 1/0 based on class
equality.
Use a method's declaring class if it matches the instance-of class (common in
Java equals methods).
Don't do a class pointer comparison in the case of an abstract or interface
class, just go straight into the slow-path.
Fix performance bug where peep-hole verifier pass didn't merge into the
fall-through line if the next instruction wasn't interesting.
Change-Id: Idb47ec6acebfd25a344ed74adaacba02fafc7df2
diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc
index 2798ab3..5eec58b 100644
--- a/src/verifier/method_verifier.cc
+++ b/src/verifier/method_verifier.cc
@@ -1253,6 +1253,11 @@
if (dead_start >= 0) {
LogVerifyInfo() << "dead code " << reinterpret_cast<void*>(dead_start) << "-" << reinterpret_cast<void*>(insn_idx - 1);
}
+ // To dump the state of the verify after a method, do something like:
+ // if (PrettyMethod(dex_method_idx_, *dex_file_) ==
+ // "boolean java.lang.String.equals(java.lang.Object)") {
+ // LOG(INFO) << info_messages_.str();
+ // }
}
return true;
}
@@ -2528,12 +2533,12 @@
if (!CheckNotMoveException(code_item_->insns_, next_insn_idx)) {
return false;
}
+ if (NULL != fallthrough_line.get()) {
+ // Make workline consistent with fallthrough computed from peephole optimization.
+ work_line_->CopyFromLine(fallthrough_line.get());
+ }
RegisterLine* next_line = reg_table_.GetLine(next_insn_idx);
if (next_line != NULL) {
- if (NULL != fallthrough_line.get()) {
- // Make workline consistent with fallthrough computed from peephole optimization.
- work_line_->CopyFromLine(fallthrough_line.get());
- }
// Merge registers into what we have for the next instruction,
// and set the "changed" flag if needed.
if (!UpdateRegisters(next_insn_idx, work_line_.get())) {