Rename ObjPtr::Decode to ObjPtr::Ptr
Done to prevent ambiguity with ScopedObjectAccess::Decode.
Bug: 31113334
Test: test-art-host
Change-Id: I07a2497cc9cf66386311798933547471987fc316
diff --git a/benchmark/jobject-benchmark/jobject_benchmark.cc b/benchmark/jobject-benchmark/jobject_benchmark.cc
index 4b2c024..de43f73 100644
--- a/benchmark/jobject-benchmark/jobject_benchmark.cc
+++ b/benchmark/jobject-benchmark/jobject_benchmark.cc
@@ -29,7 +29,7 @@
ObjPtr<mirror::Object> obj = soa.Decode<mirror::Object>(jobj);
CHECK(obj != nullptr);
for (jint i = 0; i < reps; ++i) {
- jobject ref = soa.Env()->AddLocalReference<jobject>(obj.Decode());
+ jobject ref = soa.Env()->AddLocalReference<jobject>(obj.Ptr());
soa.Env()->DeleteLocalRef(ref);
}
}
@@ -39,7 +39,7 @@
ScopedObjectAccess soa(env);
ObjPtr<mirror::Object> obj = soa.Decode<mirror::Object>(jobj);
CHECK(obj != nullptr);
- jobject ref = soa.Env()->AddLocalReference<jobject>(obj.Decode());
+ jobject ref = soa.Env()->AddLocalReference<jobject>(obj.Ptr());
for (jint i = 0; i < reps; ++i) {
CHECK_EQ(soa.Decode<mirror::Object>(ref), obj);
}
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h
index 9efd636..d807fca 100644
--- a/compiler/driver/compiler_driver-inl.h
+++ b/compiler/driver/compiler_driver-inl.h
@@ -33,7 +33,7 @@
inline mirror::ClassLoader* CompilerDriver::GetClassLoader(const ScopedObjectAccess& soa,
const DexCompilationUnit* mUnit) {
- return soa.Decode<mirror::ClassLoader>(mUnit->GetClassLoader()).Decode();
+ return soa.Decode<mirror::ClassLoader>(mUnit->GetClassLoader()).Ptr();
}
inline mirror::Class* CompilerDriver::ResolveClass(
@@ -98,7 +98,7 @@
DCHECK(!resolved_field->IsStatic());
ObjPtr<mirror::Class> fields_class = resolved_field->GetDeclaringClass();
bool fast_get = referrer_class != nullptr &&
- referrer_class->CanAccessResolvedField(fields_class.Decode(),
+ referrer_class->CanAccessResolvedField(fields_class.Ptr(),
resolved_field,
dex_cache,
field_idx);
@@ -150,7 +150,7 @@
return std::make_pair(true, true);
}
if (CanAccessResolvedMember<ArtMember>(
- referrer_class, members_class.Decode(), resolved_member, dex_cache, member_idx)) {
+ referrer_class, members_class.Ptr(), resolved_member, dex_cache, member_idx)) {
// We have the resolved member, we must make it into a index for the referrer
// in its static storage (which may fail if it doesn't have a slot for it)
// TODO: for images we can elide the static storage base null check
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 210943c..66938b2 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -908,7 +908,7 @@
ArtField** resolved_fields = dex_cache->GetResolvedFields();
for (size_t i = 0; i < dex_cache->NumResolvedFields(); i++) {
ArtField* field = mirror::DexCache::GetElementPtrSize(resolved_fields, i, target_ptr_size_);
- if (field != nullptr && !KeepClass(field->GetDeclaringClass().Decode())) {
+ if (field != nullptr && !KeepClass(field->GetDeclaringClass().Ptr())) {
dex_cache->SetResolvedField(i, nullptr, target_ptr_size_);
}
}
@@ -1742,7 +1742,7 @@
case kNativeObjectRelocationTypeArtField: {
memcpy(dest, pair.first, sizeof(ArtField));
reinterpret_cast<ArtField*>(dest)->SetDeclaringClass(
- GetImageAddress(reinterpret_cast<ArtField*>(pair.first)->GetDeclaringClass().Decode()));
+ GetImageAddress(reinterpret_cast<ArtField*>(pair.first)->GetDeclaringClass().Ptr()));
break;
}
case kNativeObjectRelocationTypeRuntimeMethod:
diff --git a/compiler/jni/jni_compiler_test.cc b/compiler/jni/jni_compiler_test.cc
index 19d55a3..dca290c 100644
--- a/compiler/jni/jni_compiler_test.cc
+++ b/compiler/jni/jni_compiler_test.cc
@@ -1283,7 +1283,7 @@
Thread* self = Thread::Current();
ScopedObjectAccess soa(self);
- EXPECT_TRUE(self->HoldsLock(soa.Decode<mirror::Object>(thisObj).Decode()));
+ EXPECT_TRUE(self->HoldsLock(soa.Decode<mirror::Object>(thisObj).Ptr()));
return nullptr;
}
diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc
index e8bc67d..9f352ce 100644
--- a/compiler/oat_test.cc
+++ b/compiler/oat_test.cc
@@ -498,7 +498,7 @@
for (const DexFile* dex_file : dex_files) {
ScopedObjectAccess soa(Thread::Current());
class_linker->RegisterDexFile(*dex_file,
- soa.Decode<mirror::ClassLoader>(class_loader).Decode());
+ soa.Decode<mirror::ClassLoader>(class_loader).Ptr());
}
compiler_driver_->SetDexFilesForOatFile(dex_files);
compiler_driver_->CompileAll(class_loader, dex_files, &timings);
diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc
index 15cebfe..45a3ce4 100644
--- a/compiler/optimizing/reference_type_propagation.cc
+++ b/compiler/optimizing/reference_type_propagation.cc
@@ -454,7 +454,7 @@
}
instr->SetReferenceTypeInfo(
ReferenceTypeInfo::Create(handle_cache_->GetStringClassHandle(), /* is_exact */ true));
- } else if (IsAdmissible(klass.Decode())) {
+ } else if (IsAdmissible(klass.Ptr())) {
ReferenceTypeInfo::TypeHandle handle = handle_cache_->NewHandle(klass);
is_exact = is_exact || handle->CannotBeAssignedFromOtherTypes();
instr->SetReferenceTypeInfo(ReferenceTypeInfo::Create(handle, is_exact));
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 1ddf961..59c4681 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1566,7 +1566,7 @@
ScopedObjectAccess soa(self);
dex_caches_.push_back(soa.AddLocalReference<jobject>(
class_linker->RegisterDexFile(*dex_file,
- soa.Decode<mirror::ClassLoader>(class_loader_).Decode())));
+ soa.Decode<mirror::ClassLoader>(class_loader_).Ptr())));
}
return true;
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index 4d0dc56..a5dc593 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -1702,7 +1702,7 @@
mirror::Class* klass = value->AsClass();
os << StringPrintf("%p Class: %s\n", klass, PrettyDescriptor(klass).c_str());
} else {
- os << StringPrintf("%p %s\n", value.Decode(), PrettyDescriptor(type).c_str());
+ os << StringPrintf("%p %s\n", value.Ptr(), PrettyDescriptor(type).c_str());
}
}
@@ -1748,7 +1748,7 @@
PrettyObjectValue(os, field_type, value);
} else {
os << StringPrintf("%p %s\n",
- value.Decode(),
+ value.Ptr(),
PrettyDescriptor(field->GetTypeDescriptor()).c_str());
}
}
diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc
index b259f64..f3eb663 100644
--- a/patchoat/patchoat.cc
+++ b/patchoat/patchoat.cc
@@ -505,7 +505,7 @@
void Visit(ArtField* field) OVERRIDE REQUIRES_SHARED(Locks::mutator_lock_) {
ArtField* const dest = patch_oat_->RelocatedCopyOf(field);
dest->SetDeclaringClass(
- patch_oat_->RelocatedAddressOfPointer(field->GetDeclaringClass().Decode()));
+ patch_oat_->RelocatedAddressOfPointer(field->GetDeclaringClass().Ptr()));
}
private:
diff --git a/runtime/art_field-inl.h b/runtime/art_field-inl.h
index a52c714..3b24aab 100644
--- a/runtime/art_field-inl.h
+++ b/runtime/art_field-inl.h
@@ -116,9 +116,9 @@
DCHECK(object != nullptr) << PrettyField(this);
DCHECK(!IsStatic() || (object == GetDeclaringClass()) || !Runtime::Current()->IsStarted());
if (UNLIKELY(IsVolatile())) {
- object->SetFieldObjectVolatile<kTransactionActive>(GetOffset(), new_value.Decode());
+ object->SetFieldObjectVolatile<kTransactionActive>(GetOffset(), new_value.Ptr());
} else {
- object->SetFieldObject<kTransactionActive>(GetOffset(), new_value.Decode());
+ object->SetFieldObject<kTransactionActive>(GetOffset(), new_value.Ptr());
}
}
@@ -339,7 +339,7 @@
template <typename Visitor>
inline void ArtField::UpdateObjects(const Visitor& visitor) {
ObjPtr<mirror::Class> old_class = DeclaringClassRoot().Read<kWithoutReadBarrier>();
- ObjPtr<mirror::Class> new_class = visitor(old_class.Decode());
+ ObjPtr<mirror::Class> new_class = visitor(old_class.Ptr());
if (old_class != new_class) {
SetDeclaringClass(new_class);
}
diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc
index c671b81..4dc7b31 100644
--- a/runtime/check_jni.cc
+++ b/runtime/check_jni.cc
@@ -608,7 +608,7 @@
ObjPtr<mirror::Object> obj = soa.Decode<mirror::Object>(jobj);
if (!obj->GetClass()->IsThrowableClass()) {
AbortF("expected java.lang.Throwable but got object of type "
- "%s: %p", PrettyTypeOf(obj).c_str(), obj.Decode());
+ "%s: %p", PrettyTypeOf(obj).c_str(), obj.Ptr());
return false;
}
return true;
@@ -619,7 +619,7 @@
ObjPtr<mirror::Class> c = soa.Decode<mirror::Class>(jc);
if (!c->IsThrowableClass()) {
AbortF("expected java.lang.Throwable class but got object of "
- "type %s: %p", PrettyDescriptor(c).c_str(), c.Decode());
+ "type %s: %p", PrettyDescriptor(c).c_str(), c.Ptr());
return false;
}
return true;
@@ -649,7 +649,7 @@
REQUIRES_SHARED(Locks::mutator_lock_) {
ObjPtr<mirror::Class> c = soa.Decode<mirror::Class>(jc);
if (!c->IsInstantiableNonArray()) {
- AbortF("can't make objects of type %s: %p", PrettyDescriptor(c).c_str(), c.Decode());
+ AbortF("can't make objects of type %s: %p", PrettyDescriptor(c).c_str(), c.Ptr());
return false;
}
return true;
@@ -772,12 +772,12 @@
okay = false;
} else {
obj = soa.Vm()->DecodeWeakGlobal(soa.Self(), ref);
- okay = Runtime::Current()->IsClearedJniWeakGlobal(obj.Decode());
+ okay = Runtime::Current()->IsClearedJniWeakGlobal(obj.Ptr());
}
if (!okay) {
AbortF("%s is an invalid %s: %p (%p)",
what, ToStr<IndirectRefKind>(GetIndirectRefKind(java_object)).c_str(),
- java_object, obj.Decode());
+ java_object, obj.Ptr());
return false;
}
}
@@ -786,7 +786,7 @@
Runtime::Current()->GetHeap()->DumpSpaces(LOG_STREAM(ERROR));
AbortF("%s is an invalid %s: %p (%p)",
what, ToStr<IndirectRefKind>(GetIndirectRefKind(java_object)).c_str(),
- java_object, obj.Decode());
+ java_object, obj.Ptr());
return false;
}
@@ -1112,7 +1112,7 @@
Runtime::Current()->GetHeap()->DumpSpaces(LOG_STREAM(ERROR));
AbortF("jarray is an invalid %s: %p (%p)",
ToStr<IndirectRefKind>(GetIndirectRefKind(java_array)).c_str(),
- java_array, a.Decode());
+ java_array, a.Ptr());
return false;
} else if (!a->IsArrayInstance()) {
AbortF("jarray argument has non-array type: %s", PrettyTypeOf(a).c_str());
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 0d3c012..d67e111 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1152,7 +1152,7 @@
*error_msg = StringPrintf("Null name for dex element at index %d", i);
return false;
}
- out_dex_file_names->push_front(name.Decode());
+ out_dex_file_names->push_front(name.Ptr());
}
}
}
@@ -2545,7 +2545,7 @@
return nullptr;
} else {
// success, return mirror::Class*
- return soa.Decode<mirror::Class>(result.get()).Decode();
+ return soa.Decode<mirror::Class>(result.get()).Ptr();
}
}
UNREACHABLE();
@@ -4268,9 +4268,9 @@
// Set the class access flags incl. VerificationAttempted, so we do not try to set the flag on
// the methods.
klass->SetAccessFlags(kAccClassIsProxy | kAccPublic | kAccFinal | kAccVerificationAttempted);
- klass->SetClassLoader(soa.Decode<mirror::ClassLoader>(loader).Decode());
+ klass->SetClassLoader(soa.Decode<mirror::ClassLoader>(loader).Ptr());
DCHECK_EQ(klass->GetPrimitiveType(), Primitive::kPrimNot);
- klass->SetName(soa.Decode<mirror::String>(name).Decode());
+ klass->SetName(soa.Decode<mirror::String>(name).Ptr());
klass->SetDexCache(GetClassRoot(kJavaLangReflectProxy)->GetDexCache());
mirror::Class::SetStatus(klass, mirror::Class::kStatusIdx, self);
std::string descriptor(GetDescriptorForProxy(klass.Get()));
@@ -4363,11 +4363,11 @@
CHECK_EQ(interfaces_sfield.GetDeclaringClass(), klass.Get());
interfaces_sfield.SetObject<false>(
klass.Get(),
- soa.Decode<mirror::ObjectArray<mirror::Class>>(interfaces).Decode());
+ soa.Decode<mirror::ObjectArray<mirror::Class>>(interfaces).Ptr());
CHECK_EQ(throws_sfield.GetDeclaringClass(), klass.Get());
throws_sfield.SetObject<false>(
klass.Get(),
- soa.Decode<mirror::ObjectArray<mirror::ObjectArray<mirror::Class>>>(throws).Decode());
+ soa.Decode<mirror::ObjectArray<mirror::ObjectArray<mirror::Class>>>(throws).Ptr());
{
// Lock on klass is released. Lock new class object.
@@ -4397,9 +4397,9 @@
CHECK_EQ(PrettyField(klass->GetStaticField(1)), throws_field_name);
CHECK_EQ(klass.Get()->GetInterfaces(),
- soa.Decode<mirror::ObjectArray<mirror::Class>>(interfaces).Decode());
+ soa.Decode<mirror::ObjectArray<mirror::Class>>(interfaces).Ptr());
CHECK_EQ(klass.Get()->GetThrows(),
- soa.Decode<mirror::ObjectArray<mirror::ObjectArray<mirror::Class>>>(throws).Decode());
+ soa.Decode<mirror::ObjectArray<mirror::ObjectArray<mirror::Class>>>(throws).Ptr());
}
return klass.Get();
}
@@ -7655,7 +7655,7 @@
DCHECK(self != nullptr);
const size_t hash = ComputeModifiedUtf8Hash(descriptor);
// Find the class in the loaded classes table.
- type = LookupClass(self, descriptor, hash, class_loader.Decode());
+ type = LookupClass(self, descriptor, hash, class_loader.Ptr());
}
}
if (type != nullptr || type->IsResolved()) {
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 4a926e7..5466539 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -875,7 +875,7 @@
uint32_t type_idx = klass->GetClassDef()->class_idx_;
ObjPtr<mirror::DexCache> dex_cache = klass->GetDexCache();
const DexFile& dex_file = klass->GetDexFile();
- EXPECT_EQ(dex_cache->GetResolvedType(type_idx), klass.Decode());
+ EXPECT_EQ(dex_cache->GetResolvedType(type_idx), klass.Ptr());
EXPECT_OBJ_PTR_EQ(
class_linker_->LookupResolvedType(dex_file, type_idx, dex_cache, class_loader.Get()),
klass);
diff --git a/runtime/common_runtime_test.cc b/runtime/common_runtime_test.cc
index ea07195..84752f0 100644
--- a/runtime/common_runtime_test.cc
+++ b/runtime/common_runtime_test.cc
@@ -514,9 +514,9 @@
soa.Decode<mirror::ClassLoader>(jclass_loader));
DCHECK_EQ(class_loader->GetClass(),
- soa.Decode<mirror::Class>(WellKnownClasses::dalvik_system_PathClassLoader).Decode());
+ soa.Decode<mirror::Class>(WellKnownClasses::dalvik_system_PathClassLoader).Ptr());
DCHECK_EQ(class_loader->GetParent()->GetClass(),
- soa.Decode<mirror::Class>(WellKnownClasses::java_lang_BootClassLoader).Decode());
+ soa.Decode<mirror::Class>(WellKnownClasses::java_lang_BootClassLoader).Ptr());
// The class loader is a PathClassLoader which inherits from BaseDexClassLoader.
// We need to get the DexPathList and loop through it.
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index 2158d81..92934c6 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -32,10 +32,10 @@
namespace art {
// OBJ pointer helpers to avoid needing .Decode everywhere.
-#define EXPECT_OBJ_PTR_EQ(a, b) EXPECT_EQ(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
-#define ASSERT_OBJ_PTR_EQ(a, b) ASSERT_EQ(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
-#define EXPECT_OBJ_PTR_NE(a, b) EXPECT_NE(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
-#define ASSERT_OBJ_PTR_NE(a, b) ASSERT_NE(MakeObjPtr(a).Decode(), MakeObjPtr(b).Decode());
+#define EXPECT_OBJ_PTR_EQ(a, b) EXPECT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr());
+#define ASSERT_OBJ_PTR_EQ(a, b) ASSERT_EQ(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr());
+#define EXPECT_OBJ_PTR_NE(a, b) EXPECT_NE(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr());
+#define ASSERT_OBJ_PTR_NE(a, b) ASSERT_NE(MakeObjPtr(a).Ptr(), MakeObjPtr(b).Ptr());
class ClassLinker;
class CompilerCallbacks;
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 1bdb0fc..a7feeef 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -1743,7 +1743,7 @@
return field_value;
case Primitive::kPrimNot:
- field_value.SetL(f->GetObject(o).Decode());
+ field_value.SetL(f->GetObject(o).Ptr());
return field_value;
case Primitive::kPrimVoid:
diff --git a/runtime/dex_file_annotations.cc b/runtime/dex_file_annotations.cc
index feb75a8..367603e 100644
--- a/runtime/dex_file_annotations.cc
+++ b/runtime/dex_file_annotations.cc
@@ -255,7 +255,7 @@
}
mirror::Class* annotation_member_class =
- soa.Decode<mirror::Class>(WellKnownClasses::libcore_reflect_AnnotationMember).Decode();
+ soa.Decode<mirror::Class>(WellKnownClasses::libcore_reflect_AnnotationMember).Ptr();
mirror::Class* annotation_member_array_class =
class_linker->FindArrayClass(self, &annotation_member_class);
if (annotation_member_array_class == nullptr) {
@@ -572,12 +572,12 @@
*annotation_ptr = annotation;
if (result_style == DexFile::kAllObjects && primitive_type != Primitive::kPrimVoid) {
- element_object = BoxPrimitive(primitive_type, annotation_value->value_).Decode();
+ element_object = BoxPrimitive(primitive_type, annotation_value->value_).Ptr();
set_object = true;
}
if (set_object) {
- annotation_value->value_.SetL(element_object.Decode());
+ annotation_value->value_.SetL(element_object.Ptr());
}
return true;
@@ -840,7 +840,7 @@
ScopedObjectAccessUnchecked soa(self);
StackHandleScope<1> hs(self);
mirror::Class* annotation_array_class =
- soa.Decode<mirror::Class>(WellKnownClasses::java_lang_annotation_Annotation__array).Decode();
+ soa.Decode<mirror::Class>(WellKnownClasses::java_lang_annotation_Annotation__array).Ptr();
mirror::Class* annotation_array_array_class =
Runtime::Current()->GetClassLinker()->FindArrayClass(self, &annotation_array_class);
if (annotation_array_array_class == nullptr) {
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc
index 38ee468..f8deb8f 100644
--- a/runtime/entrypoints/entrypoint_utils.cc
+++ b/runtime/entrypoints/entrypoint_utils.cc
@@ -160,7 +160,7 @@
} else {
JValue jv;
jv.SetJ(args.at(i).j);
- mirror::Object* val = BoxPrimitive(Primitive::GetType(shorty[i + 1]), jv).Decode();
+ mirror::Object* val = BoxPrimitive(Primitive::GetType(shorty[i + 1]), jv).Ptr();
if (val == nullptr) {
CHECK(soa.Self()->IsExceptionPending());
return zero;
@@ -193,7 +193,7 @@
mirror::Class* result_type = interface_method->GetReturnType(true /* resolve */, pointer_size);
ObjPtr<mirror::Object> result_ref = soa.Decode<mirror::Object>(result);
JValue result_unboxed;
- if (!UnboxPrimitiveForResult(result_ref.Decode(), result_type, &result_unboxed)) {
+ if (!UnboxPrimitiveForResult(result_ref.Ptr(), result_type, &result_unboxed)) {
DCHECK(soa.Self()->IsExceptionPending());
return zero;
}
diff --git a/runtime/entrypoints/quick/quick_field_entrypoints.cc b/runtime/entrypoints/quick/quick_field_entrypoints.cc
index 70eb1de..6d17000 100644
--- a/runtime/entrypoints/quick/quick_field_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_field_entrypoints.cc
@@ -151,14 +151,14 @@
StaticObjectRead,
sizeof(mirror::HeapReference<mirror::Object>));
if (LIKELY(field != nullptr)) {
- return field->GetObj(field->GetDeclaringClass()).Decode();
+ return field->GetObj(field->GetDeclaringClass()).Ptr();
}
field = FindFieldFromCode<StaticObjectRead, true>(field_idx,
referrer,
self,
sizeof(mirror::HeapReference<mirror::Object>));
if (LIKELY(field != nullptr)) {
- return field->GetObj(field->GetDeclaringClass()).Decode();
+ return field->GetObj(field->GetDeclaringClass()).Ptr();
}
return nullptr; // Will throw exception by checking with Thread::Current.
}
@@ -299,7 +299,7 @@
InstanceObjectRead,
sizeof(mirror::HeapReference<mirror::Object>));
if (LIKELY(field != nullptr && obj != nullptr)) {
- return field->GetObj(obj).Decode();
+ return field->GetObj(obj).Ptr();
}
field = FindInstanceField<InstanceObjectRead, true>(field_idx,
referrer,
@@ -307,7 +307,7 @@
sizeof(mirror::HeapReference<mirror::Object>),
&obj);
if (LIKELY(field != nullptr)) {
- return field->GetObj(obj).Decode();
+ return field->GetObj(obj).Ptr();
}
return nullptr; // Will throw exception by checking with Thread::Current.
}
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index c52bc8e..81513ee 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -834,7 +834,7 @@
void BuildQuickArgumentVisitor::FixupReferences() {
// Fixup any references which may have changed.
for (const auto& pair : references_) {
- pair.second->Assign(soa_->Decode<mirror::Object>(pair.first).Decode());
+ pair.second->Assign(soa_->Decode<mirror::Object>(pair.first).Ptr());
soa_->Env()->DeleteLocalRef(pair.first);
}
}
@@ -926,7 +926,7 @@
void RememberForGcArgumentVisitor::FixupReferences() {
// Fixup any references which may have changed.
for (const auto& pair : references_) {
- pair.second->Assign(soa_->Decode<mirror::Object>(pair.first).Decode());
+ pair.second->Assign(soa_->Decode<mirror::Object>(pair.first).Ptr());
soa_->Env()->DeleteLocalRef(pair.first);
}
}
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 88e4624..01ad8d0 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1514,8 +1514,8 @@
if (obj == nullptr) {
return true;
}
- return IsAligned<kObjectAlignment>(obj.Decode()) &&
- FindSpaceFromObject(obj.Decode(), true) != nullptr;
+ return IsAligned<kObjectAlignment>(obj.Ptr()) &&
+ FindSpaceFromObject(obj.Ptr(), true) != nullptr;
}
bool Heap::IsNonDiscontinuousSpaceHeapAddress(const mirror::Object* obj) const {
@@ -3569,7 +3569,7 @@
bool Heap::IsMovableObject(ObjPtr<mirror::Object> obj) const {
if (kMovingCollector) {
- space::Space* space = FindContinuousSpaceFromObject(obj.Decode(), true);
+ space::Space* space = FindContinuousSpaceFromObject(obj.Ptr(), true);
if (space != nullptr) {
// TODO: Check large object?
return space->CanMoveObjects();
@@ -3729,7 +3729,7 @@
args[0].l = arg.get();
InvokeWithJValues(soa, nullptr, WellKnownClasses::java_lang_ref_FinalizerReference_add, args);
// Restore object in case it gets moved.
- *object = soa.Decode<mirror::Object>(arg.get()).Decode();
+ *object = soa.Decode<mirror::Object>(arg.get()).Ptr();
}
void Heap::RequestConcurrentGCAndSaveObject(Thread* self, bool force_full, mirror::Object** obj) {
diff --git a/runtime/gc_root-inl.h b/runtime/gc_root-inl.h
index 11ccd33..390ed3c 100644
--- a/runtime/gc_root-inl.h
+++ b/runtime/gc_root-inl.h
@@ -39,7 +39,7 @@
template<class MirrorType>
inline GcRoot<MirrorType>::GcRoot(ObjPtr<MirrorType, kIsDebugBuild> ref)
- : GcRoot(ref.Decode()) { }
+ : GcRoot(ref.Ptr()) { }
inline std::string RootInfo::ToString() const {
std::ostringstream oss;
diff --git a/runtime/handle.h b/runtime/handle.h
index c41010a..d33d4a6 100644
--- a/runtime/handle.h
+++ b/runtime/handle.h
@@ -134,7 +134,7 @@
ALWAYS_INLINE T* Assign(ObjPtr<T> reference) REQUIRES_SHARED(Locks::mutator_lock_) {
StackReference<mirror::Object>* ref = Handle<T>::GetReference();
T* old = down_cast<T*>(ref->AsMirrorPtr());
- ref->Assign(reference.Decode());
+ ref->Assign(reference.Ptr());
return old;
}
diff --git a/runtime/handle_scope-inl.h b/runtime/handle_scope-inl.h
index 1814746..cceb007 100644
--- a/runtime/handle_scope-inl.h
+++ b/runtime/handle_scope-inl.h
@@ -111,7 +111,7 @@
template<size_t kNumReferences> template<class MirrorType, bool kPoison>
inline MutableHandle<MirrorType> StackHandleScope<kNumReferences>::NewHandle(
ObjPtr<MirrorType, kPoison> object) {
- return NewHandle(object.Decode());
+ return NewHandle(object.Ptr());
}
template<size_t kNumReferences> template<class T>
@@ -138,7 +138,7 @@
template<class MirrorType, bool kPoison>
inline MutableHandle<MirrorType> StackHandleScopeCollection::NewHandle(
ObjPtr<MirrorType, kPoison> ptr) {
- return NewHandle(ptr.Decode());
+ return NewHandle(ptr.Ptr());
}
} // namespace art
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index c270df7..d283a50 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -51,7 +51,7 @@
ScopedThreadStateChange tsc(self, kNative);
jresult = fn(soa.Env(), klass.get());
}
- result->SetL(soa.Decode<Object>(jresult).Decode());
+ result->SetL(soa.Decode<Object>(jresult).Ptr());
} else if (shorty == "V") {
typedef void (fntype)(JNIEnv*, jclass);
fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
@@ -93,7 +93,7 @@
ScopedThreadStateChange tsc(self, kNative);
jresult = fn(soa.Env(), klass.get(), arg0.get());
}
- result->SetL(soa.Decode<Object>(jresult).Decode());
+ result->SetL(soa.Decode<Object>(jresult).Ptr());
} else if (shorty == "IIZ") {
typedef jint (fntype)(JNIEnv*, jclass, jint, jboolean);
fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
@@ -191,7 +191,7 @@
ScopedThreadStateChange tsc(self, kNative);
jresult = fn(soa.Env(), rcvr.get());
}
- result->SetL(soa.Decode<Object>(jresult).Decode());
+ result->SetL(soa.Decode<Object>(jresult).Ptr());
} else if (shorty == "V") {
typedef void (fntype)(JNIEnv*, jobject);
fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni());
@@ -212,7 +212,7 @@
ScopedThreadStateChange tsc(self, kNative);
jresult = fn(soa.Env(), rcvr.get(), arg0.get());
}
- result->SetL(soa.Decode<Object>(jresult).Decode());
+ result->SetL(soa.Decode<Object>(jresult).Ptr());
ScopedThreadStateChange tsc(self, kNative);
} else if (shorty == "III") {
typedef jint (fntype)(JNIEnv*, jobject, jint, jint);
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 7a6162c..e677cfb 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -68,7 +68,7 @@
this_object = obj;
}
instrumentation->FieldReadEvent(self,
- this_object.Decode(),
+ this_object.Ptr(),
shadow_frame.GetMethod(),
shadow_frame.GetDexPC(),
f);
@@ -94,7 +94,7 @@
shadow_frame.SetVRegLong(vregA, f->GetLong(obj));
break;
case Primitive::kPrimNot:
- shadow_frame.SetVRegReference(vregA, f->GetObject(obj).Decode());
+ shadow_frame.SetVRegReference(vregA, f->GetObject(obj).Ptr());
break;
default:
LOG(FATAL) << "Unreachable: " << field_type;
@@ -271,7 +271,7 @@
HandleWrapperObjPtr<mirror::Object> h(hs.NewHandleWrapper(&obj));
JValue field_value = GetFieldValue<field_type>(shadow_frame, vregA);
ObjPtr<Object> this_object = f->IsStatic() ? nullptr : obj;
- instrumentation->FieldWriteEvent(self, this_object.Decode(),
+ instrumentation->FieldWriteEvent(self, this_object.Ptr(),
shadow_frame.GetMethod(),
shadow_frame.GetDexPC(),
f,
@@ -308,7 +308,7 @@
HandleWrapperObjPtr<mirror::Object> h_obj(hs.NewHandleWrapper(&obj));
field_class = f->GetType<true>();
}
- if (!reg->VerifierInstanceOf(field_class.Decode())) {
+ if (!reg->VerifierInstanceOf(field_class.Ptr())) {
// This should never happen.
std::string temp1, temp2, temp3;
self->ThrowNewExceptionF("Ljava/lang/VirtualMachineError;",
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index eb8cdbc..89cbbe6 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -1619,9 +1619,9 @@
uint32_t* args ATTRIBUTE_UNUSED, JValue* result) {
ScopedObjectAccessUnchecked soa(self);
if (Runtime::Current()->IsActiveTransaction()) {
- result->SetL(soa.Decode<mirror::Object>(self->CreateInternalStackTrace<true>(soa)).Decode());
+ result->SetL(soa.Decode<mirror::Object>(self->CreateInternalStackTrace<true>(soa)).Ptr());
} else {
- result->SetL(soa.Decode<mirror::Object>(self->CreateInternalStackTrace<false>(soa)).Decode());
+ result->SetL(soa.Decode<mirror::Object>(self->CreateInternalStackTrace<false>(soa)).Ptr());
}
}
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index 0c752ef..215f2b3 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -538,7 +538,7 @@
return nullptr;
}
WriterMutexLock mu(self, globals_lock_);
- IndirectRef ref = globals_.Add(IRT_FIRST_SEGMENT, obj.Decode());
+ IndirectRef ref = globals_.Add(IRT_FIRST_SEGMENT, obj.Ptr());
return reinterpret_cast<jobject>(ref);
}
@@ -550,7 +550,7 @@
while (UNLIKELY(!MayAccessWeakGlobals(self))) {
weak_globals_add_condition_.WaitHoldingLocks(self);
}
- IndirectRef ref = weak_globals_.Add(IRT_FIRST_SEGMENT, obj.Decode());
+ IndirectRef ref = weak_globals_.Add(IRT_FIRST_SEGMENT, obj.Ptr());
return reinterpret_cast<jweak>(ref);
}
@@ -758,12 +758,12 @@
ObjPtr<mirror::ClassLoader> loader = soa.Decode<mirror::ClassLoader>(class_loader);
ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
- if (class_linker->IsBootClassLoader(soa, loader.Decode())) {
+ if (class_linker->IsBootClassLoader(soa, loader.Ptr())) {
loader = nullptr;
class_loader = nullptr;
}
- class_loader_allocator = class_linker->GetAllocatorForClassLoader(loader.Decode());
+ class_loader_allocator = class_linker->GetAllocatorForClassLoader(loader.Ptr());
CHECK(class_loader_allocator != nullptr);
}
if (library != nullptr) {
diff --git a/runtime/jni_internal.cc b/runtime/jni_internal.cc
index 7977815..621e2df 100644
--- a/runtime/jni_internal.cc
+++ b/runtime/jni_internal.cc
@@ -148,7 +148,7 @@
}
}
if (method == nullptr || method->IsStatic() != is_static) {
- ThrowNoSuchMethodError(soa, c.Decode(), name, sig, is_static ? "static" : "non-static");
+ ThrowNoSuchMethodError(soa, c.Ptr(), name, sig, is_static ? "static" : "non-static");
return nullptr;
}
return soa.EncodeMethod(method);
@@ -373,7 +373,7 @@
// Not even a java.lang.reflect.Field, return null. TODO, is this check necessary?
return nullptr;
}
- ObjPtr<mirror::Field> field = down_cast<mirror::Field*>(obj_field.Decode());
+ ObjPtr<mirror::Field> field = down_cast<mirror::Field*>(obj_field.Ptr());
return soa.EncodeField(field->GetArtField());
}
@@ -528,7 +528,7 @@
static jobject NewGlobalRef(JNIEnv* env, jobject obj) {
ScopedObjectAccess soa(env);
ObjPtr<mirror::Object> decoded_obj = soa.Decode<mirror::Object>(obj);
- return soa.Vm()->AddGlobalRef(soa.Self(), decoded_obj.Decode());
+ return soa.Vm()->AddGlobalRef(soa.Self(), decoded_obj.Ptr());
}
static void DeleteGlobalRef(JNIEnv* env, jobject obj) {
@@ -540,7 +540,7 @@
static jweak NewWeakGlobalRef(JNIEnv* env, jobject obj) {
ScopedObjectAccess soa(env);
ObjPtr<mirror::Object> decoded_obj = soa.Decode<mirror::Object>(obj);
- return soa.Vm()->AddWeakGlobalRef(soa.Self(), decoded_obj.Decode());
+ return soa.Vm()->AddWeakGlobalRef(soa.Self(), decoded_obj.Ptr());
}
static void DeleteWeakGlobalRef(JNIEnv* env, jweak obj) {
@@ -1857,7 +1857,7 @@
ObjPtr<mirror::ObjectArray<mirror::Object>> array =
soa.Decode<mirror::ObjectArray<mirror::Object>>(java_array);
ObjPtr<mirror::Object> value = soa.Decode<mirror::Object>(java_value);
- array->Set<false>(index, value.Decode());
+ array->Set<false>(index, value.Ptr());
}
static jbooleanArray NewBooleanArray(JNIEnv* env, jsize length) {
@@ -1900,7 +1900,7 @@
ScopedObjectAccess soa(env);
mirror::Class* array_class;
{
- mirror::Class* element_class = soa.Decode<mirror::Class>(element_jclass).Decode();
+ mirror::Class* element_class = soa.Decode<mirror::Class>(element_jclass).Ptr();
if (UNLIKELY(element_class->IsPrimitive())) {
soa.Vm()->JniAbortF("NewObjectArray", "not an object type: %s",
PrettyDescriptor(element_class).c_str());
@@ -1928,7 +1928,7 @@
return nullptr;
} else {
for (jsize i = 0; i < length; ++i) {
- result->SetWithoutChecks<false>(i, initial_object.Decode());
+ result->SetWithoutChecks<false>(i, initial_object.Ptr());
}
}
}
@@ -1978,7 +1978,7 @@
return;
}
const size_t component_size = array->GetClass()->GetComponentSize();
- ReleasePrimitiveArray(soa, array.Decode(), component_size, elements, mode);
+ ReleasePrimitiveArray(soa, array.Ptr(), component_size, elements, mode);
}
static jboolean* GetBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* is_copy) {
@@ -2217,13 +2217,13 @@
current_class != nullptr;
current_class = current_class->GetSuperClass()) {
// Search first only comparing methods which are native.
- m = FindMethod<true>(current_class.Decode(), name, sig);
+ m = FindMethod<true>(current_class.Ptr(), name, sig);
if (m != nullptr) {
break;
}
// Search again comparing to all methods, to find non-native methods that match.
- m = FindMethod<false>(current_class.Decode(), name, sig);
+ m = FindMethod<false>(current_class.Ptr(), name, sig);
if (m != nullptr) {
break;
}
@@ -2245,14 +2245,14 @@
<< "Failed to register native method "
<< PrettyDescriptor(c) << "." << name << sig << " in "
<< c->GetDexCache()->GetLocation()->ToModifiedUtf8();
- ThrowNoSuchMethodError(soa, c.Decode(), name, sig, "static or non-static");
+ ThrowNoSuchMethodError(soa, c.Ptr(), name, sig, "static or non-static");
return JNI_ERR;
} else if (!m->IsNative()) {
LOG(return_errors ? ::android::base::ERROR : ::android::base::FATAL)
<< "Failed to register non-native method "
<< PrettyDescriptor(c) << "." << name << sig
<< " as native";
- ThrowNoSuchMethodError(soa, c.Decode(), name, sig, "native");
+ ThrowNoSuchMethodError(soa, c.Ptr(), name, sig, "native");
return JNI_ERR;
}
@@ -2295,7 +2295,7 @@
if (soa.Self()->IsExceptionPending()) {
return JNI_ERR;
}
- soa.Env()->monitors.Add(o.Decode());
+ soa.Env()->monitors.Add(o.Ptr());
return JNI_OK;
}
@@ -2307,7 +2307,7 @@
if (soa.Self()->IsExceptionPending()) {
return JNI_ERR;
}
- soa.Env()->monitors.Remove(o.Decode());
+ soa.Env()->monitors.Remove(o.Ptr());
return JNI_OK;
}
@@ -2426,7 +2426,7 @@
return nullptr;
}
DCHECK_EQ(sizeof(ElementT), array->GetClass()->GetComponentSize());
- return array.Decode();
+ return array.Ptr();
}
template <typename ArrayT, typename ElementT, typename ArtArrayT>
diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h
index 3cbd58b..1cfed74 100644
--- a/runtime/mirror/class-inl.h
+++ b/runtime/mirror/class-inl.h
@@ -384,7 +384,7 @@
DCHECK(dex_access_to != nullptr);
if (UNLIKELY(!this->CanAccess(dex_access_to))) {
if (throw_on_failure) {
- ThrowIllegalAccessErrorClass(this, dex_access_to.Decode());
+ ThrowIllegalAccessErrorClass(this, dex_access_to.Ptr());
}
return false;
}
@@ -422,7 +422,7 @@
if (UNLIKELY(!this->CanAccess(dex_access_to))) {
if (throw_on_failure) {
ThrowIllegalAccessErrorClassForMethodDispatch(this,
- dex_access_to.Decode(),
+ dex_access_to.Ptr(),
method,
throw_invoke_type);
}
@@ -448,7 +448,7 @@
inline bool Class::CheckResolvedFieldAccess(ObjPtr<Class> access_to,
ArtField* field,
uint32_t field_idx) {
- return ResolvedFieldAccessTest<true, true>(access_to.Decode(), field, field_idx, nullptr);
+ return ResolvedFieldAccessTest<true, true>(access_to.Ptr(), field, field_idx, nullptr);
}
inline bool Class::CanAccessResolvedMethod(Class* access_to, ArtMethod* method,
diff --git a/runtime/mirror/field-inl.h b/runtime/mirror/field-inl.h
index ec32cb6..445f23f 100644
--- a/runtime/mirror/field-inl.h
+++ b/runtime/mirror/field-inl.h
@@ -80,7 +80,7 @@
template<bool kTransactionActive>
void Field::SetDeclaringClass(ObjPtr<mirror::Class> c) {
- SetFieldObject<kTransactionActive>(OFFSET_OF_OBJECT_MEMBER(Field, declaring_class_), c.Decode());
+ SetFieldObject<kTransactionActive>(OFFSET_OF_OBJECT_MEMBER(Field, declaring_class_), c.Ptr());
}
} // namespace mirror
diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc
index a573ae6..062afd3 100644
--- a/runtime/mirror/object_test.cc
+++ b/runtime/mirror/object_test.cc
@@ -746,7 +746,7 @@
ObjPtr<mirror::Object, /*kPoison*/ true> null_ptr;
EXPECT_TRUE(null_ptr.IsNull());
EXPECT_TRUE(null_ptr.IsValid());
- EXPECT_TRUE(null_ptr.Decode() == nullptr);
+ EXPECT_TRUE(null_ptr.Ptr() == nullptr);
EXPECT_TRUE(null_ptr == nullptr);
EXPECT_TRUE(null_ptr == null_ptr);
EXPECT_FALSE(null_ptr != null_ptr);
@@ -758,13 +758,13 @@
ObjPtr<Class, /*kPoison*/ true> X(h_X.Get());
EXPECT_TRUE(!X.IsNull());
EXPECT_TRUE(X.IsValid());
- EXPECT_TRUE(X.Decode() != nullptr);
+ EXPECT_TRUE(X.Ptr() != nullptr);
EXPECT_OBJ_PTR_EQ(h_X.Get(), X);
// FindClass may cause thread suspension, it should invalidate X.
ObjPtr<Class, /*kPoison*/ true> Y(class_linker_->FindClass(soa.Self(), "LY;", class_loader));
EXPECT_TRUE(!Y.IsNull());
EXPECT_TRUE(Y.IsValid());
- EXPECT_TRUE(Y.Decode() != nullptr);
+ EXPECT_TRUE(Y.Ptr() != nullptr);
// Should IsNull be safe to call on null ObjPtr? I'll allow it for now.
EXPECT_TRUE(!X.IsNull());
@@ -784,7 +784,7 @@
ObjPtr<mirror::Object, /*kPoison*/ false> unpoisoned;
EXPECT_TRUE(unpoisoned.IsNull());
EXPECT_TRUE(unpoisoned.IsValid());
- EXPECT_TRUE(unpoisoned.Decode() == nullptr);
+ EXPECT_TRUE(unpoisoned.Ptr() == nullptr);
EXPECT_TRUE(unpoisoned == nullptr);
EXPECT_TRUE(unpoisoned == unpoisoned);
EXPECT_FALSE(unpoisoned != unpoisoned);
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index 0677d5b..086da60 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -287,7 +287,7 @@
*dex_class_def);
// Add the used dex file. This only required for the DexFile.loadClass API since normal
// class loaders already keep their dex files live.
- class_linker->InsertDexFileInToClassLoader(soa.Decode<mirror::Object>(dexFile).Decode(),
+ class_linker->InsertDexFileInToClassLoader(soa.Decode<mirror::Object>(dexFile).Ptr(),
class_loader.Get());
if (result != nullptr) {
VLOG(class_linker) << "DexFile_defineClassNative returning " << result
diff --git a/runtime/native/dalvik_system_InMemoryDexClassLoader_DexData.cc b/runtime/native/dalvik_system_InMemoryDexClassLoader_DexData.cc
index fdced21..e32545b 100644
--- a/runtime/native/dalvik_system_InMemoryDexClassLoader_DexData.cc
+++ b/runtime/native/dalvik_system_InMemoryDexClassLoader_DexData.cc
@@ -157,7 +157,7 @@
// InMemoryClassLoader/DexData instance now that a class has
// been loaded.
class_linker->InsertDexFileInToClassLoader(
- soa.Decode<mirror::Object>(dexData).Decode(), class_loader.Get());
+ soa.Decode<mirror::Object>(dexData).Ptr(), class_loader.Get());
return soa.AddLocalReference<jclass>(result);
}
}
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 73c4664..8e81bc9 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -263,7 +263,7 @@
if (c == nullptr) {
return 0;
}
- std::vector<mirror::Class*> classes {c.Decode()};
+ std::vector<mirror::Class*> classes {c.Ptr()};
uint64_t count = 0;
heap->CountInstances(classes, countAssignable, &count);
return count;
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index c7fb44ec..e458e2d 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -74,7 +74,7 @@
ThrowNegativeArraySizeException(length);
return nullptr;
}
- mirror::Class* element_class = soa.Decode<mirror::Class>(javaElementClass).Decode();
+ mirror::Class* element_class = soa.Decode<mirror::Class>(javaElementClass).Ptr();
if (UNLIKELY(element_class == nullptr)) {
ThrowNullPointerException("element class == null");
return nullptr;
@@ -99,7 +99,7 @@
ThrowNegativeArraySizeException(length);
return nullptr;
}
- mirror::Class* element_class = soa.Decode<mirror::Class>(javaElementClass).Decode();
+ mirror::Class* element_class = soa.Decode<mirror::Class>(javaElementClass).Ptr();
if (UNLIKELY(element_class == nullptr)) {
ThrowNullPointerException("element class == null");
return nullptr;
@@ -127,7 +127,7 @@
ThrowIllegalArgumentException("not an array");
return 0;
}
- if (Runtime::Current()->GetHeap()->IsMovableObject(array.Decode())) {
+ if (Runtime::Current()->GetHeap()->IsMovableObject(array.Ptr())) {
ThrowRuntimeException("Trying to get address of movable array object");
return 0;
}
diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc
index 34bd57b..87bff5f 100644
--- a/runtime/native/java_lang_Class.cc
+++ b/runtime/native/java_lang_Class.cc
@@ -354,8 +354,8 @@
ObjPtr<mirror::Constructor> result =
mirror::Class::GetDeclaredConstructorInternal<kRuntimePointerSize, false>(
soa.Self(),
- DecodeClass(soa, javaThis).Decode(),
- soa.Decode<mirror::ObjectArray<mirror::Class>>(args).Decode());
+ DecodeClass(soa, javaThis).Ptr(),
+ soa.Decode<mirror::ObjectArray<mirror::Class>>(args).Ptr());
return soa.AddLocalReference<jobject>(result);
}
@@ -405,9 +405,9 @@
DCHECK(!Runtime::Current()->IsActiveTransaction());
mirror::Method* result = mirror::Class::GetDeclaredMethodInternal<kRuntimePointerSize, false>(
soa.Self(),
- DecodeClass(soa, javaThis).Decode(),
- soa.Decode<mirror::String>(name).Decode(),
- soa.Decode<mirror::ObjectArray<mirror::Class>>(args).Decode());
+ DecodeClass(soa, javaThis).Ptr(),
+ soa.Decode<mirror::String>(name).Ptr(),
+ soa.Decode<mirror::ObjectArray<mirror::Class>>(args).Ptr());
return soa.AddLocalReference<jobject>(result);
}
@@ -475,7 +475,7 @@
soa.Decode<mirror::Class>(WellKnownClasses::java_lang_annotation_Annotation__array);
mirror::ObjectArray<mirror::Object>* empty_array =
mirror::ObjectArray<mirror::Object>::Alloc(soa.Self(),
- annotation_array_class.Decode(),
+ annotation_array_class.Ptr(),
0);
return soa.AddLocalReference<jobjectArray>(empty_array);
}
diff --git a/runtime/native/java_lang_DexCache.cc b/runtime/native/java_lang_DexCache.cc
index 5efafe7..1fd7ed1 100644
--- a/runtime/native/java_lang_DexCache.cc
+++ b/runtime/native/java_lang_DexCache.cc
@@ -68,7 +68,7 @@
ScopedFastNativeObjectAccess soa(env);
ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache);
CHECK_LT(static_cast<size_t>(type_index), dex_cache->NumResolvedTypes());
- dex_cache->SetResolvedType(type_index, soa.Decode<mirror::Class>(type).Decode());
+ dex_cache->SetResolvedType(type_index, soa.Decode<mirror::Class>(type).Ptr());
}
static void DexCache_setResolvedString(JNIEnv* env, jobject javaDexCache, jint string_index,
@@ -76,7 +76,7 @@
ScopedFastNativeObjectAccess soa(env);
ObjPtr<mirror::DexCache> dex_cache = soa.Decode<mirror::DexCache>(javaDexCache);
CHECK_LT(static_cast<size_t>(string_index), dex_cache->GetDexFile()->NumStringIds());
- dex_cache->SetResolvedString(string_index, soa.Decode<mirror::String>(string).Decode());
+ dex_cache->SetResolvedString(string_index, soa.Decode<mirror::String>(string).Ptr());
}
static JNINativeMethod gMethods[] = {
diff --git a/runtime/native/java_lang_String.cc b/runtime/native/java_lang_String.cc
index b3a967d..5a49c20 100644
--- a/runtime/native/java_lang_String.cc
+++ b/runtime/native/java_lang_String.cc
@@ -41,7 +41,7 @@
return -1;
} else {
return soa.Decode<mirror::String>(java_this)->CompareTo(
- soa.Decode<mirror::String>(java_rhs).Decode());
+ soa.Decode<mirror::String>(java_rhs).Ptr());
}
}
diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc
index 8b9d0c7..f3756a2 100644
--- a/runtime/native/java_lang_System.cc
+++ b/runtime/native/java_lang_System.cc
@@ -62,12 +62,12 @@
// Make sure source and destination are both arrays.
ObjPtr<mirror::Object> srcObject = soa.Decode<mirror::Object>(javaSrc);
if (UNLIKELY(!srcObject->IsArrayInstance())) {
- ThrowArrayStoreException_NotAnArray("source", srcObject.Decode());
+ ThrowArrayStoreException_NotAnArray("source", srcObject.Ptr());
return;
}
ObjPtr<mirror::Object> dstObject = soa.Decode<mirror::Object>(javaDst);
if (UNLIKELY(!dstObject->IsArrayInstance())) {
- ThrowArrayStoreException_NotAnArray("destination", dstObject.Decode());
+ ThrowArrayStoreException_NotAnArray("destination", dstObject.Ptr());
return;
}
mirror::Array* srcArray = srcObject->AsArray();
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc
index 0635261..fcb0175 100644
--- a/runtime/native/java_lang_Thread.cc
+++ b/runtime/native/java_lang_Thread.cc
@@ -116,7 +116,7 @@
}
MutexLock mu(soa.Self(), *Locks::thread_list_lock_);
Thread* thread = Thread::FromManagedThread(soa, java_thread);
- return thread->HoldsLock(object.Decode());
+ return thread->HoldsLock(object.Ptr());
}
static void Thread_nativeInterrupt(JNIEnv* env, jobject java_thread) {
@@ -173,7 +173,7 @@
static void Thread_sleep(JNIEnv* env, jclass, jobject java_lock, jlong ms, jint ns) {
ScopedFastNativeObjectAccess soa(env);
ObjPtr<mirror::Object> lock = soa.Decode<mirror::Object>(java_lock);
- Monitor::Wait(Thread::Current(), lock.Decode(), ms, ns, true, kSleeping);
+ Monitor::Wait(Thread::Current(), lock.Ptr(), ms, ns, true, kSleeping);
}
/*
diff --git a/runtime/native/java_lang_VMClassLoader.cc b/runtime/native/java_lang_VMClassLoader.cc
index 0694c4d..73d12f1 100644
--- a/runtime/native/java_lang_VMClassLoader.cc
+++ b/runtime/native/java_lang_VMClassLoader.cc
@@ -40,7 +40,7 @@
mirror::Class* c = cl->LookupClass(soa.Self(),
descriptor.c_str(),
descriptor_hash,
- loader.Decode());
+ loader.Ptr());
if (c != nullptr && c->IsResolved()) {
return soa.AddLocalReference<jclass>(c);
}
diff --git a/runtime/native/java_lang_ref_FinalizerReference.cc b/runtime/native/java_lang_ref_FinalizerReference.cc
index 08bcc38..1f03c7c 100644
--- a/runtime/native/java_lang_ref_FinalizerReference.cc
+++ b/runtime/native/java_lang_ref_FinalizerReference.cc
@@ -29,7 +29,7 @@
ScopedFastNativeObjectAccess soa(env);
ObjPtr<mirror::FinalizerReference> ref = soa.Decode<mirror::FinalizerReference>(javaThis);
return Runtime::Current()->GetHeap()->GetReferenceProcessor()->MakeCircularListIfUnenqueued(
- ref.Decode());
+ ref.Ptr());
}
static JNINativeMethod gMethods[] = {
diff --git a/runtime/native/java_lang_ref_Reference.cc b/runtime/native/java_lang_ref_Reference.cc
index 9a088ed..95f6d51 100644
--- a/runtime/native/java_lang_ref_Reference.cc
+++ b/runtime/native/java_lang_ref_Reference.cc
@@ -29,7 +29,7 @@
ScopedFastNativeObjectAccess soa(env);
ObjPtr<mirror::Reference> ref = soa.Decode<mirror::Reference>(javaThis);
mirror::Object* const referent =
- Runtime::Current()->GetHeap()->GetReferenceProcessor()->GetReferent(soa.Self(), ref.Decode());
+ Runtime::Current()->GetHeap()->GetReferenceProcessor()->GetReferent(soa.Self(), ref.Ptr());
return soa.AddLocalReference<jobject>(referent);
}
diff --git a/runtime/native/java_lang_reflect_Array.cc b/runtime/native/java_lang_reflect_Array.cc
index 3718ce8..6f2da33 100644
--- a/runtime/native/java_lang_reflect_Array.cc
+++ b/runtime/native/java_lang_reflect_Array.cc
@@ -40,7 +40,7 @@
DCHECK_EQ(dimensions_obj->GetClass()->GetComponentType()->GetPrimitiveType(),
Primitive::kPrimInt);
Handle<mirror::IntArray> dimensions_array(
- hs.NewHandle(down_cast<mirror::IntArray*>(dimensions_obj.Decode())));
+ hs.NewHandle(down_cast<mirror::IntArray*>(dimensions_obj.Ptr())));
mirror::Array* new_array = mirror::Array::CreateMultiArray(soa.Self(), element_class,
dimensions_array);
return soa.AddLocalReference<jobject>(new_array);
@@ -53,7 +53,7 @@
ThrowNegativeArraySizeException(length);
return nullptr;
}
- mirror::Class* element_class = soa.Decode<mirror::Class>(javaElementClass).Decode();
+ mirror::Class* element_class = soa.Decode<mirror::Class>(javaElementClass).Ptr();
Runtime* runtime = Runtime::Current();
ClassLinker* class_linker = runtime->GetClassLinker();
mirror::Class* array_class = class_linker->FindArrayClass(soa.Self(), &element_class);
diff --git a/runtime/native/java_lang_reflect_Executable.cc b/runtime/native/java_lang_reflect_Executable.cc
index c7c8008..e317c25 100644
--- a/runtime/native/java_lang_reflect_Executable.cc
+++ b/runtime/native/java_lang_reflect_Executable.cc
@@ -38,7 +38,7 @@
ObjPtr<mirror::Class> annotation_array_class =
soa.Decode<mirror::Class>(WellKnownClasses::java_lang_annotation_Annotation__array);
ObjPtr<mirror::ObjectArray<mirror::Object>> empty_array =
- mirror::ObjectArray<mirror::Object>::Alloc(soa.Self(), annotation_array_class.Decode(), 0);
+ mirror::ObjectArray<mirror::Object>::Alloc(soa.Self(), annotation_array_class.Ptr(), 0);
return soa.AddLocalReference<jobjectArray>(empty_array);
}
return soa.AddLocalReference<jobjectArray>(annotations::GetAnnotationsForMethod(method));
diff --git a/runtime/native/java_lang_reflect_Field.cc b/runtime/native/java_lang_reflect_Field.cc
index 2519225..07b59dd 100644
--- a/runtime/native/java_lang_reflect_Field.cc
+++ b/runtime/native/java_lang_reflect_Field.cc
@@ -127,7 +127,7 @@
*class_or_rcvr = declaringClass;
return true;
}
- *class_or_rcvr = soa.Decode<mirror::Object>(j_rcvr).Decode();
+ *class_or_rcvr = soa.Decode<mirror::Object>(j_rcvr).Ptr();
if (!VerifyObjectIsClass(MakeObjPtr(*class_or_rcvr), MakeObjPtr(declaringClass))) {
DCHECK(soa.Self()->IsExceptionPending());
return false;
@@ -137,7 +137,7 @@
static jobject Field_get(JNIEnv* env, jobject javaField, jobject javaObj) {
ScopedFastNativeObjectAccess soa(env);
- mirror::Field* f = soa.Decode<mirror::Field>(javaField).Decode();
+ mirror::Field* f = soa.Decode<mirror::Field>(javaField).Ptr();
mirror::Object* o = nullptr;
if (!CheckReceiver(soa, javaObj, &f, &o)) {
DCHECK(soa.Self()->IsExceptionPending());
@@ -156,14 +156,14 @@
DCHECK(soa.Self()->IsExceptionPending());
return nullptr;
}
- return soa.AddLocalReference<jobject>(BoxPrimitive(field_type, value).Decode());
+ return soa.AddLocalReference<jobject>(BoxPrimitive(field_type, value).Ptr());
}
template<Primitive::Type kPrimitiveType>
ALWAYS_INLINE inline static JValue GetPrimitiveField(JNIEnv* env, jobject javaField,
jobject javaObj) {
ScopedFastNativeObjectAccess soa(env);
- mirror::Field* f = soa.Decode<mirror::Field>(javaField).Decode();
+ mirror::Field* f = soa.Decode<mirror::Field>(javaField).Ptr();
mirror::Object* o = nullptr;
if (!CheckReceiver(soa, javaObj, &f, &o)) {
DCHECK(soa.Self()->IsExceptionPending());
@@ -307,7 +307,7 @@
static void Field_set(JNIEnv* env, jobject javaField, jobject javaObj, jobject javaValue) {
ScopedFastNativeObjectAccess soa(env);
- mirror::Field* f = soa.Decode<mirror::Field>(javaField).Decode();
+ mirror::Field* f = soa.Decode<mirror::Field>(javaField).Ptr();
// Check that the receiver is non-null and an instance of the field's declaring class.
mirror::Object* o = nullptr;
if (!CheckReceiver(soa, javaObj, &f, &o)) {
@@ -346,7 +346,7 @@
static void SetPrimitiveField(JNIEnv* env, jobject javaField, jobject javaObj,
const JValue& new_value) {
ScopedFastNativeObjectAccess soa(env);
- mirror::Field* f = soa.Decode<mirror::Field>(javaField).Decode();
+ mirror::Field* f = soa.Decode<mirror::Field>(javaField).Ptr();
mirror::Object* o = nullptr;
if (!CheckReceiver(soa, javaObj, &f, &o)) {
return;
@@ -441,7 +441,7 @@
// Return an empty array instead of a null pointer.
mirror::Class* annotation_array_class =
soa.Decode<mirror::Class>(
- WellKnownClasses::java_lang_annotation_Annotation__array).Decode();
+ WellKnownClasses::java_lang_annotation_Annotation__array).Ptr();
mirror::ObjectArray<mirror::Object>* empty_array =
mirror::ObjectArray<mirror::Object>::Alloc(soa.Self(), annotation_array_class, 0);
return soa.AddLocalReference<jobjectArray>(empty_array);
diff --git a/runtime/native/sun_misc_Unsafe.cc b/runtime/native/sun_misc_Unsafe.cc
index 2fae3cc..0bdb5a4 100644
--- a/runtime/native/sun_misc_Unsafe.cc
+++ b/runtime/native/sun_misc_Unsafe.cc
@@ -64,15 +64,15 @@
// CAS or the CAS could fail incorrectly.
mirror::HeapReference<mirror::Object>* field_addr =
reinterpret_cast<mirror::HeapReference<mirror::Object>*>(
- reinterpret_cast<uint8_t*>(obj.Decode()) + static_cast<size_t>(offset));
+ reinterpret_cast<uint8_t*>(obj.Ptr()) + static_cast<size_t>(offset));
ReadBarrier::Barrier<mirror::Object, kWithReadBarrier, /*kAlwaysUpdateField*/true>(
- obj.Decode(),
+ obj.Ptr(),
MemberOffset(offset),
field_addr);
}
bool success = obj->CasFieldStrongSequentiallyConsistentObject<false>(MemberOffset(offset),
- expectedValue.Decode(),
- newValue.Decode());
+ expectedValue.Ptr(),
+ newValue.Ptr());
return success ? JNI_TRUE : JNI_FALSE;
}
@@ -168,7 +168,7 @@
ObjPtr<mirror::Object> obj = soa.Decode<mirror::Object>(javaObj);
ObjPtr<mirror::Object> newValue = soa.Decode<mirror::Object>(javaNewValue);
// JNI must use non transactional mode.
- obj->SetFieldObject<false>(MemberOffset(offset), newValue.Decode());
+ obj->SetFieldObject<false>(MemberOffset(offset), newValue.Ptr());
}
static void Unsafe_putObjectVolatile(JNIEnv* env, jobject, jobject javaObj, jlong offset,
@@ -177,7 +177,7 @@
ObjPtr<mirror::Object> obj = soa.Decode<mirror::Object>(javaObj);
ObjPtr<mirror::Object> newValue = soa.Decode<mirror::Object>(javaNewValue);
// JNI must use non transactional mode.
- obj->SetFieldObjectVolatile<false>(MemberOffset(offset), newValue.Decode());
+ obj->SetFieldObjectVolatile<false>(MemberOffset(offset), newValue.Ptr());
}
static void Unsafe_putOrderedObject(JNIEnv* env, jobject, jobject javaObj, jlong offset,
@@ -187,7 +187,7 @@
ObjPtr<mirror::Object> newValue = soa.Decode<mirror::Object>(javaNewValue);
QuasiAtomic::ThreadFenceRelease();
// JNI must use non transactional mode.
- obj->SetFieldObject<false>(MemberOffset(offset), newValue.Decode());
+ obj->SetFieldObject<false>(MemberOffset(offset), newValue.Ptr());
}
static jint Unsafe_getArrayBaseOffsetForComponentType(JNIEnv* env, jclass, jobject component_class) {
diff --git a/runtime/obj_ptr-inl.h b/runtime/obj_ptr-inl.h
index 1c698b5..f0a5f6f 100644
--- a/runtime/obj_ptr-inl.h
+++ b/runtime/obj_ptr-inl.h
@@ -33,7 +33,7 @@
template<class MirrorType, bool kPoison>
inline void ObjPtr<MirrorType, kPoison>::AssertValid() const {
if (kPoison) {
- CHECK(IsValid()) << "Stale object pointer " << DecodeUnchecked() << " , expected cookie "
+ CHECK(IsValid()) << "Stale object pointer " << Ptr() << " , expected cookie "
<< TrimCookie(Thread::Current()->GetPoisonObjectCookie()) << " but got " << GetCookie();
}
}
@@ -56,7 +56,7 @@
template<class MirrorType, bool kPoison>
inline std::ostream& operator<<(std::ostream& os, ObjPtr<MirrorType, kPoison> ptr) {
// May be used for dumping bad pointers, do not use the checked version.
- return os << ptr.DecodeUnchecked();
+ return os << ptr.PtrUnchecked();
}
} // namespace art
diff --git a/runtime/obj_ptr.h b/runtime/obj_ptr.h
index 7c0c9df..beb4d33 100644
--- a/runtime/obj_ptr.h
+++ b/runtime/obj_ptr.h
@@ -49,11 +49,11 @@
template <typename Type>
ALWAYS_INLINE ObjPtr(const ObjPtr<Type>& other) REQUIRES_SHARED(Locks::mutator_lock_)
- : reference_(Encode(static_cast<MirrorType*>(other.Decode()))) {}
+ : reference_(Encode(static_cast<MirrorType*>(other.Ptr()))) {}
template <typename Type>
ALWAYS_INLINE ObjPtr& operator=(const ObjPtr& other) {
- reference_ = Encode(static_cast<MirrorType*>(other.Decode()));
+ reference_ = Encode(static_cast<MirrorType*>(other.Ptr()));
return *this;
}
@@ -67,17 +67,17 @@
}
ALWAYS_INLINE MirrorType* operator->() const REQUIRES_SHARED(Locks::mutator_lock_) {
- return Decode();
+ return Ptr();
}
ALWAYS_INLINE bool IsNull() const {
return reference_ == 0;
}
- // Decode makes sure that the object pointer is valid.
- ALWAYS_INLINE MirrorType* Decode() const REQUIRES_SHARED(Locks::mutator_lock_) {
+ // Ptr makes sure that the object pointer is valid.
+ ALWAYS_INLINE MirrorType* Ptr() const REQUIRES_SHARED(Locks::mutator_lock_) {
AssertValid();
- return DecodeUnchecked();
+ return PtrUnchecked();
}
ALWAYS_INLINE bool IsValid() const REQUIRES_SHARED(Locks::mutator_lock_);
@@ -85,13 +85,13 @@
ALWAYS_INLINE void AssertValid() const REQUIRES_SHARED(Locks::mutator_lock_);
ALWAYS_INLINE bool operator==(const ObjPtr& ptr) const REQUIRES_SHARED(Locks::mutator_lock_) {
- return Decode() == ptr.Decode();
+ return Ptr() == ptr.Ptr();
}
template <typename PointerType>
ALWAYS_INLINE bool operator==(const PointerType* ptr) const
REQUIRES_SHARED(Locks::mutator_lock_) {
- return Decode() == ptr;
+ return Ptr() == ptr;
}
ALWAYS_INLINE bool operator==(std::nullptr_t) const {
@@ -99,21 +99,21 @@
}
ALWAYS_INLINE bool operator!=(const ObjPtr& ptr) const REQUIRES_SHARED(Locks::mutator_lock_) {
- return Decode() != ptr.Decode();
+ return Ptr() != ptr.Ptr();
}
template <typename PointerType>
ALWAYS_INLINE bool operator!=(const PointerType* ptr) const
REQUIRES_SHARED(Locks::mutator_lock_) {
- return Decode() != ptr;
+ return Ptr() != ptr;
}
ALWAYS_INLINE bool operator!=(std::nullptr_t) const {
return !IsNull();
}
- // Decode unchecked does not check that object pointer is valid. Do not use if you can avoid it.
- ALWAYS_INLINE MirrorType* DecodeUnchecked() const {
+ // Ptr unchecked does not check that object pointer is valid. Do not use if you can avoid it.
+ ALWAYS_INLINE MirrorType* PtrUnchecked() const {
if (kPoison) {
return reinterpret_cast<MirrorType*>(
static_cast<uintptr_t>(static_cast<uint32_t>(reference_ << kObjectAlignmentShift)));
diff --git a/runtime/openjdkjvm/OpenjdkJvm.cc b/runtime/openjdkjvm/OpenjdkJvm.cc
index d46d78c..2f51e27 100644
--- a/runtime/openjdkjvm/OpenjdkJvm.cc
+++ b/runtime/openjdkjvm/OpenjdkJvm.cc
@@ -364,7 +364,7 @@
jobject java_lock, jlong millis) {
art::ScopedFastNativeObjectAccess soa(env);
art::ObjPtr<art::mirror::Object> lock = soa.Decode<art::mirror::Object>(java_lock);
- art::Monitor::Wait(art::Thread::Current(), lock.Decode(), millis, 0, true, art::kSleeping);
+ art::Monitor::Wait(art::Thread::Current(), lock.Ptr(), millis, 0, true, art::kSleeping);
}
JNIEXPORT jobject JVM_CurrentThread(JNIEnv* env, jclass unused ATTRIBUTE_UNUSED) {
@@ -399,7 +399,7 @@
art::ThrowNullPointerException("object == null");
return JNI_FALSE;
}
- return soa.Self()->HoldsLock(object.Decode());
+ return soa.Self()->HoldsLock(object.Ptr());
}
JNIEXPORT void JVM_SetNativeThreadName(JNIEnv* env, jobject jthread, jstring java_name) {
diff --git a/runtime/reflection-inl.h b/runtime/reflection-inl.h
index d7db8a4..52cdfb8 100644
--- a/runtime/reflection-inl.h
+++ b/runtime/reflection-inl.h
@@ -107,7 +107,7 @@
if (UNLIKELY(o == nullptr)) {
ThrowNullPointerException("null receiver");
return false;
- } else if (UNLIKELY(!o->InstanceOf(c.Decode()))) {
+ } else if (UNLIKELY(!o->InstanceOf(c.Ptr()))) {
InvalidReceiverError(o, c);
return false;
}
diff --git a/runtime/reflection.cc b/runtime/reflection.cc
index 066bc12..de003e5 100644
--- a/runtime/reflection.cc
+++ b/runtime/reflection.cc
@@ -73,7 +73,7 @@
}
void Append(ObjPtr<mirror::Object> obj) REQUIRES_SHARED(Locks::mutator_lock_) {
- Append(StackReference<mirror::Object>::FromMirrorPtr(obj.Decode()).AsVRegValue());
+ Append(StackReference<mirror::Object>::FromMirrorPtr(obj.Ptr()).AsVRegValue());
}
void AppendWide(uint64_t value) {
@@ -677,7 +677,7 @@
// Box if necessary and return.
return soa.AddLocalReference<jobject>(
- BoxPrimitive(Primitive::GetType(shorty[0]), result).Decode());
+ BoxPrimitive(Primitive::GetType(shorty[0]), result).Ptr());
}
ObjPtr<mirror::Object> BoxPrimitive(Primitive::Type src_class, const JValue& value) {
@@ -773,7 +773,7 @@
}
return false;
}
- unboxed_value->SetL(o.Decode());
+ unboxed_value->SetL(o.Ptr());
return true;
}
if (UNLIKELY(dst_class->GetPrimitiveType() == Primitive::kPrimVoid)) {
@@ -911,14 +911,14 @@
IndirectRef ref = reinterpret_cast<IndirectRef>(obj);
IndirectRefKind kind = GetIndirectRefKind(ref);
if (kind == kLocal) {
- self->GetJniEnv()->locals.Update(obj, result.Decode());
+ self->GetJniEnv()->locals.Update(obj, result.Ptr());
} else if (kind == kHandleScopeOrInvalid) {
LOG(FATAL) << "Unsupported UpdateReference for kind kHandleScopeOrInvalid";
} else if (kind == kGlobal) {
- self->GetJniEnv()->vm->UpdateGlobal(self, ref, result.Decode());
+ self->GetJniEnv()->vm->UpdateGlobal(self, ref, result.Ptr());
} else {
DCHECK_EQ(kind, kWeakGlobal);
- self->GetJniEnv()->vm->UpdateWeakGlobal(self, ref, result.Decode());
+ self->GetJniEnv()->vm->UpdateWeakGlobal(self, ref, result.Ptr());
}
}
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index df0dca0..7032565 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -555,7 +555,7 @@
// We can't run in a transaction yet.
contextClassLoader->SetObject<false>(
soa.Self()->GetPeer(),
- soa.Decode<mirror::ClassLoader>(system_class_loader.get()).Decode());
+ soa.Decode<mirror::ClassLoader>(system_class_loader.get()).Ptr());
return env->NewGlobalRef(system_class_loader.get());
}
diff --git a/runtime/scoped_thread_state_change-inl.h b/runtime/scoped_thread_state_change-inl.h
index cf020d0..1d9f132 100644
--- a/runtime/scoped_thread_state_change-inl.h
+++ b/runtime/scoped_thread_state_change-inl.h
@@ -82,7 +82,7 @@
template<typename T, typename MirrorType, bool kPoison>
inline T ScopedObjectAccessAlreadyRunnable::AddLocalReference(
ObjPtr<MirrorType, kPoison> obj) const {
- return AddLocalReference<T>(obj.Decode());
+ return AddLocalReference<T>(obj.Ptr());
}
template<typename T, bool kPoison>
diff --git a/runtime/thread.cc b/runtime/thread.cc
index b8c7096..80542e8 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -407,7 +407,7 @@
// Copy peer into self, deleting global reference when done.
CHECK(self->tlsPtr_.jpeer != nullptr);
- self->tlsPtr_.opeer = soa.Decode<mirror::Object>(self->tlsPtr_.jpeer).Decode();
+ self->tlsPtr_.opeer = soa.Decode<mirror::Object>(self->tlsPtr_.jpeer).Ptr();
self->GetJniEnv()->DeleteGlobalRef(self->tlsPtr_.jpeer);
self->tlsPtr_.jpeer = nullptr;
self->SetThreadName(self->GetThreadName(soa)->ToModifiedUtf8().c_str());
@@ -445,7 +445,7 @@
Thread* Thread::FromManagedThread(const ScopedObjectAccessAlreadyRunnable& soa,
jobject java_thread) {
- return FromManagedThread(soa, soa.Decode<mirror::Object>(java_thread).Decode());
+ return FromManagedThread(soa, soa.Decode<mirror::Object>(java_thread).Ptr());
}
static size_t FixStackSize(size_t stack_size) {
@@ -803,7 +803,7 @@
}
{
ScopedObjectAccess soa(this);
- tlsPtr_.opeer = soa.Decode<mirror::Object>(peer.get()).Decode();
+ tlsPtr_.opeer = soa.Decode<mirror::Object>(peer.get()).Ptr();
}
env->CallNonvirtualVoidMethod(peer.get(),
WellKnownClasses::java_lang_Thread,
@@ -3051,7 +3051,7 @@
void Thread::SetException(ObjPtr<mirror::Throwable> new_exception) {
CHECK(new_exception != nullptr);
// TODO: DCHECK(!IsExceptionPending());
- tlsPtr_.exception = new_exception.Decode();
+ tlsPtr_.exception = new_exception.Ptr();
}
} // namespace art
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 50466ed..374d825 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -4566,7 +4566,7 @@
ObjPtr<mirror::Class> klass = field->GetDeclaringClass();
const RegType& field_klass =
FromClass(klass->GetDescriptor(&temp),
- klass.Decode(),
+ klass.Ptr(),
klass->CannotBeAssignedFromOtherTypes());
if (obj_type.IsUninitializedTypes()) {
// Field accesses through uninitialized references are only allowable for constructors where
@@ -4668,7 +4668,7 @@
can_load_classes_ ? field->GetType<true>() : field->GetType<false>();
if (field_type_class != nullptr) {
field_type = &FromClass(field->GetTypeDescriptor(),
- field_type_class.Decode(),
+ field_type_class.Ptr(),
field_type_class->CannotBeAssignedFromOtherTypes());
} else {
DCHECK(!can_load_classes_ || self_->IsExceptionPending());
@@ -4793,7 +4793,7 @@
if (field_type_class != nullptr) {
field_type = &FromClass(field->GetTypeDescriptor(),
- field_type_class.Decode(),
+ field_type_class.Ptr(),
field_type_class->CannotBeAssignedFromOtherTypes());
} else {
Thread* self = Thread::Current();
diff --git a/runtime/verifier/verifier_deps_test.cc b/runtime/verifier/verifier_deps_test.cc
index 4533464..71203e6 100644
--- a/runtime/verifier/verifier_deps_test.cc
+++ b/runtime/verifier/verifier_deps_test.cc
@@ -85,7 +85,7 @@
SetVerifierDeps(dex_files);
ObjPtr<mirror::ClassLoader> loader = soa->Decode<mirror::ClassLoader>(class_loader_);
- class_linker_->RegisterDexFile(*dex_file_, loader.Decode());
+ class_linker_->RegisterDexFile(*dex_file_, loader.Ptr());
klass_Main_ = FindClassByName("LMain;", soa);
CHECK(klass_Main_ != nullptr);
diff --git a/test/1337-gc-coverage/gc_coverage.cc b/test/1337-gc-coverage/gc_coverage.cc
index 1e60bd9..1cb2fb0 100644
--- a/test/1337-gc-coverage/gc_coverage.cc
+++ b/test/1337-gc-coverage/gc_coverage.cc
@@ -43,7 +43,7 @@
extern "C" JNIEXPORT jlong JNICALL Java_Main_objectAddress(JNIEnv* env, jclass, jobject object) {
ScopedObjectAccess soa(env);
- return reinterpret_cast<jlong>(soa.Decode<mirror::Object>(object).Decode());
+ return reinterpret_cast<jlong>(soa.Decode<mirror::Object>(object).Ptr());
}
extern "C" JNIEXPORT jboolean JNICALL Java_Main_supportCollectorTransition(JNIEnv*, jclass) {
diff --git a/test/148-multithread-gc-annotations/gc_coverage.cc b/test/148-multithread-gc-annotations/gc_coverage.cc
index cb12df4..4862b87 100644
--- a/test/148-multithread-gc-annotations/gc_coverage.cc
+++ b/test/148-multithread-gc-annotations/gc_coverage.cc
@@ -35,7 +35,7 @@
extern "C" JNIEXPORT jlong JNICALL Java_MovingGCThread_objectAddress(JNIEnv* env, jclass, jobject object) {
ScopedObjectAccess soa(env);
- return reinterpret_cast<jlong>(soa.Decode<mirror::Object>(object).Decode());
+ return reinterpret_cast<jlong>(soa.Decode<mirror::Object>(object).Ptr());
}
} // namespace
diff --git a/test/454-get-vreg/get_vreg_jni.cc b/test/454-get-vreg/get_vreg_jni.cc
index 9058af4..0360eda 100644
--- a/test/454-get-vreg/get_vreg_jni.cc
+++ b/test/454-get-vreg/get_vreg_jni.cc
@@ -123,7 +123,7 @@
extern "C" JNIEXPORT jint JNICALL Java_Main_doNativeCall(JNIEnv*, jobject value) {
ScopedObjectAccess soa(Thread::Current());
std::unique_ptr<Context> context(Context::Create());
- TestVisitor visitor(soa.Self(), context.get(), soa.Decode<mirror::Object>(value).Decode());
+ TestVisitor visitor(soa.Self(), context.get(), soa.Decode<mirror::Object>(value).Ptr());
visitor.WalkStack();
return visitor.found_method_index_;
}
diff --git a/test/461-get-reference-vreg/get_reference_vreg_jni.cc b/test/461-get-reference-vreg/get_reference_vreg_jni.cc
index 7b1ab9c..b2cad67 100644
--- a/test/461-get-reference-vreg/get_reference_vreg_jni.cc
+++ b/test/461-get-reference-vreg/get_reference_vreg_jni.cc
@@ -70,7 +70,7 @@
extern "C" JNIEXPORT jint JNICALL Java_Main_doNativeCallRef(JNIEnv*, jobject value) {
ScopedObjectAccess soa(Thread::Current());
std::unique_ptr<Context> context(Context::Create());
- TestVisitor visitor(soa.Self(), context.get(), soa.Decode<mirror::Object>(value).Decode());
+ TestVisitor visitor(soa.Self(), context.get(), soa.Decode<mirror::Object>(value).Ptr());
visitor.WalkStack();
return visitor.found_method_index_;
}
diff --git a/test/497-inlining-and-class-loader/clear_dex_cache.cc b/test/497-inlining-and-class-loader/clear_dex_cache.cc
index 3f2df29..6c73d7d 100644
--- a/test/497-inlining-and-class-loader/clear_dex_cache.cc
+++ b/test/497-inlining-and-class-loader/clear_dex_cache.cc
@@ -43,7 +43,7 @@
array = env->NewLongArray(num_methods);
}
CHECK(array != nullptr);
- mirror::PointerArray* pointer_array = soa.Decode<mirror::PointerArray>(array).Decode();
+ mirror::PointerArray* pointer_array = soa.Decode<mirror::PointerArray>(array).Ptr();
for (size_t i = 0; i != num_methods; ++i) {
ArtMethod* method = mirror::DexCache::GetElementPtrSize(methods, i, kRuntimePointerSize);
pointer_array->SetElementPtrSize(i, method, kRuntimePointerSize);
diff --git a/test/543-env-long-ref/env_long_ref.cc b/test/543-env-long-ref/env_long_ref.cc
index cd127ef..ce5602f 100644
--- a/test/543-env-long-ref/env_long_ref.cc
+++ b/test/543-env-long-ref/env_long_ref.cc
@@ -43,7 +43,7 @@
uint32_t value = 0;
CHECK(GetVReg(m, 1, kReferenceVReg, &value));
CHECK_EQ(reinterpret_cast<mirror::Object*>(value),
- soa_.Decode<mirror::Object>(expected_value_).Decode());
+ soa_.Decode<mirror::Object>(expected_value_).Ptr());
}
return true;
}
diff --git a/test/596-app-images/app_images.cc b/test/596-app-images/app_images.cc
index 78cc3fd..42211f7 100644
--- a/test/596-app-images/app_images.cc
+++ b/test/596-app-images/app_images.cc
@@ -54,7 +54,7 @@
auto* image_space = space->AsImageSpace();
const auto& image_header = image_space->GetImageHeader();
if (image_header.IsAppImage()) {
- if (image_space->HasAddress(klass_ptr.Decode())) {
+ if (image_space->HasAddress(klass_ptr.Ptr())) {
return JNI_TRUE;
}
}