summaryrefslogtreecommitdiff
path: root/compiler/utils/array_ref.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2014-08-01 19:04:18 +0100
committer Vladimir Marko <vmarko@google.com> 2014-09-25 18:56:34 +0100
commitf4da675bbc4615c5f854c81964cac9dd1153baea (patch)
treeea78bafc7ee543e11e7bd824ab40d5f5f3d82f9d /compiler/utils/array_ref.h
parentf2476d524281c6d649f5deb6d1ccccc92380c1ed (diff)
Implement method calls using relative BL on ARM.
Store the linker patches with each CompiledMethod instead of keeping them in CompilerDriver. Reorganize oat file creation to apply the patches as we're writing the method code. Add framework for platform-specific relative call patches in the OatWriter. Implement relative call patches for ARM. Change-Id: Ie2effb3d92b61ac8f356140eba09dc37d62290f8
Diffstat (limited to 'compiler/utils/array_ref.h')
-rw-r--r--compiler/utils/array_ref.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/compiler/utils/array_ref.h b/compiler/utils/array_ref.h
index 2d70b7dd31..e6b4a6a47c 100644
--- a/compiler/utils/array_ref.h
+++ b/compiler/utils/array_ref.h
@@ -82,12 +82,13 @@ class ArrayRef {
: array_(array), size_(size) {
}
- explicit ArrayRef(std::vector<T>& v)
+ template <typename Alloc>
+ explicit ArrayRef(std::vector<T, Alloc>& v)
: array_(v.data()), size_(v.size()) {
}
- template <typename U>
- ArrayRef(const std::vector<U>& v,
+ template <typename U, typename Alloc>
+ ArrayRef(const std::vector<U, Alloc>& v,
typename std::enable_if<std::is_same<T, const U>::value, tag>::tag t = tag())
: array_(v.data()), size_(v.size()) {
}
@@ -167,6 +168,16 @@ class ArrayRef {
size_t size_;
};
+template <typename T>
+bool operator==(const ArrayRef<T>& lhs, const ArrayRef<T>& rhs) {
+ return lhs.size() == rhs.size() && std::equal(lhs.begin(), lhs.end(), rhs.begin());
+}
+
+template <typename T>
+bool operator!=(const ArrayRef<T>& lhs, const ArrayRef<T>& rhs) {
+ return !(lhs == rhs);
+}
+
} // namespace art