[Content Extensions] Reduce DFA memory usage.
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jun 2015 22:29:37 +0000 (22:29 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Jun 2015 22:29:37 +0000 (22:29 +0000)
commitb4ba1fceb296eda667cff0043e593a2029c745f8
tree7f487d454c40c307478cfdba92d154f3dcba3ce3
parent45f7aaa094b9feff83a3bc0069d1e938cecf4dd0
[Content Extensions] Reduce DFA memory usage.
https://bugs.webkit.org/show_bug.cgi?id=145526

Reviewed by Benjamin Poulain.

* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::DFA::memoryUsed):
(WebCore::ContentExtensions::DFANode::transitions):
(WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
(WebCore::ContentExtensions::DFANode::changeFallbackTransition):
(WebCore::ContentExtensions::DFANode::addFallbackTransition):
(WebCore::ContentExtensions::DFANode::containsTransition):
(WebCore::ContentExtensions::DFANode::kill):
* contentextensions/DFA.h:
* contentextensions/DFAMinimizer.cpp:
(WebCore::ContentExtensions::DFAMinimizer::minimize):
* contentextensions/NFAToDFA.cpp:
(WebCore::ContentExtensions::NFAToDFA::convert):
Use separate Vectors for the transition characters and destinations to avoid wasting memory to padding a std::pair.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/contentextensions/DFA.cpp
Source/WebCore/contentextensions/DFA.h
Source/WebCore/contentextensions/DFAMinimizer.cpp
Source/WebCore/contentextensions/NFAToDFA.cpp