Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Unified Diff: src/objects-inl.h

Issue 7518: String equality improvements. (Closed)
Patch Set: Fixed lint issue Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index c7d93e3fb51811a48d867db90827f39d8b2b0fca..da814a0e454da2d4676e903230720ea927961ce0 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -125,6 +125,12 @@ bool Object::IsSeqAsciiString() {
}
+bool String::IsSeqAsciiString() {
+ return (this->representation_tag() == kSeqStringTag)
+ && is_ascii_representation();
+}
+
+
bool Object::IsSeqTwoByteString() {
return IsSeqString()
&& !String::cast(this)->IsAsciiRepresentation();
@@ -1408,6 +1414,11 @@ Address SeqAsciiString::GetCharsAddress() {
}
+const char* SeqAsciiString::GetChars() {
+ return reinterpret_cast<const char*>(GetCharsAddress());
+}
+
+
Address SeqTwoByteString::GetCharsAddress() {
return FIELD_ADDR(this, kHeaderSize);
}
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698