Revert "Support for a set of verifier failures."
This reverts commit 0d60484cbb0c70acc60965b015e94c2e9cb9f1e7
diff --git a/src/object_utils.h b/src/object_utils.h
index ceef186..59ef515 100644
--- a/src/object_utils.h
+++ b/src/object_utils.h
@@ -183,13 +183,7 @@
}
std::string GetLocation() {
- DexCache* dex_cache = GetDexCache();
- if (dex_cache != NULL && !klass_->IsProxyClass()) {
- return dex_cache->GetLocation()->ToModifiedUtf8();
- } else {
- // Arrays and proxies are generated and have no corresponding dex file location.
- return "generated class";
- }
+ return GetDexCache()->GetLocation()->ToModifiedUtf8();
}
const DexFile& GetDexFile() {
@@ -202,16 +196,6 @@
return *result;
}
- DexCache* GetDexCache() {
- DexCache* result = dex_cache_;
- if (result == NULL) {
- DCHECK(klass_ != NULL);
- result = klass_->GetDexCache();
- dex_cache_ = result;
- }
- return result;
- }
-
private:
const DexFile::TypeList* GetInterfaceTypeList() {
const DexFile::TypeList* result = interface_type_list_;
@@ -225,6 +209,16 @@
return result;
}
+ DexCache* GetDexCache() {
+ DexCache* result = dex_cache_;
+ if (result == NULL) {
+ DCHECK(klass_ != NULL);
+ result = klass_->GetDexCache();
+ dex_cache_ = result;
+ }
+ return result;
+ }
+
ClassLinker* GetClassLinker() {
ClassLinker* result = class_linker_;
if (result == NULL) {
@@ -406,7 +400,6 @@
SetMethod(new_m);
shorty_ = NULL;
}
-
const char* GetName() {
const DexFile& dex_file = GetDexFile();
uint32_t dex_method_idx = method_->GetDexMethodIndex();
@@ -427,14 +420,12 @@
}
}
}
-
String* GetNameAsString() {
const DexFile& dex_file = GetDexFile();
uint32_t dex_method_idx = method_->GetDexMethodIndex();
const DexFile::MethodId& method_id = dex_file.GetMethodId(dex_method_idx);
return GetClassLinker()->ResolveString(dex_file, method_id.name_idx_, GetDexCache());
}
-
const char* GetShorty() {
const char* result = shorty_;
if (result == NULL) {
@@ -445,14 +436,12 @@
}
return result;
}
-
uint32_t GetShortyLength() {
if (shorty_ == NULL) {
GetShorty();
}
return shorty_len_;
}
-
const std::string GetSignature() {
const DexFile& dex_file = GetDexFile();
uint32_t dex_method_idx = method_->GetDexMethodIndex();
@@ -462,17 +451,14 @@
return "<no signature>";
}
}
-
const DexFile::ProtoId& GetPrototype() {
const DexFile& dex_file = GetDexFile();
return dex_file.GetMethodPrototype(dex_file.GetMethodId(method_->GetDexMethodIndex()));
}
-
const DexFile::TypeList* GetParameterTypeList() {
const DexFile::ProtoId& proto = GetPrototype();
return GetDexFile().GetProtoParameters(proto);
}
-
ObjectArray<Class>* GetParameterTypes() {
const DexFile::TypeList* params = GetParameterTypeList();
Class* array_class = GetClassLinker()->FindSystemClass("[Ljava/lang/Class;");
@@ -488,7 +474,6 @@
}
return result;
}
-
Class* GetReturnType() {
const DexFile& dex_file = GetDexFile();
const DexFile::MethodId& method_id = dex_file.GetMethodId(method_->GetDexMethodIndex());
@@ -496,7 +481,6 @@
uint16_t return_type_idx = proto_id.return_type_idx_;
return GetClassFromTypeIdx(return_type_idx);
}
-
const char* GetReturnTypeDescriptor() {
const DexFile& dex_file = GetDexFile();
const DexFile::MethodId& method_id = dex_file.GetMethodId(method_->GetDexMethodIndex());
@@ -504,12 +488,10 @@
uint16_t return_type_idx = proto_id.return_type_idx_;
return dex_file.GetTypeDescriptor(dex_file.GetTypeId(return_type_idx));
}
-
int32_t GetLineNumFromNativePC(uintptr_t raw_pc) {
const DexFile& dex_file = GetDexFile();
return dex_file.GetLineNumFromPC(method_, method_->ToDexPC(raw_pc));
}
-
const char* GetDeclaringClassDescriptor() {
Class* klass = method_->GetDeclaringClass();
DCHECK(!klass->IsProxyClass());
@@ -517,7 +499,6 @@
const DexFile& dex_file = GetDexFile();
return dex_file.GetTypeDescriptor(dex_file.GetTypeId(type_idx));
}
-
const char* GetDeclaringClassSourceFile() {
const char* descriptor = GetDeclaringClassDescriptor();
const DexFile& dex_file = GetDexFile();
@@ -525,33 +506,17 @@
CHECK(dex_class_def != NULL);
return dex_file.GetSourceFile(*dex_class_def);
}
-
- uint32_t GetClassDefIndex() {
- const char* descriptor = GetDeclaringClassDescriptor();
- const DexFile& dex_file = GetDexFile();
- uint32_t index;
- CHECK(dex_file.FindClassDefIndex(descriptor, index));
- return index;
- }
-
- ClassLoader* GetClassLoader() {
- return method_->GetDeclaringClass()->GetClassLoader();
- }
-
bool IsStatic() {
return method_->IsStatic();
}
-
bool IsClassInitializer() {
return IsStatic() && StringPiece(GetName()) == "<clinit>";
}
-
size_t NumArgs() {
// "1 +" because the first in Args is the receiver.
// "- 1" because we don't count the return type.
return (IsStatic() ? 0 : 1) + GetShortyLength() - 1;
}
-
// Is the specified parameter a long or double, where parameter 0 is 'this' for instance methods
bool IsParamALongOrDouble(size_t param) {
CHECK_LT(param, NumArgs());
@@ -563,7 +528,6 @@
char ch = GetShorty()[param];
return (ch == 'J' || ch == 'D');
}
-
// Is the specified parameter a reference, where parameter 0 is 'this' for instance methods
bool IsParamAReference(size_t param) {
CHECK_LT(param, NumArgs());
@@ -574,7 +538,6 @@
}
return GetShorty()[param] == 'L'; // An array also has a shorty character of 'L' (not '[')
}
-
bool HasSameNameAndSignature(MethodHelper* other) {
if (GetDexCache() == other->GetDexCache()) {
const DexFile& dex_file = GetDexFile();
@@ -587,15 +550,12 @@
StringPiece other_name(other->GetName());
return name == other_name && GetSignature() == other->GetSignature();
}
-
const DexFile::CodeItem* GetCodeItem() {
return GetDexFile().GetCodeItem(method_->GetCodeItemOffset());
}
-
bool IsResolvedTypeIdx(uint16_t type_idx) const {
return method_->GetDexCacheResolvedTypes()->Get(type_idx) != NULL;
}
-
Class* GetClassFromTypeIdx(uint16_t type_idx) {
Class* type = method_->GetDexCacheResolvedTypes()->Get(type_idx);
if (type == NULL) {
@@ -604,16 +564,13 @@
}
return type;
}
-
const char* GetTypeDescriptorFromTypeIdx(uint16_t type_idx) {
const DexFile& dex_file = GetDexFile();
return dex_file.GetTypeDescriptor(dex_file.GetTypeId(type_idx));
}
-
Class* GetDexCacheResolvedType(uint16_t type_idx) {
return GetDexCache()->GetResolvedType(type_idx);
}
-
const DexFile& GetDexFile() {
const DexFile* result = dex_file_;
if (result == NULL) {
@@ -623,16 +580,6 @@
}
return *result;
}
-
- DexCache* GetDexCache() {
- DexCache* result = dex_cache_;
- if (result == NULL) {
- Class* klass = method_->GetDeclaringClass();
- result = klass->GetDexCache();
- dex_cache_ = result;
- }
- return result;
- }
private:
// Set the method_ field, for proxy methods looking up the interface method via the resolved
// methods table.
@@ -649,7 +596,15 @@
}
method_ = method;
}
-
+ DexCache* GetDexCache() {
+ DexCache* result = dex_cache_;
+ if (result == NULL) {
+ Class* klass = method_->GetDeclaringClass();
+ result = klass->GetDexCache();
+ dex_cache_ = result;
+ }
+ return result;
+ }
ClassLinker* GetClassLinker() {
ClassLinker* result = class_linker_;
if (result == NULL) {