From d39d2b841f195b33140e88adf6853ba8786b7492 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Fri, 31 Jan 2020 08:16:35 +0800 Subject: [PATCH] Reverted leftovers from commit "ported mozilla upstream change: Bug 1355441 - Reuse StackNode in TreeBuilder to avoid malloc. r=hsivonen." --- parser/html/nsHtml5StateSnapshot.cpp | 4 ++-- parser/html/nsHtml5TreeBuilder.h | 30 ---------------------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/parser/html/nsHtml5StateSnapshot.cpp b/parser/html/nsHtml5StateSnapshot.cpp index 2ac45a1f08..67f309a3e5 100644 --- a/parser/html/nsHtml5StateSnapshot.cpp +++ b/parser/html/nsHtml5StateSnapshot.cpp @@ -163,11 +163,11 @@ nsHtml5StateSnapshot::~nsHtml5StateSnapshot() { MOZ_COUNT_DTOR(nsHtml5StateSnapshot); for (int32_t i = 0; i < stack.length; i++) { - stack[i]->release(nullptr); + stack[i]->release(); } for (int32_t i = 0; i < listOfActiveFormattingElements.length; i++) { if (listOfActiveFormattingElements[i]) { - listOfActiveFormattingElements[i]->release(nullptr); + listOfActiveFormattingElements[i]->release(); } } } diff --git a/parser/html/nsHtml5TreeBuilder.h b/parser/html/nsHtml5TreeBuilder.h index 81ffab00d2..4f484a104d 100644 --- a/parser/html/nsHtml5TreeBuilder.h +++ b/parser/html/nsHtml5TreeBuilder.h @@ -299,9 +299,6 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState nsIContentHandle* contextNode; autoJArray templateModeStack; int32_t templateModePtr; - autoJArray stackNodes; - int32_t stackNodesIdx; - int32_t numStackNodes; autoJArray stack; int32_t currentPtr; autoJArray listOfActiveFormattingElements; @@ -404,33 +401,6 @@ class nsHtml5TreeBuilder : public nsAHtml5TreeBuilderState void addAttributesToHtml(nsHtml5HtmlAttributes* attributes); void pushHeadPointerOntoStack(); void reconstructTheActiveFormattingElements(); - - public: - void notifyUnusedStackNode(int32_t idxInStackNodes); - - private: - nsHtml5StackNode* getUnusedStackNode(); - nsHtml5StackNode* createStackNode(int32_t flags, - int32_t ns, - nsIAtom* name, - nsIContentHandle* node, - nsIAtom* popName, - nsHtml5HtmlAttributes* attributes); - nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName, - nsIContentHandle* node); - nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName, - nsIContentHandle* node, - nsHtml5HtmlAttributes* attributes); - nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName, - nsIContentHandle* node, - nsIAtom* popName); - nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName, - nsIAtom* popName, - nsIContentHandle* node); - nsHtml5StackNode* createStackNode(nsHtml5ElementName* elementName, - nsIContentHandle* node, - nsIAtom* popName, - bool markAsIntegrationPoint); void insertIntoFosterParent(nsIContentHandle* child); nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsHtml5ContentCreatorFunction creator); nsIContentHandle* createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form, nsHtml5ContentCreatorFunction creator);