diff options
author | Mathieu Chartier <mathieuc@google.com> | 2016-09-30 10:27:43 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2016-10-03 14:06:27 -0700 |
commit | 3398c7874e002beaa6c2b2fadf183e7d1ddad23a (patch) | |
tree | 7db754b5b0c3a6c68bc1f91d7cb2477f534d2ad3 /runtime/gc_root-inl.h | |
parent | 462e21cc8d28a4d48342cf0f634bd1ecc63647d7 (diff) | |
download | art-3398c7874e002beaa6c2b2fadf183e7d1ddad23a.tar.gz art-3398c7874e002beaa6c2b2fadf183e7d1ddad23a.tar.bz2 art-3398c7874e002beaa6c2b2fadf183e7d1ddad23a.zip |
Move ArtField to ObjPtr
Added EXPECT_OBJ_PTR_EQ and variants to gtests.
Fixed moving GC bugs in:
ClassLinker::CreatePathClassLoader
ClassLinkerTest: StaticFields
ObjPtr Decode call sites: 186 -> 181.
Some tests fail due to ResolvedFieldAccessTest, will fix in follow
up CL.
Bug: 31113334
Test: test-art-host CC baker
Change-Id: I8b266ad00f3c20c8cbe7cfdf280d175083df0b88
Diffstat (limited to 'runtime/gc_root-inl.h')
-rw-r--r-- | runtime/gc_root-inl.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/gc_root-inl.h b/runtime/gc_root-inl.h index ae8a38f43e..11ccd33bc2 100644 --- a/runtime/gc_root-inl.h +++ b/runtime/gc_root-inl.h @@ -21,6 +21,7 @@ #include <sstream> +#include "obj_ptr-inl.h" #include "read_barrier-inl.h" namespace art { @@ -31,10 +32,15 @@ inline MirrorType* GcRoot<MirrorType>::Read(GcRootSource* gc_root_source) const return down_cast<MirrorType*>( ReadBarrier::BarrierForRoot<mirror::Object, kReadBarrierOption>(&root_, gc_root_source)); } + template<class MirrorType> inline GcRoot<MirrorType>::GcRoot(MirrorType* ref) : root_(mirror::CompressedReference<mirror::Object>::FromMirrorPtr(ref)) { } +template<class MirrorType> +inline GcRoot<MirrorType>::GcRoot(ObjPtr<MirrorType, kIsDebugBuild> ref) + : GcRoot(ref.Decode()) { } + inline std::string RootInfo::ToString() const { std::ostringstream oss; Describe(oss); |