Take line boxes out of the arena.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2013 22:27:59 +0000 (22:27 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Oct 2013 22:27:59 +0000 (22:27 +0000)
<https://webkit.org/b/123533>

Stop arena-allocating line boxes so we can move forward on improving
render tree memory management. This will also allow more rendering
code to take advantage of malloc optimizations.

This will likely regress performance on some micro-benchmarks, but
it's something we want to do sooner rather than later so we have time
to restabilize it. All improvements to the simple line layout's
coverage will help with recouping whatever is regressed.

BiDi runs are the only remaining user of the arena now.

Reviewed by Antti Koivisto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158321 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/rendering/InlineBox.cpp
Source/WebCore/rendering/InlineBox.h
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/InlineTextBox.h
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockFlow.h
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLineBoxList.cpp
Source/WebCore/rendering/RenderLineBoxList.h
Source/WebCore/rendering/RenderLineBreak.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderTextLineBoxes.cpp
Source/WebCore/rendering/RenderTextLineBoxes.h
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/RootInlineBox.h
Source/WebCore/rendering/svg/RenderSVGInline.cpp
Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp

index 9380415..b58503d 100644 (file)
@@ -1,3 +1,21 @@
+2013-10-30  Andreas Kling  <akling@apple.com>
+
+        Take line boxes out of the arena.
+        <https://webkit.org/b/123533>
+
+        Stop arena-allocating line boxes so we can move forward on improving
+        render tree memory management. This will also allow more rendering
+        code to take advantage of malloc optimizations.
+
+        This will likely regress performance on some micro-benchmarks, but
+        it's something we want to do sooner rather than later so we have time
+        to restabilize it. All improvements to the simple line layout's
+        coverage will help with recouping whatever is regressed.
+
+        BiDi runs are the only remaining user of the arena now.
+
+        Reviewed by Antti Koivisto
+
 2013-10-30  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Remove InspectorAgent::restore functionality
index 6eadffb..2fa8630 100644 (file)
@@ -1322,7 +1322,6 @@ __ZN7WebCore9HTMLNames9selectTagE
 __ZN7WebCore9HTMLNames9styleAttrE
 __ZN7WebCore9HTMLNames9valueAttrE
 __ZN7WebCore9InlineBox10attachLineEv
-__ZN7WebCore9InlineBox10deleteLineERNS_11RenderArenaE
 __ZN7WebCore9InlineBox11extractLineEv
 __ZN7WebCore9InlineBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultERKNS_15HitTestLocationERKNS_11LayoutPointENS_10LayoutUnitESC_
 __ZN7WebCore9InlineBox14adjustPositionEff
@@ -1330,8 +1329,6 @@ __ZN7WebCore9InlineBox14dirtyLineBoxesEv
 __ZN7WebCore9InlineBox14selectionStateEv
 __ZN7WebCore9InlineBox16placeEllipsisBoxEbfffRfRb
 __ZN7WebCore9InlineBox5paintERNS_9PaintInfoERKNS_11LayoutPointENS_10LayoutUnitES6_
-__ZN7WebCore9InlineBox7destroyERNS_11RenderArenaE
-__ZN7WebCore9InlineBoxdlEPvm
 __ZN7WebCore9JSElement6s_infoE
 __ZN7WebCore9PageCache11setCapacityEi
 __ZN7WebCore9PageCache33markPagesForVistedLinkStyleRecalcEv
index 8f2772f..42269ed 100644 (file)
@@ -53,10 +53,6 @@ struct SameSizeAsInlineBox {
 COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), InlineBox_size_guard);
 
 #if !ASSERT_DISABLED
-static bool inInlineBoxDetach;
-#endif
-
-#if !ASSERT_DISABLED
 InlineBox::~InlineBox()
 {
     if (!m_hasBadParent && m_parent)
@@ -70,30 +66,9 @@ void InlineBox::removeFromParent()
         parent()->removeChild(this);
 }
 
