summaryrefslogtreecommitdiff
path: root/runtime/mirror/array.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2014-04-24 15:46:02 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2014-04-24 15:46:02 +0000
commit1768775ec15443a8ff326e63c0b3f8deb17699e6 (patch)
tree34b08f276979f3474b0a53769b2d100866647e91 /runtime/mirror/array.h
parent96a4f29350bf279d48bff70e21e3264cce216683 (diff)
parent973cc95da6fb617bab133bd7a693c1cb7eafd393 (diff)
Merge "ART: Extracts an utility function of the duplicated code"
Diffstat (limited to 'runtime/mirror/array.h')
-rw-r--r--runtime/mirror/array.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h
index 772d303360..a9dcfe6aee 100644
--- a/runtime/mirror/array.h
+++ b/runtime/mirror/array.h
@@ -68,6 +68,12 @@ class MANAGED Array : public Object {
}
}
+ template<class MirrorType>
+ static int32_t DataOffsetOfType(uint32_t index) {
+ return DataOffset(sizeof(HeapReference<MirrorType>)).Int32Value() +
+ (sizeof(HeapReference<MirrorType>) * index);
+ }
+
void* GetRawData(size_t component_size, int32_t index)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
intptr_t data = reinterpret_cast<intptr_t>(this) + DataOffset(component_size).Int32Value() +