Skip to content

Commit

Permalink
Merge r235357 - Shrink size of HTMLCollection
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=188945

Reviewed by Darin Adler.

Shrink the size of HTMLCollection by reordering members.

No behavior change.

* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
* html/HTMLCollection.h:
  • Loading branch information
Constellation authored and carlosgcampos committed Sep 18, 2018
1 parent 733bbe9 commit 7bce957
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2018-08-25 Yusuke Suzuki <yusukesuzuki@slowstart.org>

Shrink size of HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=188945

Reviewed by Darin Adler.

Shrink the size of HTMLCollection by reordering members.

No behavior change.

* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
* html/HTMLCollection.h:

2018-08-25 Yusuke Suzuki <yusukesuzuki@slowstart.org>

Shrink size of XMLHttpRequest
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/html/HTMLCollection.cpp
Expand Up @@ -108,10 +108,10 @@ static NodeListInvalidationType invalidationTypeExcludingIdAndNameAttributes(Col
}

HTMLCollection::HTMLCollection(ContainerNode& ownerNode, CollectionType type)
: m_ownerNode(ownerNode)
, m_collectionType(type)
: m_collectionType(type)
, m_invalidationType(invalidationTypeExcludingIdAndNameAttributes(type))
, m_rootType(rootTypeFromCollectionType(type))
, m_ownerNode(ownerNode)
{
ASSERT(m_rootType == static_cast<unsigned>(rootTypeFromCollectionType(type)));
ASSERT(m_invalidationType == static_cast<unsigned>(invalidationTypeExcludingIdAndNameAttributes(type)));
Expand Down
9 changes: 5 additions & 4 deletions Source/WebCore/html/HTMLCollection.h
Expand Up @@ -101,14 +101,15 @@ class HTMLCollection : public NodeList {
enum RootType { IsRootedAtNode, IsRootedAtDocument };
static RootType rootTypeFromCollectionType(CollectionType);

Ref<ContainerNode> m_ownerNode;

mutable std::unique_ptr<CollectionNamedElementCache> m_namedElementCache;
mutable Lock m_namedElementCacheAssignmentLock;

const unsigned m_collectionType : 5;
const unsigned m_invalidationType : 4;
const unsigned m_rootType : 1;

Ref<ContainerNode> m_ownerNode;

mutable std::unique_ptr<CollectionNamedElementCache> m_namedElementCache;
};

inline ContainerNode& HTMLCollection::rootNode() const
Expand Down

0 comments on commit 7bce957

Please sign in to comment.