summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-10-08 11:47:24 -0700
committerIan Rogers <irogers@google.com>2014-10-08 11:57:59 -0700
commit7e70b002c4552347ed1af8c002a0e13f08864f20 (patch)
tree79d5ee5444a5be70130d9a75dd51831c4b15687b /runtime/mirror
parentedc34c88b8f8abd04f9c4668787403608cf0b2d4 (diff)
downloadart-7e70b002c4552347ed1af8c002a0e13f08864f20.zip
art-7e70b002c4552347ed1af8c002a0e13f08864f20.tar.gz
art-7e70b002c4552347ed1af8c002a0e13f08864f20.tar.bz2
Header file clean up.
Remove runtime.h from object.h. Move TypeStaticIf to its own header file to avoid bringing utils.h into allocator.h. Move Array::DataOffset into -inl.h as it now has a utils.h dependency. Fix include issues arising from this. Change-Id: I4605b1aa4ff5f8dc15706a0132e15df03c7c8ba0
Diffstat (limited to 'runtime/mirror')
-rw-r--r--runtime/mirror/array-inl.h8
-rw-r--r--runtime/mirror/array.h8
-rw-r--r--runtime/mirror/class_loader.h2
-rw-r--r--runtime/mirror/object.h1
-rw-r--r--runtime/mirror/object_array-inl.h1
5 files changed, 11 insertions, 9 deletions
diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h
index 6582226..13b5a8b 100644
--- a/runtime/mirror/array-inl.h
+++ b/runtime/mirror/array-inl.h
@@ -45,6 +45,14 @@ inline size_t Array::SizeOf() {
return header_size + data_size;
}
+inline MemberOffset Array::DataOffset(size_t component_size) {
+ DCHECK(IsPowerOfTwo(component_size)) << component_size;
+ size_t data_offset = RoundUp(OFFSETOF_MEMBER(Array, first_element_), component_size);
+ DCHECK_EQ(RoundUp(data_offset, component_size), data_offset)
+ << "Array data offset isn't aligned with component size";
+ return MemberOffset(data_offset);
+}
+
template<VerifyObjectFlags kVerifyFlags>
inline bool Array::CheckIsValidIndex(int32_t index) {
if (UNLIKELY(static_cast<uint32_t>(index) >=
diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h
index 521d7e7..12bec89 100644
--- a/runtime/mirror/array.h
+++ b/runtime/mirror/array.h
@@ -64,13 +64,7 @@ class MANAGED Array : public Object {
return OFFSET_OF_OBJECT_MEMBER(Array, length_);
}
- static MemberOffset DataOffset(size_t component_size) {
- DCHECK(IsPowerOfTwo(component_size)) << component_size;
- size_t data_offset = RoundUp(OFFSETOF_MEMBER(Array, first_element_), component_size);
- DCHECK_EQ(RoundUp(data_offset, component_size), data_offset)
- << "Array data offset isn't aligned with component size";
- return MemberOffset(data_offset);
- }
+ static MemberOffset DataOffset(size_t component_size);
void* GetRawData(size_t component_size, int32_t index)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
diff --git a/runtime/mirror/class_loader.h b/runtime/mirror/class_loader.h
index ff2ad89..b10a296 100644
--- a/runtime/mirror/class_loader.h
+++ b/runtime/mirror/class_loader.h
@@ -17,7 +17,7 @@
#ifndef ART_RUNTIME_MIRROR_CLASS_LOADER_H_
#define ART_RUNTIME_MIRROR_CLASS_LOADER_H_
-#include "mirror/object.h"
+#include "object.h"
namespace art {
diff --git a/runtime/mirror/object.h b/runtime/mirror/object.h
index 6cd230b..b68aef9 100644
--- a/runtime/mirror/object.h
+++ b/runtime/mirror/object.h
@@ -19,7 +19,6 @@
#include "object_reference.h"
#include "offsets.h"
-#include "runtime.h"
#include "verify_object.h"
namespace art {
diff --git a/runtime/mirror/object_array-inl.h b/runtime/mirror/object_array-inl.h
index 0ca44f8..fbc4f4a 100644
--- a/runtime/mirror/object_array-inl.h
+++ b/runtime/mirror/object_array-inl.h
@@ -19,6 +19,7 @@
#include "object_array.h"
+#include "array-inl.h"
#include "base/stringprintf.h"
#include "gc/heap.h"
#include "mirror/art_field.h"