diff options
author | Ian Rogers <irogers@google.com> | 2013-09-23 23:51:32 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2013-09-24 17:07:24 -0700 |
commit | fc0e94bed3f88ed7e50854fd8dfaf5dcb345250f (patch) | |
tree | 5cfbe05084351576e9659cb8f7b66dcb6163a37b /runtime/mirror/class.cc | |
parent | 576fe9d4181c749aa510e32d2521ed4192bdfda0 (diff) | |
download | art-fc0e94bed3f88ed7e50854fd8dfaf5dcb345250f.zip art-fc0e94bed3f88ed7e50854fd8dfaf5dcb345250f.tar.gz art-fc0e94bed3f88ed7e50854fd8dfaf5dcb345250f.tar.bz2 |
StringPiece clean up.
Profile guided clean up.
Try to avoid creating StringPieces with the contents of a dex file where
the length is known.
Try to avoid RegTypeCache::FromDescriptor when there's a class available.
Make ConstantType::ConstantValue inlinable.
Saving of about 50ms from a 2 threaded ThinkFree compile on host.
Change-Id: I47a12c3c76f46e2c9805be1c3a3e3870fe1f5d85
Diffstat (limited to 'runtime/mirror/class.cc')
-rw-r--r-- | runtime/mirror/class.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc index c128ede..287e8b0 100644 --- a/runtime/mirror/class.cc +++ b/runtime/mirror/class.cc @@ -135,7 +135,7 @@ String* Class::ComputeName() { if (name != NULL) { return name; } - std::string descriptor(ClassHelper(this).GetDescriptor()); + std::string descriptor(ClassHelper(this).GetDescriptorAsStringPiece().as_string()); if ((descriptor[0] != 'L') && (descriptor[0] != '[')) { // The descriptor indicates that this is the class for // a primitive type; special-case the return value. @@ -294,8 +294,8 @@ bool Class::IsInSamePackage(const Class* that) const { return true; } // Compare the package part of the descriptor string. - return IsInSamePackage(ClassHelper(klass1).GetDescriptor(), - ClassHelper(klass2).GetDescriptor()); + return IsInSamePackage(ClassHelper(klass1).GetDescriptorAsStringPiece(), + ClassHelper(klass2).GetDescriptorAsStringPiece()); } bool Class::IsClassClass() const { @@ -367,7 +367,7 @@ ArtMethod* Class::FindDeclaredDirectMethod(const StringPiece& name, const String for (size_t i = 0; i < NumDirectMethods(); ++i) { ArtMethod* method = GetDirectMethod(i); mh.ChangeMethod(method); - if (name == mh.GetName() && signature == mh.GetSignature()) { + if (name == mh.GetNameAsStringPiece() && signature == mh.GetSignature()) { return method; } } @@ -412,7 +412,7 @@ ArtMethod* Class::FindDeclaredVirtualMethod(const StringPiece& name, for (size_t i = 0; i < NumVirtualMethods(); ++i) { ArtMethod* method = GetVirtualMethod(i); mh.ChangeMethod(method); - if (name == mh.GetName() && signature == mh.GetSignature()) { + if (name == mh.GetNameAsStringPiece() && signature == mh.GetSignature()) { return method; } } @@ -458,7 +458,7 @@ ArtField* Class::FindDeclaredInstanceField(const StringPiece& name, const String for (size_t i = 0; i < NumInstanceFields(); ++i) { ArtField* f = GetInstanceField(i); fh.ChangeField(f); - if (name == fh.GetName() && type == fh.GetTypeDescriptor()) { + if (name == fh.GetNameAsStringPiece() && type == fh.GetTypeDescriptorAsStringPiece()) { return f; } } @@ -507,7 +507,7 @@ ArtField* Class::FindDeclaredStaticField(const StringPiece& name, const StringPi for (size_t i = 0; i < NumStaticFields(); ++i) { ArtField* f = GetStaticField(i); fh.ChangeField(f); - if (name == fh.GetName() && type == fh.GetTypeDescriptor()) { + if (name == fh.GetNameAsStringPiece() && type == fh.GetTypeDescriptorAsStringPiece()) { return f; } } |