diff options
-rw-r--r-- | compiler/driver/compiler_driver-inl.h | 6 | ||||
-rw-r--r-- | oatdump/oatdump.cc | 67 | ||||
-rw-r--r-- | runtime/Android.mk | 1 | ||||
-rw-r--r-- | runtime/check_jni.cc | 1 | ||||
-rw-r--r-- | runtime/class_linker_test.cc | 10 | ||||
-rw-r--r-- | runtime/debugger.cc | 3 | ||||
-rw-r--r-- | runtime/field_helper.cc | 47 | ||||
-rw-r--r-- | runtime/field_helper.h | 49 | ||||
-rw-r--r-- | runtime/interpreter/interpreter_common.cc | 4 | ||||
-rw-r--r-- | runtime/mirror/art_field-inl.h | 17 | ||||
-rw-r--r-- | runtime/mirror/art_field.h | 2 | ||||
-rw-r--r-- | runtime/mirror/object.cc | 20 | ||||
-rw-r--r-- | runtime/native/java_lang_reflect_Field.cc | 4 | ||||
-rw-r--r-- | runtime/proxy_test.cc | 24 | ||||
-rw-r--r-- | runtime/utils.cc | 5 | ||||
-rw-r--r-- | runtime/verifier/method_verifier.cc | 5 |
16 files changed, 90 insertions, 175 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index ebf7874..3a91b08 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -21,7 +21,6 @@ #include "dex/compiler_ir.h" #include "dex_compilation_unit.h" -#include "field_helper.h" #include "mirror/art_field-inl.h" #include "mirror/art_method-inl.h" #include "mirror/class_loader.h" @@ -134,10 +133,9 @@ inline std::pair<bool, bool> CompilerDriver::IsFastStaticField( } else { // Search dex file for localized ssb index, may fail if field's class is a parent // of the class mentioned in the dex file and there is no dex cache entry. - StackHandleScope<1> hs(Thread::Current()); + std::string temp; const DexFile::StringId* string_id = - dex_file->FindStringId( - FieldHelper(hs.NewHandle(resolved_field)).GetDeclaringClassDescriptor()); + dex_file->FindStringId(resolved_field->GetDeclaringClass()->GetDescriptor(&temp)); if (string_id != nullptr) { const DexFile::TypeId* type_id = dex_file->FindTypeId(dex_file->GetIndexForStringId(*string_id)); diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index d28b626..b048833 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -32,7 +32,6 @@ #include "dex_instruction.h" #include "disassembler.h" #include "elf_builder.h" -#include "field_helper.h" #include "gc_map.h" #include "gc/space/image_space.h" #include "gc/space/large_object_space.h" @@ -1459,50 +1458,54 @@ class ImageDumper { static void PrintField(std::ostream& os, mirror::ArtField* field, mirror::Object* obj) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - const char* descriptor = field->GetTypeDescriptor(); os << StringPrintf("%s: ", field->GetName()); - if (descriptor[0] != 'L' && descriptor[0] != '[') { - StackHandleScope<1> hs(Thread::Current()); - FieldHelper fh(hs.NewHandle(field)); - mirror::Class* type = fh.GetType(); - DCHECK(type->IsPrimitive()); - if (type->IsPrimitiveLong()) { + switch (field->GetTypeAsPrimitiveType()) { + case Primitive::kPrimLong: os << StringPrintf("%" PRId64 " (0x%" PRIx64 ")\n", field->Get64(obj), field->Get64(obj)); - } else if (type->IsPrimitiveDouble()) { + break; + case Primitive::kPrimDouble: os << StringPrintf("%f (%a)\n", field->GetDouble(obj), field->GetDouble(obj)); - } else if (type->IsPrimitiveFloat()) { + break; + case Primitive::kPrimFloat: os << StringPrintf("%f (%a)\n", field->GetFloat(obj), field->GetFloat(obj)); - } else if (type->IsPrimitiveInt()) { + break; + case Primitive::kPrimInt: os << StringPrintf("%d (0x%x)\n", field->Get32(obj), field->Get32(obj)); - } else if (type->IsPrimitiveChar()) { + break; + case Primitive::kPrimChar: os << StringPrintf("%u (0x%x)\n", field->GetChar(obj), field->GetChar(obj)); - } else if (type->IsPrimitiveShort()) { + break; + case Primitive::kPrimShort: os << StringPrintf("%d (0x%x)\n", field->GetShort(obj), field->GetShort(obj)); - } else if (type->IsPrimitiveBoolean()) { + break; + case Primitive::kPrimBoolean: os << StringPrintf("%s (0x%x)\n", field->GetBoolean(obj)? "true" : "false", field->GetBoolean(obj)); - } else if (type->IsPrimitiveByte()) { + break; + case Primitive::kPrimByte: os << StringPrintf("%d (0x%x)\n", field->GetByte(obj), field->GetByte(obj)); - } else { - LOG(FATAL) << "Unknown type: " << PrettyClass(type); - } - } else { - // Get the value, don't compute the type unless it is non-null as we don't want - // to cause class loading. - mirror::Object* value = field->GetObj(obj); - if (value == nullptr) { - os << StringPrintf("null %s\n", PrettyDescriptor(descriptor).c_str()); - } else { - // Grab the field type without causing resolution. - StackHandleScope<1> hs(Thread::Current()); - FieldHelper fh(hs.NewHandle(field)); - mirror::Class* field_type = fh.GetType(false); - if (field_type != nullptr) { - PrettyObjectValue(os, field_type, value); + break; + case Primitive::kPrimNot: { + // Get the value, don't compute the type unless it is non-null as we don't want + // to cause class loading. + mirror::Object* value = field->GetObj(obj); + if (value == nullptr) { + os << StringPrintf("null %s\n", PrettyDescriptor(field->GetTypeDescriptor()).c_str()); } else { - os << StringPrintf("%p %s\n", value, PrettyDescriptor(descriptor).c_str()); + // Grab the field type without causing resolution. + mirror::Class* field_type = field->GetType(false); + if (field_type != nullptr) { + PrettyObjectValue(os, field_type, value); + } else { + os << StringPrintf("%p %s\n", value, + PrettyDescriptor(field->GetTypeDescriptor()).c_str()); + } } + break; } + default: + os << "unexpected field type: " << field->GetTypeDescriptor() << "\n"; + break; } } diff --git a/runtime/Android.mk b/runtime/Android.mk index 087c0ea..d4548a2 100644 --- a/runtime/Android.mk +++ b/runtime/Android.mk @@ -42,7 +42,6 @@ LIBART_COMMON_SRC_FILES := \ dex_file_verifier.cc \ dex_instruction.cc \ elf_file.cc \ - field_helper.cc \ gc/allocator/dlmalloc.cc \ gc/allocator/rosalloc.cc \ gc/accounting/card_table.cc \ diff --git a/runtime/check_jni.cc b/runtime/check_jni.cc index fe5b765..e45d3a3 100644 --- a/runtime/check_jni.cc +++ b/runtime/check_jni.cc @@ -24,7 +24,6 @@ #include "class_linker.h" #include "class_linker-inl.h" #include "dex_file-inl.h" -#include "field_helper.h" #include "gc/space/space.h" #include "java_vm_ext.h" #include "jni_internal.h" diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc index 99d0746..ac078aa 100644 --- a/runtime/class_linker_test.cc +++ b/runtime/class_linker_test.cc @@ -23,7 +23,6 @@ #include "common_runtime_test.h" #include "dex_file.h" #include "entrypoints/entrypoint_utils-inl.h" -#include "field_helper.h" #include "gc/heap.h" #include "mirror/art_field-inl.h" #include "mirror/art_method.h" @@ -178,9 +177,7 @@ class ClassLinkerTest : public CommonRuntimeTest { EXPECT_TRUE(field->GetClass() != nullptr); EXPECT_EQ(klass, field->GetDeclaringClass()); EXPECT_TRUE(field->GetName() != nullptr); - StackHandleScope<1> hs(Thread::Current()); - FieldHelper fh(hs.NewHandle(field)); - EXPECT_TRUE(fh.GetType() != nullptr); + EXPECT_TRUE(field->GetType(true) != nullptr); } void AssertClass(const std::string& descriptor, Handle<mirror::Class> klass) @@ -286,8 +283,7 @@ class ClassLinkerTest : public CommonRuntimeTest { for (size_t i = 0; i < klass->NumInstanceFields(); i++) { mirror::ArtField* field = klass->GetInstanceField(i); fhandle.Assign(field); - FieldHelper fh(fhandle); - mirror::Class* field_type = fh.GetType(); + mirror::Class* field_type = fhandle->GetType(true); ASSERT_TRUE(field_type != nullptr); if (!field->IsPrimitiveType()) { ASSERT_TRUE(!field_type->IsPrimitive()); @@ -295,7 +291,7 @@ class ClassLinkerTest : public CommonRuntimeTest { if (current_ref_offset.Uint32Value() == end_ref_offset.Uint32Value()) { // While Reference.referent is not primitive, the ClassLinker // treats it as such so that the garbage collector won't scan it. - EXPECT_EQ(PrettyField(fh.GetField()), + EXPECT_EQ(PrettyField(fhandle.Get()), "java.lang.Object java.lang.ref.Reference.referent"); } else { current_ref_offset = MemberOffset(current_ref_offset.Uint32Value() + diff --git a/runtime/debugger.cc b/runtime/debugger.cc index 49b132d..dae1566 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -25,7 +25,6 @@ #include "class_linker-inl.h" #include "dex_file-inl.h" #include "dex_instruction.h" -#include "field_helper.h" #include "gc/accounting/card_table-inl.h" #include "gc/space/large_object_space.h" #include "gc/space/space-inl.h" @@ -1924,7 +1923,7 @@ static JDWP::JdwpError SetFieldValueImpl(JDWP::ObjectId object_id, JDWP::FieldId HandleWrapper<mirror::Object> h_v(hs.NewHandleWrapper(&v)); HandleWrapper<mirror::ArtField> h_f(hs.NewHandleWrapper(&f)); HandleWrapper<mirror::Object> h_o(hs.NewHandleWrapper(&o)); - field_type = FieldHelper(h_f).GetType(); + field_type = h_f->GetType(true); } if (!field_type->IsAssignableFrom(v->GetClass())) { return JDWP::ERR_INVALID_OBJECT; diff --git a/runtime/field_helper.cc b/runtime/field_helper.cc deleted file mode 100644 index 5c85c46..0000000 --- a/runtime/field_helper.cc +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "field_helper.h" - -#include "class_linker-inl.h" -#include "dex_file.h" -#include "mirror/dex_cache.h" -#include "runtime.h" -#include "thread-inl.h" - -namespace art { - -mirror::Class* FieldHelper::GetType(bool resolve) { - uint32_t field_index = field_->GetDexFieldIndex(); - if (UNLIKELY(field_->GetDeclaringClass()->IsProxyClass())) { - return Runtime::Current()->GetClassLinker()->FindSystemClass(Thread::Current(), - field_->GetTypeDescriptor()); - } - const DexFile* dex_file = field_->GetDexFile(); - const DexFile::FieldId& field_id = dex_file->GetFieldId(field_index); - mirror::Class* type = field_->GetDexCache()->GetResolvedType(field_id.type_idx_); - if (resolve && (type == nullptr)) { - type = Runtime::Current()->GetClassLinker()->ResolveType(field_id.type_idx_, field_.Get()); - CHECK(type != nullptr || Thread::Current()->IsExceptionPending()); - } - return type; -} - -const char* FieldHelper::GetDeclaringClassDescriptor() { - return field_->GetDeclaringClass()->GetDescriptor(&declaring_class_descriptor_); -} - -} // namespace art diff --git a/runtime/field_helper.h b/runtime/field_helper.h deleted file mode 100644 index 8097025..0000000 --- a/runtime/field_helper.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2011 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ART_RUNTIME_FIELD_HELPER_H_ -#define ART_RUNTIME_FIELD_HELPER_H_ - -#include "base/macros.h" -#include "handle.h" -#include "mirror/art_field.h" - -namespace art { - -class FieldHelper { - public: - explicit FieldHelper(Handle<mirror::ArtField> f) : field_(f) {} - - mirror::ArtField* GetField() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - return field_.Get(); - } - - mirror::Class* GetType(bool resolve = true) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - - // The returned const char* is only guaranteed to be valid for the lifetime of the FieldHelper. - // If you need it longer, copy it into a std::string. - const char* GetDeclaringClassDescriptor() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - - private: - Handle<mirror::ArtField> field_; - std::string declaring_class_descriptor_; - - DISALLOW_COPY_AND_ASSIGN(FieldHelper); -}; - -} // namespace art - -#endif // ART_RUNTIME_FIELD_HELPER_H_ diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 5340bee..041650f 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -16,7 +16,6 @@ #include "interpreter_common.h" -#include "field_helper.h" #include "mirror/array-inl.h" namespace art { @@ -267,8 +266,7 @@ bool DoFieldPut(Thread* self, const ShadowFrame& shadow_frame, const Instruction HandleWrapper<mirror::ArtField> h_f(hs.NewHandleWrapper(&f)); HandleWrapper<mirror::Object> h_reg(hs.NewHandleWrapper(®)); HandleWrapper<mirror::Object> h_obj(hs.NewHandleWrapper(&obj)); - FieldHelper fh(h_f); - field_class = fh.GetType(); + field_class = h_f->GetType(true); } if (!reg->VerifierInstanceOf(field_class)) { // This should never happen. diff --git a/runtime/mirror/art_field-inl.h b/runtime/mirror/art_field-inl.h index 03425cc..2b406bd 100644 --- a/runtime/mirror/art_field-inl.h +++ b/runtime/mirror/art_field-inl.h @@ -20,6 +20,7 @@ #include "art_field.h" #include "base/logging.h" +#include "class_linker.h" #include "dex_cache.h" #include "gc/accounting/card_table-inl.h" #include "jvalue.h" @@ -289,6 +290,22 @@ inline bool ArtField::IsPrimitiveType() SHARED_LOCKS_REQUIRED(Locks::mutator_loc return GetTypeAsPrimitiveType() != Primitive::kPrimNot; } +inline Class* ArtField::GetType(bool resolve) { + uint32_t field_index = GetDexFieldIndex(); + if (UNLIKELY(GetDeclaringClass()->IsProxyClass())) { + return Runtime::Current()->GetClassLinker()->FindSystemClass(Thread::Current(), + GetTypeDescriptor()); + } + const DexFile* dex_file = GetDexFile(); + const DexFile::FieldId& field_id = dex_file->GetFieldId(field_index); + mirror::Class* type = GetDexCache()->GetResolvedType(field_id.type_idx_); + if (resolve && (type == nullptr)) { + type = Runtime::Current()->GetClassLinker()->ResolveType(field_id.type_idx_, this); + CHECK(type != nullptr || Thread::Current()->IsExceptionPending()); + } + return type; +} + inline size_t ArtField::FieldSize() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { return Primitive::ComponentSize(GetTypeAsPrimitiveType()); } diff --git a/runtime/mirror/art_field.h b/runtime/mirror/art_field.h index 50299b6..a1d8844 100644 --- a/runtime/mirror/art_field.h +++ b/runtime/mirror/art_field.h @@ -161,6 +161,8 @@ class MANAGED ArtField FINAL : public Object { bool IsPrimitiveType() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + Class* GetType(bool resolve) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + size_t FieldSize() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); mirror::DexCache* GetDexCache() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc index fa1f226..65d6ade 100644 --- a/runtime/mirror/object.cc +++ b/runtime/mirror/object.cc @@ -24,7 +24,6 @@ #include "class.h" #include "class-inl.h" #include "class_linker-inl.h" -#include "field_helper.h" #include "gc/accounting/card_table-inl.h" #include "gc/heap.h" #include "iftable-inl.h" @@ -202,12 +201,16 @@ void Object::CheckFieldAssignmentImpl(MemberOffset field_offset, Object* new_val if (fields != NULL) { size_t num_ifields = fields->GetLength(); for (size_t i = 0; i < num_ifields; ++i) { + StackHandleScope<1> hs(Thread::Current()); + Handle<Object> h_object(hs.NewHandle(new_value)); ArtField* field = fields->Get(i); if (field->GetOffset().Int32Value() == field_offset.Int32Value()) { CHECK_NE(field->GetTypeAsPrimitiveType(), Primitive::kPrimNot); - StackHandleScope<1> hs(Thread::Current()); - FieldHelper fh(hs.NewHandle(field)); - CHECK(fh.GetType()->IsAssignableFrom(new_value->GetClass())); + // TODO: resolve the field type for moving GC. + mirror::Class* field_type = field->GetType(!kMovingCollector); + if (field_type != nullptr) { + CHECK(field_type->IsAssignableFrom(new_value->GetClass())); + } return; } } @@ -225,9 +228,11 @@ void Object::CheckFieldAssignmentImpl(MemberOffset field_offset, Object* new_val ArtField* field = fields->Get(i); if (field->GetOffset().Int32Value() == field_offset.Int32Value()) { CHECK_NE(field->GetTypeAsPrimitiveType(), Primitive::kPrimNot); - StackHandleScope<1> hs(Thread::Current()); - FieldHelper fh(hs.NewHandle(field)); - CHECK(fh.GetType()->IsAssignableFrom(new_value->GetClass())); + // TODO: resolve the field type for moving GC. + mirror::Class* field_type = field->GetType(!kMovingCollector); + if (field_type != nullptr) { + CHECK(field_type->IsAssignableFrom(new_value->GetClass())); + } return; } } @@ -235,6 +240,7 @@ void Object::CheckFieldAssignmentImpl(MemberOffset field_offset, Object* new_val } LOG(FATAL) << "Failed to find field for assignment to " << reinterpret_cast<void*>(this) << " of type " << PrettyDescriptor(c) << " at offset " << field_offset; + UNREACHABLE(); } } // namespace mirror diff --git a/runtime/native/java_lang_reflect_Field.cc b/runtime/native/java_lang_reflect_Field.cc index a042620..2cebf02 100644 --- a/runtime/native/java_lang_reflect_Field.cc +++ b/runtime/native/java_lang_reflect_Field.cc @@ -20,7 +20,6 @@ #include "class_linker-inl.h" #include "common_throws.h" #include "dex_file-inl.h" -#include "field_helper.h" #include "jni_internal.h" #include "mirror/art_field-inl.h" #include "mirror/art_method-inl.h" @@ -294,9 +293,8 @@ static void Field_set(JNIEnv* env, jobject javaField, jobject javaObj, jobject j StackHandleScope<2> hs(soa.Self()); HandleWrapper<mirror::Object> h_o(hs.NewHandleWrapper(&o)); HandleWrapper<mirror::ArtField> h_f(hs.NewHandleWrapper(&f)); - FieldHelper fh(h_f); // May cause resolution. - field_type = fh.GetType(true); + field_type = h_f->GetType(true); if (field_type == nullptr) { DCHECK(soa.Self()->IsExceptionPending()); return; diff --git a/runtime/proxy_test.cc b/runtime/proxy_test.cc index 1eded62..3260992 100644 --- a/runtime/proxy_test.cc +++ b/runtime/proxy_test.cc @@ -18,7 +18,6 @@ #include <vector> #include "common_compiler_test.h" -#include "field_helper.h" #include "mirror/art_field-inl.h" #include "scoped_thread_state_change.h" @@ -184,21 +183,20 @@ TEST_F(ProxyTest, ProxyFieldHelper) { // Test "Class[] interfaces" field. MutableHandle<mirror::ArtField> fhandle = hs.NewHandle(static_fields->Get(0)); - FieldHelper fh(fhandle); - EXPECT_EQ("interfaces", std::string(fh.GetField()->GetName())); - EXPECT_EQ("[Ljava/lang/Class;", std::string(fh.GetField()->GetTypeDescriptor())); - EXPECT_EQ(interfacesFieldClass.Get(), fh.GetType()); - EXPECT_EQ("L$Proxy1234;", std::string(fh.GetDeclaringClassDescriptor())); - EXPECT_FALSE(fh.GetField()->IsPrimitiveType()); + EXPECT_EQ("interfaces", std::string(fhandle->GetName())); + EXPECT_EQ("[Ljava/lang/Class;", std::string(fhandle->GetTypeDescriptor())); + EXPECT_EQ(interfacesFieldClass.Get(), fhandle->GetType(true)); + std::string temp; + EXPECT_EQ("L$Proxy1234;", std::string(fhandle->GetDeclaringClass()->GetDescriptor(&temp))); + EXPECT_FALSE(fhandle->IsPrimitiveType()); // Test "Class[][] throws" field. fhandle.Assign(static_fields->Get(1)); - FieldHelper fh2(fhandle); - EXPECT_EQ("throws", std::string(fh2.GetField()->GetName())); - EXPECT_EQ("[[Ljava/lang/Class;", std::string(fh2.GetField()->GetTypeDescriptor())); - EXPECT_EQ(throwsFieldClass.Get(), fh2.GetType()); - EXPECT_EQ("L$Proxy1234;", std::string(fh2.GetDeclaringClassDescriptor())); - EXPECT_FALSE(fh2.GetField()->IsPrimitiveType()); + EXPECT_EQ("throws", std::string(fhandle->GetName())); + EXPECT_EQ("[[Ljava/lang/Class;", std::string(fhandle->GetTypeDescriptor())); + EXPECT_EQ(throwsFieldClass.Get(), fhandle->GetType(true)); + EXPECT_EQ("L$Proxy1234;", std::string(fhandle->GetDeclaringClass()->GetDescriptor(&temp))); + EXPECT_FALSE(fhandle->IsPrimitiveType()); } } // namespace art diff --git a/runtime/utils.cc b/runtime/utils.cc index ad46be6..1211547 100644 --- a/runtime/utils.cc +++ b/runtime/utils.cc @@ -28,7 +28,6 @@ #include "base/stl_util.h" #include "base/unix_file/fd_file.h" #include "dex_file-inl.h" -#include "field_helper.h" #include "mirror/art_field-inl.h" #include "mirror/art_method-inl.h" #include "mirror/class-inl.h" @@ -324,8 +323,8 @@ std::string PrettyField(mirror::ArtField* f, bool with_type) { result += PrettyDescriptor(f->GetTypeDescriptor()); result += ' '; } - StackHandleScope<1> hs(Thread::Current()); - result += PrettyDescriptor(FieldHelper(hs.NewHandle(f)).GetDeclaringClassDescriptor()); + std::string temp; + result += PrettyDescriptor(f->GetDeclaringClass()->GetDescriptor(&temp)); result += '.'; result += f->GetName(); return result; diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index f9098c7..1b3cc8f 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -25,7 +25,6 @@ #include "dex_file-inl.h" #include "dex_instruction-inl.h" #include "dex_instruction_visitor.h" -#include "field_helper.h" #include "gc/accounting/card_table-inl.h" #include "indenter.h" #include "intern_table.h" @@ -3826,7 +3825,7 @@ void MethodVerifier::VerifyISFieldAccess(const Instruction* inst, const RegType& { StackHandleScope<1> hs(self_); HandleWrapper<mirror::ArtField> h_field(hs.NewHandleWrapper(&field)); - field_type_class = FieldHelper(h_field).GetType(can_load_classes_); + field_type_class = h_field->GetType(can_load_classes_); } if (field_type_class != nullptr) { field_type = ®_types_.FromClass(field->GetTypeDescriptor(), field_type_class, @@ -3950,7 +3949,7 @@ void MethodVerifier::VerifyQuickFieldAccess(const Instruction* inst, const RegTy { StackHandleScope<1> hs(Thread::Current()); HandleWrapper<mirror::ArtField> h_field(hs.NewHandleWrapper(&field)); - field_type_class = FieldHelper(h_field).GetType(can_load_classes_); + field_type_class = h_field->GetType(can_load_classes_); } if (field_type_class != nullptr) { |