summaryrefslogtreecommitdiffstats
path: root/runtime/mirror
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-05-19 16:49:03 -0700
committerIan Rogers <irogers@google.com>2014-05-19 22:27:39 -0700
commit700a402244a1a423da4f3ba8032459f4b65fa18f (patch)
tree4c22fcda04d271bd55a37aff30650214af17a90c /runtime/mirror
parent047c11adcbcbc0bcf210defdfcbada763961ffee (diff)
downloadart-700a402244a1a423da4f3ba8032459f4b65fa18f.tar.gz
art-700a402244a1a423da4f3ba8032459f4b65fa18f.tar.bz2
art-700a402244a1a423da4f3ba8032459f4b65fa18f.zip
Now we have a proper C++ library, use std::unique_ptr.
Also remove the Android.libcxx.mk and other bits of stlport compatibility mechanics. Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
Diffstat (limited to 'runtime/mirror')
-rw-r--r--runtime/mirror/art_method-inl.h6
-rw-r--r--runtime/mirror/art_method.h6
-rw-r--r--runtime/mirror/class-inl.h26
-rw-r--r--runtime/mirror/class.h10
-rw-r--r--runtime/mirror/dex_cache.h16
-rw-r--r--runtime/mirror/object_array-inl.h2
-rw-r--r--runtime/mirror/object_test.cc6
-rw-r--r--runtime/mirror/proxy.h10
8 files changed, 41 insertions, 41 deletions
diff --git a/runtime/mirror/art_method-inl.h b/runtime/mirror/art_method-inl.h
index cde977bfd6..b7ca188d78 100644
--- a/runtime/mirror/art_method-inl.h
+++ b/runtime/mirror/art_method-inl.h
@@ -62,17 +62,17 @@ inline uint32_t ArtMethod::GetDexMethodIndex() {
}
inline ObjectArray<String>* ArtMethod::GetDexCacheStrings() {
- return GetFieldObject<ObjectArray<String> >(
+ return GetFieldObject<ObjectArray<String>>(
OFFSET_OF_OBJECT_MEMBER(ArtMethod, dex_cache_strings_));
}
inline ObjectArray<ArtMethod>* ArtMethod::GetDexCacheResolvedMethods() {
- return GetFieldObject<ObjectArray<ArtMethod> >(
+ return GetFieldObject<ObjectArray<ArtMethod>>(
OFFSET_OF_OBJECT_MEMBER(ArtMethod, dex_cache_resolved_methods_));
}
inline ObjectArray<Class>* ArtMethod::GetDexCacheResolvedTypes() {
- return GetFieldObject<ObjectArray<Class> >(
+ return GetFieldObject<ObjectArray<Class>>(
OFFSET_OF_OBJECT_MEMBER(ArtMethod, dex_cache_resolved_types_));
}
diff --git a/runtime/mirror/art_method.h b/runtime/mirror/art_method.h
index 3950a980d5..37f26a20f4 100644
--- a/runtime/mirror/art_method.h
+++ b/runtime/mirror/art_method.h
@@ -407,13 +407,13 @@ class MANAGED ArtMethod : public Object {
HeapReference<Class> declaring_class_;
// Short cuts to declaring_class_->dex_cache_ member for fast compiled code access.
- HeapReference<ObjectArray<ArtMethod> > dex_cache_resolved_methods_;
+ HeapReference<ObjectArray<ArtMethod>> dex_cache_resolved_methods_;
// Short cuts to declaring_class_->dex_cache_ member for fast compiled code access.
- HeapReference<ObjectArray<Class> > dex_cache_resolved_types_;
+ HeapReference<ObjectArray<Class>> dex_cache_resolved_types_;
// Short cuts to declaring_class_->dex_cache_ member for fast compiled code access.
- HeapReference<ObjectArray<String> > dex_cache_strings_;
+ HeapReference<ObjectArray<String>> dex_cache_strings_;
// Method dispatch from the interpreter invokes this pointer which may cause a bridge into
// compiled code.
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index b2d8288828..18be2f18ff 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -64,12 +64,12 @@ inline DexCache* Class::GetDexCache() {
inline ObjectArray<ArtMethod>* Class::GetDirectMethods() {
DCHECK(IsLoaded() || IsErroneous());
- return GetFieldObject<ObjectArray<ArtMethod> >(OFFSET_OF_OBJECT_MEMBER(Class, direct_methods_));
+ return GetFieldObject<ObjectArray<ArtMethod>>(OFFSET_OF_OBJECT_MEMBER(Class, direct_methods_));
}
inline void Class::SetDirectMethods(ObjectArray<ArtMethod>* new_direct_methods)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- DCHECK(NULL == GetFieldObject<ObjectArray<ArtMethod> >(
+ DCHECK(NULL == GetFieldObject<ObjectArray<ArtMethod>>(
OFFSET_OF_OBJECT_MEMBER(Class, direct_methods_)));
DCHECK_NE(0, new_direct_methods->GetLength());
SetFieldObject<false>(OFFSET_OF_OBJECT_MEMBER(Class, direct_methods_), new_direct_methods);
@@ -82,7 +82,7 @@ inline ArtMethod* Class::GetDirectMethod(int32_t i) {
inline void Class::SetDirectMethod(uint32_t i, ArtMethod* f) // TODO: uint16_t
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
ObjectArray<ArtMethod>* direct_methods =
- GetFieldObject<ObjectArray<ArtMethod> >(OFFSET_OF_OBJECT_MEMBER(Class, direct_methods_));
+ GetFieldObject<ObjectArray<ArtMethod>>(OFFSET_OF_OBJECT_MEMBER(Class, direct_methods_));
direct_methods->Set<false>(i, f);
}
@@ -94,7 +94,7 @@ inline uint32_t Class::NumDirectMethods() {
template<VerifyObjectFlags kVerifyFlags>
inline ObjectArray<ArtMethod>* Class::GetVirtualMethods() {
DCHECK(IsLoaded() || IsErroneous());
- return GetFieldObject<ObjectArray<ArtMethod> >(OFFSET_OF_OBJECT_MEMBER(Class, virtual_methods_));
+ return GetFieldObject<ObjectArray<ArtMethod>>(OFFSET_OF_OBJECT_MEMBER(Class, virtual_methods_));
}
inline void Class::SetVirtualMethods(ObjectArray<ArtMethod>* new_virtual_methods) {
@@ -122,18 +122,18 @@ inline ArtMethod* Class::GetVirtualMethodDuringLinking(uint32_t i) {
inline void Class::SetVirtualMethod(uint32_t i, ArtMethod* f) // TODO: uint16_t
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
ObjectArray<ArtMethod>* virtual_methods =
- GetFieldObject<ObjectArray<ArtMethod> >(OFFSET_OF_OBJECT_MEMBER(Class, virtual_methods_));
+ GetFieldObject<ObjectArray<ArtMethod>>(OFFSET_OF_OBJECT_MEMBER(Class, virtual_methods_));
virtual_methods->Set<false>(i, f);
}
inline ObjectArray<ArtMethod>* Class::GetVTable() {
DCHECK(IsResolved() || IsErroneous());
- return GetFieldObject<ObjectArray<ArtMethod> >(OFFSET_OF_OBJECT_MEMBER(Class, vtable_));
+ return GetFieldObject<ObjectArray<ArtMethod>>(OFFSET_OF_OBJECT_MEMBER(Class, vtable_));
}
inline ObjectArray<ArtMethod>* Class::GetVTableDuringLinking() {
DCHECK(IsLoaded() || IsErroneous());
- return GetFieldObject<ObjectArray<ArtMethod> >(OFFSET_OF_OBJECT_MEMBER(Class, vtable_));
+ return GetFieldObject<ObjectArray<ArtMethod>>(OFFSET_OF_OBJECT_MEMBER(Class, vtable_));
}
inline void Class::SetVTable(ObjectArray<ArtMethod>* new_vtable) {
@@ -141,7 +141,7 @@ inline void Class::SetVTable(ObjectArray<ArtMethod>* new_vtable) {
}
inline ObjectArray<ArtMethod>* Class::GetImTable() {
- return GetFieldObject<ObjectArray<ArtMethod> >(OFFSET_OF_OBJECT_MEMBER(Class, imtable_));
+ return GetFieldObject<ObjectArray<ArtMethod>>(OFFSET_OF_OBJECT_MEMBER(Class, imtable_));
}
inline void Class::SetImTable(ObjectArray<ArtMethod>* new_imtable) {
@@ -362,18 +362,18 @@ inline ObjectArray<ArtField>* Class::GetIFields() {
inline void Class::SetIFields(ObjectArray<ArtField>* new_ifields)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- DCHECK(NULL == GetFieldObject<ObjectArray<ArtField> >(OFFSET_OF_OBJECT_MEMBER(Class, ifields_)));
+ DCHECK(NULL == GetFieldObject<ObjectArray<ArtField>>(OFFSET_OF_OBJECT_MEMBER(Class, ifields_)));
SetFieldObject<false>(OFFSET_OF_OBJECT_MEMBER(Class, ifields_), new_ifields);
}
inline ObjectArray<ArtField>* Class::GetSFields() {
DCHECK(IsLoaded() || IsErroneous());
- return GetFieldObject<ObjectArray<ArtField> >(OFFSET_OF_OBJECT_MEMBER(Class, sfields_));
+ return GetFieldObject<ObjectArray<ArtField>>(OFFSET_OF_OBJECT_MEMBER(Class, sfields_));
}
inline void Class::SetSFields(ObjectArray<ArtField>* new_sfields)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- DCHECK(NULL == GetFieldObject<ObjectArray<ArtField> >(OFFSET_OF_OBJECT_MEMBER(Class, sfields_)));
+ DCHECK(NULL == GetFieldObject<ObjectArray<ArtField>>(OFFSET_OF_OBJECT_MEMBER(Class, sfields_)));
SetFieldObject<false>(OFFSET_OF_OBJECT_MEMBER(Class, sfields_), new_sfields);
}
@@ -389,7 +389,7 @@ inline ArtField* Class::GetStaticField(uint32_t i) // TODO: uint16_t
inline void Class::SetStaticField(uint32_t i, ArtField* f) // TODO: uint16_t
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- ObjectArray<ArtField>* sfields= GetFieldObject<ObjectArray<ArtField> >(
+ ObjectArray<ArtField>* sfields= GetFieldObject<ObjectArray<ArtField>>(
OFFSET_OF_OBJECT_MEMBER(Class, sfields_));
sfields->Set<false>(i, f);
}
@@ -405,7 +405,7 @@ inline ArtField* Class::GetInstanceField(uint32_t i) { // TODO: uint16_t
inline void Class::SetInstanceField(uint32_t i, ArtField* f) // TODO: uint16_t
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- ObjectArray<ArtField>* ifields= GetFieldObject<ObjectArray<ArtField> >(
+ ObjectArray<ArtField>* ifields= GetFieldObject<ObjectArray<ArtField>>(
OFFSET_OF_OBJECT_MEMBER(Class, ifields_));
ifields->Set<false>(i, f);
}
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index a283f601af..d8cbb32e73 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -904,7 +904,7 @@ class MANAGED Class : public Object {
HeapReference<DexCache> dex_cache_;
// static, private, and <init> methods
- HeapReference<ObjectArray<ArtMethod> > direct_methods_;
+ HeapReference<ObjectArray<ArtMethod>> direct_methods_;
// instance fields
//
@@ -916,7 +916,7 @@ class MANAGED Class : public Object {
// All instance fields that refer to objects are guaranteed to be at
// the beginning of the field list. num_reference_instance_fields_
// specifies the number of reference fields.
- HeapReference<ObjectArray<ArtField> > ifields_;
+ HeapReference<ObjectArray<ArtField>> ifields_;
// The interface table (iftable_) contains pairs of a interface class and an array of the
// interface methods. There is one pair per interface supported by this class. That means one
@@ -932,7 +932,7 @@ class MANAGED Class : public Object {
HeapReference<IfTable> iftable_;
// Interface method table (imt), for quick "invoke-interface".
- HeapReference<ObjectArray<ArtMethod> > imtable_;
+ HeapReference<ObjectArray<ArtMethod>> imtable_;
// Descriptor for the class such as "java.lang.Class" or "[C". Lazily initialized by ComputeName
HeapReference<String> name_;
@@ -947,13 +947,13 @@ class MANAGED Class : public Object {
HeapReference<Class> verify_error_class_;
// Virtual methods defined in this class; invoked through vtable.
- HeapReference<ObjectArray<ArtMethod> > virtual_methods_;
+ HeapReference<ObjectArray<ArtMethod>> virtual_methods_;
// Virtual method table (vtable), for use by "invoke-virtual". The vtable from the superclass is
// copied in, and virtual methods from our class either replace those from the super or are
// appended. For abstract classes, methods may be created in the vtable that aren't in
// virtual_ methods_ for miranda methods.
- HeapReference<ObjectArray<ArtMethod> > vtable_;
+ HeapReference<ObjectArray<ArtMethod>> vtable_;
// Access flags; low 16 bits are defined by VM spec.
uint32_t access_flags_;
diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h
index 11a40023e1..65a50260f9 100644
--- a/runtime/mirror/dex_cache.h
+++ b/runtime/mirror/dex_cache.h
@@ -123,22 +123,22 @@ class MANAGED DexCache : public Object {
}
ObjectArray<String>* GetStrings() ALWAYS_INLINE SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return GetFieldObject< ObjectArray<String> >(StringsOffset());
+ return GetFieldObject< ObjectArray<String>>(StringsOffset());
}
ObjectArray<Class>* GetResolvedTypes() ALWAYS_INLINE SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return GetFieldObject<ObjectArray<Class> >(
+ return GetFieldObject<ObjectArray<Class>>(
OFFSET_OF_OBJECT_MEMBER(DexCache, resolved_types_));
}
ObjectArray<ArtMethod>* GetResolvedMethods() ALWAYS_INLINE
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return GetFieldObject< ObjectArray<ArtMethod> >(ResolvedMethodsOffset());
+ return GetFieldObject< ObjectArray<ArtMethod>>(ResolvedMethodsOffset());
}
ObjectArray<ArtField>* GetResolvedFields() ALWAYS_INLINE
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return GetFieldObject<ObjectArray<ArtField> >(ResolvedFieldsOffset());
+ return GetFieldObject<ObjectArray<ArtField>>(ResolvedFieldsOffset());
}
const DexFile* GetDexFile() ALWAYS_INLINE SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
@@ -153,10 +153,10 @@ class MANAGED DexCache : public Object {
private:
HeapReference<Object> dex_;
HeapReference<String> location_;
- HeapReference<ObjectArray<ArtField> > resolved_fields_;
- HeapReference<ObjectArray<ArtMethod> > resolved_methods_;
- HeapReference<ObjectArray<Class> > resolved_types_;
- HeapReference<ObjectArray<String> > strings_;
+ HeapReference<ObjectArray<ArtField>> resolved_fields_;
+ HeapReference<ObjectArray<ArtMethod>> resolved_methods_;
+ HeapReference<ObjectArray<Class>> resolved_types_;
+ HeapReference<ObjectArray<String>> strings_;
uint64_t dex_file_;
friend struct art::DexCacheOffsets; // for verifying offset information
diff --git a/runtime/mirror/object_array-inl.h b/runtime/mirror/object_array-inl.h
index 942a2713d2..9b6e90159b 100644
--- a/runtime/mirror/object_array-inl.h
+++ b/runtime/mirror/object_array-inl.h
@@ -245,7 +245,7 @@ inline ObjectArray<T>* ObjectArray<T>::CopyOf(Thread* self, int32_t new_length)
DCHECK_GE(new_length, 0);
// We may get copied by a compacting GC.
StackHandleScope<1> hs(self);
- Handle<ObjectArray<T> > h_this(hs.NewHandle(this));
+ Handle<ObjectArray<T>> h_this(hs.NewHandle(this));
gc::Heap* heap = Runtime::Current()->GetHeap();
gc::AllocatorType allocator_type = heap->IsMovableObject(this) ? heap->GetCurrentAllocator() :
heap->GetCurrentNonMovingAllocator();
diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc
index e24602abec..18e50ce013 100644
--- a/runtime/mirror/object_test.cc
+++ b/runtime/mirror/object_test.cc
@@ -18,6 +18,7 @@
#include <stdint.h>
#include <stdio.h>
+#include <memory>
#include "array-inl.h"
#include "art_field-inl.h"
@@ -36,7 +37,6 @@
#include "object_array-inl.h"
#include "handle_scope-inl.h"
#include "string-inl.h"
-#include "UniquePtrCompat.h"
namespace art {
namespace mirror {
@@ -48,7 +48,7 @@ class ObjectTest : public CommonRuntimeTest {
const char* utf16_expected_le,
int32_t expected_hash)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- UniquePtr<uint16_t[]> utf16_expected(new uint16_t[expected_utf16_length]);
+ std::unique_ptr<uint16_t[]> utf16_expected(new uint16_t[expected_utf16_length]);
for (int32_t i = 0; i < expected_utf16_length; i++) {
uint16_t ch = (((utf16_expected_le[i*2 + 0] & 0xff) << 8) |
((utf16_expected_le[i*2 + 1] & 0xff) << 0));
@@ -116,7 +116,7 @@ TEST_F(ObjectTest, Clone) {
TEST_F(ObjectTest, AllocObjectArray) {
ScopedObjectAccess soa(Thread::Current());
StackHandleScope<2> hs(soa.Self());
- Handle<ObjectArray<Object> > oa(
+ Handle<ObjectArray<Object>> oa(
hs.NewHandle(class_linker_->AllocObjectArray<Object>(soa.Self(), 2)));
EXPECT_EQ(2, oa->GetLength());
EXPECT_TRUE(oa->Get(0) == NULL);
diff --git a/runtime/mirror/proxy.h b/runtime/mirror/proxy.h
index 5f9cceb164..6e4947ebf8 100644
--- a/runtime/mirror/proxy.h
+++ b/runtime/mirror/proxy.h
@@ -30,18 +30,18 @@ namespace mirror {
class MANAGED SynthesizedProxyClass : public Class {
public:
ObjectArray<Class>* GetInterfaces() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return GetFieldObject<ObjectArray<Class> >(OFFSET_OF_OBJECT_MEMBER(SynthesizedProxyClass,
+ return GetFieldObject<ObjectArray<Class>>(OFFSET_OF_OBJECT_MEMBER(SynthesizedProxyClass,
interfaces_));
}
- ObjectArray<ObjectArray<Class> >* GetThrows() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return GetFieldObject<ObjectArray<ObjectArray<Class> > >(OFFSET_OF_OBJECT_MEMBER(SynthesizedProxyClass,
+ ObjectArray<ObjectArray<Class>>* GetThrows() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ return GetFieldObject<ObjectArray<ObjectArray<Class>>>(OFFSET_OF_OBJECT_MEMBER(SynthesizedProxyClass,
throws_));
}
private:
- HeapReference<ObjectArray<Class> > interfaces_;
- HeapReference<ObjectArray<ObjectArray<Class> > > throws_;
+ HeapReference<ObjectArray<Class>> interfaces_;
+ HeapReference<ObjectArray<ObjectArray<Class>>> throws_;
DISALLOW_IMPLICIT_CONSTRUCTORS(SynthesizedProxyClass);
};