-void InlineBox::destroy(RenderArena& renderArena)
+void InlineBox::destroy()
 {
-#if !ASSERT_DISABLED
-    inInlineBoxDetach = true;
-#endif
     delete this;
-#if !ASSERT_DISABLED
-    inInlineBoxDetach = false;
-#endif
-
-    // Recover the size left there for us by operator delete and free the memory.
-    renderArena.free(*(size_t *)this, this);
-}
-
-void* InlineBox::operator new(size_t sz, RenderArena& renderArena)
-{
-    return renderArena.allocate(sz);
-}
-
-void InlineBox::operator delete(void* ptr, size_t sz)
-{
-    ASSERT(inInlineBoxDetach);
-    // Stash size where destroy can find it.
-    *(size_t *)ptr = sz;
 }
 
 #ifndef NDEBUG
@@ -187,7 +162,7 @@ void InlineBox::dirtyLineBoxes()
         curr->markDirty();
 }
 
-void InlineBox::deleteLine(RenderArena& arena)
+void InlineBox::deleteLine()
 {
     if (!m_bitfields.extracted()) {
         if (m_renderer.isBox())
@@ -195,7 +170,7 @@ void InlineBox::deleteLine(RenderArena& arena)
         else if (renderer().isLineBreak())
             toRenderLineBreak(renderer()).setInlineBoxWrapper(0);
     }
-    destroy(arena);
+    destroy();
 }
 
 void InlineBox::extractLine()
index 1e2dad7..67de2d8 100644 (file)
@@ -63,9 +63,9 @@ public:
 
     virtual ~InlineBox();
 
-    virtual void destroy(RenderArena&);
+    virtual void destroy();
 
-    virtual void deleteLine(RenderArena&);
+    virtual void deleteLine();
     virtual void extractLine();
     virtual void attachLine();
 
@@ -97,16 +97,6 @@ public:
     virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom);
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom);
 
-    // Overloaded new operator.
-    void* operator new(size_t, RenderArena&);
-
-    // Overridden to prevent the normal delete from being called.
-    void operator delete(void*, size_t);
-
-private:
-    // The normal operator new is disallowed.
-    void* operator new(size_t) throw();
-
 public:
 #ifndef NDEBUG
     void showTreeForThis() const;
index 775fd2e..58fbe50 100644 (file)
@@ -202,7 +202,7 @@ void InlineFlowBox::removeChild(InlineBox* child)
     checkConsistency();
 }
 
-void InlineFlowBox::deleteLine(RenderArena& arena)
+void InlineFlowBox::deleteLine()
 {
     InlineBox* child = firstChild();
     InlineBox* next = 0;
@@ -212,7 +212,7 @@ void InlineFlowBox::deleteLine(RenderArena& arena)
 #ifndef NDEBUG
         child->setParent(0);
 #endif
-        child->deleteLine(arena);
+        child->deleteLine();
         child = next;
     }
 #ifndef NDEBUG
@@ -221,7 +221,7 @@ void InlineFlowBox::deleteLine(RenderArena& arena)
 #endif
 
     removeLineBoxFromRenderObject();
-    destroy(arena);
+    destroy();
 }
 
 void InlineFlowBox::removeLineBoxFromRenderObject()
index 1ce3e18..45ac68b 100644 (file)
@@ -99,7 +99,7 @@ public:
     }
 
     void addToLine(InlineBox* child);
-    virtual void deleteLine(RenderArena&) OVERRIDE FINAL;
+    virtual void deleteLine() OVERRIDE FINAL;
     virtual void extractLine() OVERRIDE FINAL;
     virtual void attachLine() OVERRIDE FINAL;
     virtual void adjustPosition(float dx, float dy) OVERRIDE;
