Commit 4f0ee04a authored by rob.buis@samsung.com's avatar rob.buis@samsung.com

Shrink QualifiedNameImpl by 8 bytes on 64-bit platforms

Review URL: https://codereview.chromium.org/560613002

git-svn-id: svn://svn.chromium.org/blink/trunk@181773 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 1d222ac3
......@@ -34,6 +34,13 @@
namespace blink {
struct SameSizeAsQualifiedNameImpl : public RefCounted<SameSizeAsQualifiedNameImpl> {
unsigned bitfield;
void* pointers[4];
};
COMPILE_ASSERT(sizeof(QualifiedName::QualifiedNameImpl) == sizeof(SameSizeAsQualifiedNameImpl), qualified_name_impl_should_stay_small);
static const int staticQualifiedNamesCount = HTMLNames::HTMLTagsCount + HTMLNames::HTMLAttrsCount
+ MathMLNames::MathMLTagsCount + MathMLNames::MathMLAttrsCount
+ SVGNames::SVGTagsCount + SVGNames::SVGAttrsCount
......
......@@ -74,22 +74,22 @@ public:
RefCounted<QualifiedNameImpl>::deref();
}
const AtomicString m_prefix;
const AtomicString m_localName;
const AtomicString m_namespace;
mutable AtomicString m_localNameUpper;
// We rely on StringHasher's hashMemory clearing out the top 8 bits when
// doing hashing and use one of the bits for the m_isStatic value.
mutable unsigned m_existingHash : 24;
unsigned m_isStatic : 1;
const AtomicString m_prefix;
const AtomicString m_localName;
const AtomicString m_namespace;
mutable AtomicString m_localNameUpper;
private:
QualifiedNameImpl(const AtomicString& prefix, const AtomicString& localName, const AtomicString& namespaceURI, bool isStatic)
: m_prefix(prefix)
: m_existingHash(0)
, m_isStatic(isStatic)
, m_prefix(prefix)
, m_localName(localName)
, m_namespace(namespaceURI)
, m_existingHash(0)
, m_isStatic(isStatic)
{
ASSERT(!namespaceURI.isEmpty() || namespaceURI.isNull());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment