summaryrefslogtreecommitdiffstats
path: root/runtime/common_throws.h
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2013-09-25 20:26:14 -0700
committerIan Rogers <irogers@google.com>2013-09-26 21:08:25 -0700
commitd91d6d6a80748f277fd938a412211e5af28913b1 (patch)
tree5c45f4ae53aab3f530284a97dc328b4e38ce7c94 /runtime/common_throws.h
parent9c11b56296b8cffc94b0b854ce6cff7e014b8d57 (diff)
downloadandroid_art-d91d6d6a80748f277fd938a412211e5af28913b1.tar.gz
android_art-d91d6d6a80748f277fd938a412211e5af28913b1.tar.bz2
android_art-d91d6d6a80748f277fd938a412211e5af28913b1.zip
Introduce Signature type to avoid string comparisons.
Method resolution currently creates strings to then compare with strings formed from methods in other dex files. The temporary strings are purely created for the sake of comparisons. This change creates a new Signature type that represents a method signature but not as a string. This type supports comparisons and so can be used when searching for methods in resolution. With this change malloc is no longer the hottest method during dex2oat (now its memset) and allocations during verification have been reduced. The verifier is commonly what is populating the dex cache for methods and fields not declared in the dex file itself. Change-Id: I5ef0542823fbcae868aaa4a2457e8da7df0e9dae
Diffstat (limited to 'runtime/common_throws.h')
-rw-r--r--runtime/common_throws.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/common_throws.h b/runtime/common_throws.h
index 99c6343cdd..1d77e2d625 100644
--- a/runtime/common_throws.h
+++ b/runtime/common_throws.h
@@ -27,6 +27,7 @@ class ArtMethod;
class Class;
class Object;
} // namespace mirror
+class Signature;
class StringPiece;
class ThrowLocation;
@@ -140,7 +141,7 @@ void ThrowNoSuchFieldError(const StringPiece& scope, mirror::Class* c,
// NoSuchMethodError
void ThrowNoSuchMethodError(InvokeType type, mirror::Class* c, const StringPiece& name,
- const StringPiece& signature)
+ const Signature& signature)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
void ThrowNoSuchMethodError(uint32_t method_idx)