index 95a7cae..848fa71 100644 (file)
@@ -67,11 +67,11 @@ COMPILE_ASSERT(sizeof(InlineTextBox) == sizeof(SameSizeAsInlineTextBox), InlineT
 typedef WTF::HashMap<const InlineTextBox*, LayoutRect> InlineTextBoxOverflowMap;
 static InlineTextBoxOverflowMap* gTextBoxesWithOverflow;
 
-void InlineTextBox::destroy(RenderArena& arena)
+void InlineTextBox::destroy()
 {
     if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow)
         gTextBoxesWithOverflow->remove(this);
-    InlineBox::destroy(arena);
+    InlineBox::destroy();
 }
 
 void InlineTextBox::markDirty(bool dirty)
@@ -242,10 +242,10 @@ LayoutRect InlineTextBox::localSelectionRect(int startPos, int endPos) const
     return LayoutRect(topPoint, LayoutSize(width, height));
 }
 
-void InlineTextBox::deleteLine(RenderArena& arena)
+void InlineTextBox::deleteLine()
 {
     renderer().removeTextBox(*this);
-    destroy(arena);
+    destroy();
 }
 
 void InlineTextBox::extractLine()
index e8c1de3..5796b64 100644 (file)
@@ -57,7 +57,7 @@ public:
     RenderText& renderer() const { return toRenderText(InlineBox::renderer()); }
     const RenderStyle& lineStyle() const { return isFirstLine() ? renderer().firstLineStyle() : renderer().style(); }
 
-    virtual void destroy(RenderArena&) OVERRIDE FINAL;
+    virtual void destroy() OVERRIDE FINAL;
 
     InlineTextBox* prevTextBox() const { return m_prevTextBox; }
     InlineTextBox* nextTextBox() const { return m_nextTextBox; }
@@ -122,7 +122,7 @@ protected:
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) OVERRIDE;
 
 private:
-    virtual void deleteLine(RenderArena&) OVERRIDE FINAL;
+    virtual void deleteLine() OVERRIDE FINAL;
     virtual void extractLine() OVERRIDE FINAL;
     virtual void attachLine() OVERRIDE FINAL;
 
index beaf00e..68212d1 100644 (file)
@@ -114,7 +114,7 @@ void RenderBlockFlow::willBeDestroyed()
     m_beingDestroyed = true;
 
     if (lineGridBox())
-        lineGridBox()->destroy(renderArena());
+        lineGridBox()->destroy();
 
     if (renderNamedFlowFragment())
         setRenderNamedFlowFragment(0);
@@ -159,7 +159,7 @@ void RenderBlockFlow::willBeDestroyed()
             parent()->dirtyLinesFromChangedChild(this);
     }
 
-    m_lineBoxes.deleteLineBoxes(renderArena());
+    m_lineBoxes.deleteLineBoxes();
 
     removeFromDelayedUpdateScrollInfoSet();
 
@@ -1706,7 +1706,7 @@ void RenderBlockFlow::layoutLineGridBox()
     
     setLineGridBox(0);
 
-    RootInlineBox* lineGridBox = new (renderArena()) RootInlineBox(*this);
+    RootInlineBox* lineGridBox = new RootInlineBox(*this);
     lineGridBox->setHasTextChildren(); // Needed to make the line ascent/descent actually be honored in quirks mode.
     lineGridBox->setConstructed();
     GlyphOverflowAndFallbackFontsMap textBoxDataMap;
@@ -1788,7 +1788,7 @@ void RenderBlockFlow::deleteLines()
         ASSERT(!m_lineBoxes.firstLineBox());
         m_simpleLineLayout = nullptr;
     } else
-        m_lineBoxes.deleteLineBoxTree(renderArena());
+        m_lineBoxes.deleteLineBoxTree();
 
     RenderBlock::deleteLines();
 }
