summaryrefslogtreecommitdiff
path: root/runtime/art_method.h
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-06-15 17:44:14 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-06-15 17:44:14 +0000
commitabdda2fb52eb7e9a6916899a913f78251d8ed277 (patch)
tree165a31831ae077827b1e7b973bd5602125b5b142 /runtime/art_method.h
parent2b87a47c09823031c4fe336dcef0867605debfd7 (diff)
parentbadee9820fcf5dca5f8c46c3215ae1779ee7736e (diff)
Merge "Optimize IMT"
Diffstat (limited to 'runtime/art_method.h')
-rw-r--r--runtime/art_method.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/art_method.h b/runtime/art_method.h
index 2b025f8c62..90b2406a1d 100644
--- a/runtime/art_method.h
+++ b/runtime/art_method.h
@@ -99,6 +99,22 @@ class ImtConflictTable {
return GetMethod(index * kMethodCount + kMethodImplementation, pointer_size);
}
+ // Return true if two conflict tables are the same.
+ bool Equals(ImtConflictTable* other, size_t pointer_size) const {
+ size_t num = NumEntries(pointer_size);
+ if (num != other->NumEntries(pointer_size)) {
+ return false;
+ }
+ for (size_t i = 0; i < num; ++i) {
+ if (GetInterfaceMethod(i, pointer_size) != other->GetInterfaceMethod(i, pointer_size) ||
+ GetImplementationMethod(i, pointer_size) !=
+ other->GetImplementationMethod(i, pointer_size)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
// Visit all of the entries.
// NO_THREAD_SAFETY_ANALYSIS for calling with held locks. Visitor is passed a pair of ArtMethod*
// and also returns one. The order is <interface, implementation>.