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

Unified Diff: Source/wtf/text/StringStatics.cpp

Issue 21437003: Remove the pointer from StringImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Now with placement new Created 7 years, 4 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
« no previous file with comments | « Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringStatics.cpp
diff --git a/Source/wtf/text/StringStatics.cpp b/Source/wtf/text/StringStatics.cpp
index 7c66c7617c245ef10d96f2ff1bec7fc9bf6d43a6..2ecd9648c1bcdc63aef4d951370d661b91651225 100644
--- a/Source/wtf/text/StringStatics.cpp
+++ b/Source/wtf/text/StringStatics.cpp
@@ -40,15 +40,7 @@ namespace WTF {
StringImpl* StringImpl::empty()
{
- // FIXME: This works around a bug in our port of PCRE, that a regular expression
- // run on the empty string may still perform a read from the first element, and
- // as such we need this to be a valid pointer. No code should ever be reading
- // from a zero length string, so this should be able to be a non-null pointer
- // into the zero-page.
- // Replace this with 'reinterpret_cast<UChar*>(static_cast<intptr_t>(1))' once
- // PCRE goes away.
- static LChar emptyLCharData = 0;
- DEFINE_STATIC_LOCAL(StringImpl, emptyString, (&emptyLCharData, 0, ConstructStaticString));
+ DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmptyString));
WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyString reference counter");
return &emptyString;
}
@@ -65,9 +57,9 @@ WTF_EXPORT DEFINE_GLOBAL(AtomicString, xlinkAtom)
NEVER_INLINE unsigned StringImpl::hashSlowCase() const
{
if (is8Bit())
- setHash(StringHasher::computeHashAndMaskTop8Bits(m_data8, m_length));
+ setHash(StringHasher::computeHashAndMaskTop8Bits(characters8(), m_length));
else
- setHash(StringHasher::computeHashAndMaskTop8Bits(m_data16, m_length));
+ setHash(StringHasher::computeHashAndMaskTop8Bits(characters16(), m_length));
return existingHash();
}
« no previous file with comments | « Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698