@@ -3171,7 +3171,7 @@ void RenderBlockFlow::layoutSimpleLines(LayoutUnit& repaintLogicalTop, LayoutUni
 void RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout()
 {
     ASSERT(m_lineLayoutPath == SimpleLinesPath);
-    lineBoxes().deleteLineBoxes(renderArena());
+    lineBoxes().deleteLineBoxes();
     toRenderText(firstChild())->deleteLineBoxesBeforeSimpleLineLayout();
 }
 
index f7ad7ca..39fb710 100644 (file)
@@ -243,7 +243,7 @@ public:
         if (!m_rareData)
             m_rareData = adoptPtr(new RenderBlockFlowRareData(*this));
         if (m_rareData->m_lineGridBox)
-            m_rareData->m_lineGridBox->destroy(renderArena());
+            m_rareData->m_lineGridBox->destroy();
         m_rareData->m_lineGridBox = box;
     }
     void layoutLineGridBox();
index 688cd62..02981d0 100644 (file)
@@ -286,7 +286,7 @@ void RenderBlockFlow::appendRunsForObject(BidiRunList<BidiRun>& runs, int start,
 
 RootInlineBox* RenderBlockFlow::createRootInlineBox()
 {
-    return new (renderArena()) RootInlineBox(*this);
+    return new RootInlineBox(*this);
 }
 
 RootInlineBox* RenderBlockFlow::createAndAppendRootInlineBox()
@@ -1250,15 +1250,15 @@ RootInlineBox* RenderBlockFlow::createLineBoxesFromBidiRuns(BidiRunList<BidiRun>
     return lineBox;
 }
 
-static void deleteLineRange(LineLayoutState& layoutState, RenderArena& arena, RootInlineBox* startLine, RootInlineBox* stopLine = 0)
+static void deleteLineRange(LineLayoutState& layoutState, RootInlineBox* startLine, RootInlineBox* stopLine = 0)
 {
     RootInlineBox* boxToDelete = startLine;
     while (boxToDelete && boxToDelete != stopLine) {
         layoutState.updateRepaintRangeFromBox(boxToDelete);
-        // Note: deleteLineRange(renderArena(), firstRootBox()) is not identical to deleteLineBoxTree().
+        // Note: deleteLineRange(firstRootBox()) is not identical to deleteLineBoxTree().
         // deleteLineBoxTree uses nextLineBox() instead of nextRootBox() when traversing.
         RootInlineBox* next = boxToDelete->nextRootBox();
-        boxToDelete->deleteLine(arena);
+        boxToDelete->deleteLine();
         boxToDelete = next;
     }
 }
@@ -1302,7 +1302,7 @@ void RenderBlockFlow::layoutRunsAndFloats(LineLayoutState& layoutState, bool has
     if (startLine) {
         if (!layoutState.usesRepaintBounds())
             layoutState.setRepaintRange(logicalHeight());
-        deleteLineRange(layoutState, renderArena(), startLine);
+        deleteLineRange(layoutState, startLine);
     }
 
     if (!layoutState.isFullLayout() && lastRootBox() && lastRootBox()->endsWithBreak()) {
@@ -1638,7 +1638,7 @@ void RenderBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState, I
 
                         if (availableLogicalWidthForLine(oldLogicalHeight + adjustment, layoutState.lineInfo().isFirstLine()) != oldLineWidth) {
                             // We have to delete this line, remove all floats that got added, and let line layout re-run.
-                            lineBox->deleteLine(renderArena());
+                            lineBox->deleteLine();
                             end = restartLayoutRunsAndFloatsInRange(oldLogicalHeight, oldLogicalHeight + adjustment, lastFloatFromPreviousLine, resolver, oldEnd);
                             continue;
                         }
@@ -1782,7 +1782,7 @@ void RenderBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
             setLogicalHeight(lastRootBox()->lineBottomWithLeading());
         } else {
             // Delete all the remaining lines.
-            deleteLineRange(layoutState, renderArena(), layoutState.endLine());
+            deleteLineRange(layoutState, layoutState.endLine());
         }
     }
     
@@ -1793,7 +1793,7 @@ void RenderBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
         if (layoutState.checkForFloatsFromLastLine()) {
             LayoutUnit bottomVisualOverflow = lastRootBox()->logicalBottomVisualOverflow();
             LayoutUnit bottomLayoutOverflow = lastRootBox()->logicalBottomLayoutOverflow();
-            TrailingFloatsRootInlineBox* trailingFloatsLineBox = new (renderArena()) TrailingFloatsRootInlineBox(*this);
+            TrailingFloatsRootInlineBox* trailingFloatsLineBox = new TrailingFloatsRootInlineBox(*this);
             m_lineBoxes.appendLineBox(trailingFloatsLineBox);
             trailingFloatsLineBox->setConstructed();
             GlyphOverflowAndFallbackFontsMap textBoxDataMap;
@@ -1858,7 +1858,7 @@ void RenderBlockFlow::layoutLineBoxes(bool relayoutChildren, LayoutUnit& repaint
     LineLayoutState layoutState(isFullLayout, repaintLogicalTop, repaintLogicalBottom, flowThread);
 
     if (isFullLayout)
-        lineBoxes().deleteLineBoxes(renderArena());
+        lineBoxes().deleteLineBoxes();
 
     // Text truncation kicks in in two cases:
     //     1) If your overflow isn't visible and your text-overflow-mode isn't clip.
@@ -2024,7 +2024,7 @@ RootInlineBox* RenderBlockFlow::determineStartPosition(LineLayoutState& layoutSt
     }
 
     if (layoutState.isFullLayout()) {
-        m_lineBoxes.deleteLineBoxTree(renderArena());
+        m_lineBoxes.deleteLineBoxTree();
         curr = 0;
 
         ASSERT(!firstLineBox() && !lastLineBox());
@@ -2214,7 +2214,7 @@ bool RenderBlockFlow::matchedEndLine(LineLayoutState& layoutState, const InlineB
             }
 
             // Now delete the lines that we failed to sync.
-            deleteLineRange(layoutState, renderArena(), originalEndLine, result);
+            deleteLineRange(layoutState, originalEndLine, result);
             return matched;
         }
     }
index deaa62c..f68f946 100644 (file)
@@ -1942,14 +1942,14 @@ LayoutSize RenderBox::offsetFromContainer(RenderObject* o, const LayoutPoint& po
 
 InlineBox* RenderBox::createInlineBox()
 {
-    return new (renderArena()) InlineBox(*this);
+    return new InlineBox(*this);
 }
 
 void RenderBox::dirtyLineBoxes(bool fullLayout)
 {
     if (m_inlineBoxWrapper) {
         if (fullLayout) {
-            m_inlineBoxWrapper->destroy(renderArena());
+            m_inlineBoxWrapper->destroy();
             m_inlineBoxWrapper = 0;
         } else
             m_inlineBoxWrapper->dirtyLineBoxes();
@@ -1981,7 +1981,7 @@ void RenderBox::positionLineBox(InlineBox* box)
 
         // Nuke the box.
         box->removeFromParent();
-        box->destroy(renderArena());
+        box->destroy();
     } else if (isReplaced()) {
         setLocation(roundedLayoutPoint(box->topLeft()));
         // m_inlineBoxWrapper should already be 0. Deleting it is a safeguard against security issues.
@@ -1997,7 +1997,7 @@ void RenderBox::deleteLineBoxWrapper()
     if (m_inlineBoxWrapper) {
         if (!documentBeingDestroyed())
             m_inlineBoxWrapper->removeFromParent();
-        m_inlineBoxWrapper->destroy(renderArena());
+        m_inlineBoxWrapper->destroy();
         m_inlineBoxWrapper = 0;
     }
 }
index 5d6ff29..461151d 100644 (file)
@@ -114,7 +114,7 @@ void RenderInline::willBeDestroyed()
             parent()->dirtyLinesFromChangedChild(this);
     }
 
-    m_lineBoxes.deleteLineBoxes(renderArena());
+    m_lineBoxes.deleteLineBoxes();
 
     RenderBoxModelObject::willBeDestroyed();
 }
@@ -1306,7 +1306,7 @@ void RenderInline::updateHitTestResult(HitTestResult& result, const LayoutPoint&
 void RenderInline::dirtyLineBoxes(bool fullLayout)
 {
     if (fullLayout) {
-        m_lineBoxes.deleteLineBoxes(renderArena());
+        m_lineBoxes.deleteLineBoxes();
         return;
     }
 
@@ -1341,12 +1341,12 @@ void RenderInline::dirtyLineBoxes(bool fullLayout)
 
 void RenderInline::deleteLines()
 {
-    m_lineBoxes.deleteLineBoxTree(renderArena());
+    m_lineBoxes.deleteLineBoxTree();
 }
 
 InlineFlowBox* RenderInline::createInlineFlowBox() 
 {
-    return new (renderArena()) InlineFlowBox(*this);
+    return new InlineFlowBox(*this);
 }
 
 InlineFlowBox* RenderInline::createAndAppendInlineFlowBox()
index 3b617f4..cda3374 100644 (file)
@@ -66,13 +66,13 @@ void RenderLineBoxList::appendLineBox(InlineFlowBox* box)
     checkConsistency();
 }
 
-void RenderLineBoxList::deleteLineBoxTree(RenderArena& arena)
+void RenderLineBoxList::deleteLineBoxTree()
 {
     InlineFlowBox* line = m_firstLineBox;
     InlineFlowBox* nextLine;
     while (line) {
         nextLine = line->nextLineBox();
-        line->deleteLine(arena);
+        line->deleteLine();
         line = nextLine;
     }
     m_firstLineBox = m_lastLineBox = 0;
@@ -129,13 +129,13 @@ void RenderLineBoxList::removeLineBox(InlineFlowBox* box)
     checkConsistency();
 }
 
-void RenderLineBoxList::deleteLineBoxes(RenderArena& arena)
+void RenderLineBoxList::deleteLineBoxes()
 {
     if (m_firstLineBox) {
         InlineFlowBox* next;
         for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) {
             next = curr->nextLineBox();
-            curr->destroy(arena);
+            curr->destroy();
         }
         m_firstLineBox = 0;
         m_lastLineBox = 0;
index 33afb48..9eb53b9 100644 (file)
@@ -56,8 +56,8 @@ public:
 
     void appendLineBox(InlineFlowBox*);
 
-    void deleteLineBoxTree(RenderArena&);
-    void deleteLineBoxes(RenderArena&);
+    void deleteLineBoxTree();
+    void deleteLineBoxes();
 
     void extractLineBox(InlineFlowBox*);
     void attachLineBox(InlineFlowBox*);
index 8cf2db8..6128c34 100644 (file)
@@ -44,7 +44,7 @@ RenderLineBreak::RenderLineBreak(HTMLElement& element, PassRef<RenderStyle> styl
 RenderLineBreak::~RenderLineBreak()
 {
     if (m_inlineBoxWrapper)
-        m_inlineBoxWrapper->destroy(renderArena());
+        m_inlineBoxWrapper->destroy();
 }
 
 LayoutUnit RenderLineBreak::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
@@ -70,7 +70,7 @@ int RenderLineBreak::baselinePosition(FontBaseline baselineType, bool firstLine,
 
 InlineBox* RenderLineBreak::createInlineBox()
 {
-    return new (renderArena()) InlineBox(*this);
+    return new InlineBox(*this);
 }
 
 void RenderLineBreak::setInlineBoxWrapper(InlineBox* inlineBox)
@@ -91,7 +91,7 @@ void RenderLineBreak::deleteInlineBoxWrapper()
         return;
     if (!documentBeingDestroyed())
         m_inlineBoxWrapper->removeFromParent();
-    m_inlineBoxWrapper->destroy(renderArena());
+    m_inlineBoxWrapper->destroy();
     m_inlineBoxWrapper = nullptr;
 }
 
@@ -100,7 +100,7 @@ void RenderLineBreak::dirtyLineBoxes(bool fullLayout)
     if (!m_inlineBoxWrapper)
         return;
     if (fullLayout) {
-        m_inlineBoxWrapper->destroy(renderArena());
+        m_inlineBoxWrapper->destroy();
         m_inlineBoxWrapper = nullptr;
         return;
     }
index 2399ad5..52f09d1 100644 (file)
@@ -254,7 +254,7 @@ void RenderText::removeAndDestroyTextBoxes()
 {
     if (!documentBeingDestroyed())
         m_lineBoxes.removeAllFromParent(*this);
-    m_lineBoxes.deleteAll(*this);
+    m_lineBoxes.deleteAll();
 }
 
 void RenderText::willBeDestroyed()
@@ -268,7 +268,7 @@ void RenderText::willBeDestroyed()
 
 void RenderText::deleteLineBoxesBeforeSimpleLineLayout()
 {
-    m_lineBoxes.deleteAll(*this);
+    m_lineBoxes.deleteAll();
 }
 
 String RenderText::originalText() const
@@ -1018,7 +1018,7 @@ String RenderText::textWithoutConvertingBackslashToYenSymbol() const
 void RenderText::dirtyLineBoxes(bool fullLayout)
 {
     if (fullLayout)
-        m_lineBoxes.deleteAll(*this);
+        m_lineBoxes.deleteAll();
     else if (!m_linesDirty)
         m_lineBoxes.dirtyAll();
     m_linesDirty = false;
@@ -1026,7 +1026,7 @@ void RenderText::dirtyLineBoxes(bool fullLayout)
 
 InlineTextBox* RenderText::createTextBox()
 {
-    return new (renderArena()) InlineTextBox(*this);
+    return new InlineTextBox(*this);
 }
 
 void RenderText::positionLineBox(InlineBox* box)
@@ -1038,7 +1038,7 @@ void RenderText::positionLineBox(InlineBox* box)
         // We want the box to be destroyed.
         textBox->removeFromParent();
         m_lineBoxes.remove(*textBox);
-        textBox->destroy(renderArena());
+        textBox->destroy();
         return;
     }
 
index bc16c58..3ca7fb4 100644 (file)
@@ -116,15 +116,14 @@ void RenderTextLineBoxes::removeAllFromParent(RenderText& renderer)
         box->removeFromParent();
 }
 
-void RenderTextLineBoxes::deleteAll(RenderText& renderer)
+void RenderTextLineBoxes::deleteAll()
 {
     if (!m_first)
         return;
-    auto& arena = renderer.renderArena();
     InlineTextBox* next;
     for (auto current = m_first; current; current = next) {
         next = current->nextTextBox();
-        current->destroy(arena);
+        current->destroy();
     }
     m_first = nullptr;
     m_last = nullptr;
index 835b82f..62c75ec 100644 (file)
@@ -50,7 +50,7 @@ public:
     void remove(InlineTextBox&);
 
     void removeAllFromParent(RenderText&);
-    void deleteAll(RenderText&);
+    void deleteAll();
 
     void dirtyAll();
     bool dirtyRange(RenderText&, unsigned start, unsigned end, int lengthDelta);
index 9acb486..ed20f17 100644 (file)
@@ -65,18 +65,18 @@ RootInlineBox::RootInlineBox(RenderBlockFlow& block)
 }
 
 
-void RootInlineBox::destroy(RenderArena& arena)
+void RootInlineBox::destroy()
 {
-    detachEllipsisBox(arena);
-    InlineFlowBox::destroy(arena);
+    detachEllipsisBox();
+    InlineFlowBox::destroy();
 }
 
-void RootInlineBox::detachEllipsisBox(RenderArena& arena)
+void RootInlineBox::detachEllipsisBox()
 {
     if (hasEllipsisBox()) {
         EllipsisBox* box = gEllipsisBoxMap->take(this);
         box->setParent(0);
-        box->destroy(arena);
+        box->destroy();
         setHasEllipsisBox(false);
     }
 }
@@ -89,7 +89,7 @@ RenderLineBoxList& RootInlineBox::rendererLineBoxes() const
 void RootInlineBox::clearTruncation()
 {
     if (hasEllipsisBox()) {
-        detachEllipsisBox(renderer().renderArena());
+        detachEllipsisBox();
         InlineFlowBox::clearTruncation();
     }
 }
@@ -131,7 +131,7 @@ bool RootInlineBox::lineCanAccommodateEllipsis(bool ltr, int blockEdge, int line
 float RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr,  bool ltr, float blockLeftEdge, float blockRightEdge, float ellipsisWidth, InlineBox* markupBox)
 {
     // Create an ellipsis box.
-    EllipsisBox* ellipsisBox = new (renderer().renderArena()) EllipsisBox(blockFlow(), ellipsisStr, this, ellipsisWidth - (markupBox ? markupBox->logicalWidth() : 0), logicalHeight(), y(), !prevRootBox(), isHorizontal(), markupBox);
+    EllipsisBox* ellipsisBox = new EllipsisBox(blockFlow(), ellipsisStr, this, ellipsisWidth - (markupBox ? markupBox->logicalWidth() : 0), logicalHeight(), y(), !prevRootBox(), isHorizontal(), markupBox);
 
     if (!gEllipsisBoxMap)
         gEllipsisBoxMap = new EllipsisBoxMap();
index f9caafe..cce4c35 100644 (file)
@@ -39,12 +39,12 @@ class RootInlineBox : public InlineFlowBox {
 public:
     explicit RootInlineBox(RenderBlockFlow&);
 
-    virtual void destroy(RenderArena&) OVERRIDE FINAL;
+    virtual void destroy() OVERRIDE FINAL;
 
     virtual bool isRootInlineBox() const OVERRIDE FINAL { return true; }
     RenderBlockFlow& blockFlow() const;
 
-    void detachEllipsisBox(RenderArena&);
+    void detachEllipsisBox();
 
     RootInlineBox* nextRootBox() const { return static_cast<RootInlineBox*>(m_nextLineBox); }
     RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_prevLineBox); }
index 806b9ef..45546bd 100644 (file)
@@ -40,7 +40,7 @@ RenderSVGInline::RenderSVGInline(SVGGraphicsElement& element, PassRef<RenderStyl
 
 InlineFlowBox* RenderSVGInline::createInlineFlowBox()
 {
-    InlineFlowBox* box = new (renderArena()) SVGInlineFlowBox(*this);
+    InlineFlowBox* box = new SVGInlineFlowBox(*this);
     box->setHasVirtualLogicalHeight();
     return box;
 }
index 1fdee1c..a0210bf 100644 (file)
@@ -108,7 +108,7 @@ void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle
 
 InlineTextBox* RenderSVGInlineText::createTextBox()
 {
-    InlineTextBox* box = new (renderArena()) SVGInlineTextBox(*this);
+    InlineTextBox* box = new SVGInlineTextBox(*this);
     box->setHasVirtualLogicalHeight();
     return box;
 }
index 59384c3..9b6a88f 100644 (file)
@@ -443,7 +443,7 @@ void RenderSVGText::layout()
 
 RootInlineBox* RenderSVGText::createRootInlineBox() 
 {
-    RootInlineBox* box = new (renderArena()) SVGRootInlineBox(*this);
+    RootInlineBox* box = new SVGRootInlineBox(*this);
     box->setHasVirtualLogicalHeight();
     return box;
 }