WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
100428
Teach RenderTable how to use Vector::insert and Vector::append instead of its own custom memmove code
https://bugs.webkit.org/show_bug.cgi?id=100428
Summary
Teach RenderTable how to use Vector::insert and Vector::append instead of its...
Eric Seidel (no email)
Reported
2012-10-25 15:38:25 PDT
Teach RenderTable how to use Vector::insert and Vector::append instead of its own custom memmove code
Attachments
Patch
(4.12 KB, patch)
2012-10-25 15:41 PDT
,
Eric Seidel (no email)
no flags
Details
Formatted Diff
Diff
Patch
(3.95 KB, patch)
2012-10-25 15:46 PDT
,
Eric Seidel (no email)
no flags
Details
Formatted Diff
Diff
Patch
(3.96 KB, patch)
2012-10-25 15:47 PDT
,
Eric Seidel (no email)
no flags
Details
Formatted Diff
Diff
Update per Julien's suggestions
(3.92 KB, patch)
2012-10-26 18:43 PDT
,
Eric Seidel (no email)
no flags
Details
Formatted Diff
Diff
Patch for landing
(3.83 KB, patch)
2012-10-30 12:45 PDT
,
Eric Seidel (no email)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2012-10-25 15:41:18 PDT
Created
attachment 170748
[details]
Patch
Eric Seidel (no email)
Comment 2
2012-10-25 15:43:26 PDT
This is all part of me working myself up to adding caching of the RenderTableCol pointers in RenderTable to fix
bug 100304
.
Eric Seidel (no email)
Comment 3
2012-10-25 15:46:18 PDT
Created
attachment 170751
[details]
Patch
Eric Seidel (no email)
Comment 4
2012-10-25 15:47:14 PDT
Created
attachment 170752
[details]
Patch
Julien Chaffraix
Comment 5
2012-10-26 01:04:35 PDT
Comment on
attachment 170752
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=170752&action=review
The direction is fine, not r+'ing due to the lost underflow ASSERT.
> Source/WebCore/rendering/RenderTable.cpp:-702 > - ASSERT(oldSpan > firstSpan);
I am not happy about losing this ASSERT. You are doing unsigned arithmetic and this would catch underflow in a way the new logic doesn't. Your new ASSERT was covered by the old one but is only a subset of what we were ASSERTing.
> Source/WebCore/rendering/RenderTable.cpp:701 > + ASSERT(m_columns[position + 1].span > 0); // Every column must span at least 1!
The comment doesn't add much here.
> Source/WebCore/rendering/RenderTable.h:132 > + explicit ColumnStruct(unsigned initialSpan = 1)
I don't see the interest of the default initialSpan as all call sites pass something.
Eric Seidel (no email)
Comment 6
2012-10-26 13:58:27 PDT
(In reply to
comment #5
)
> (From update of
attachment 170752
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=170752&action=review
> > Source/WebCore/rendering/RenderTable.h:132 > > + explicit ColumnStruct(unsigned initialSpan = 1) > > I don't see the interest of the default initialSpan as all call sites pass something.
Vector::resize() needs an argument-less constructor.
Eric Seidel (no email)
Comment 7
2012-10-26 18:43:25 PDT
Created
attachment 171067
[details]
Update per Julien's suggestions
Julien Chaffraix
Comment 8
2012-10-30 03:53:35 PDT
Comment on
attachment 171067
[details]
Update per Julien's suggestions View in context:
https://bugs.webkit.org/attachment.cgi?id=171067&action=review
> Source/WebCore/rendering/RenderTable.cpp:722 > + // Save off the index of the new column for use in notifying the sections of this new column.
I don't think this comment adds much.
> Source/WebCore/rendering/RenderTable.h:132 > + explicit ColumnStruct(unsigned initialSpan = 1)
Too bad for the initial value but that's another battle. Thanks for explaining why it is needed.
Eric Seidel (no email)
Comment 9
2012-10-30 12:45:40 PDT
Created
attachment 171505
[details]
Patch for landing
WebKit Review Bot
Comment 10
2012-10-30 15:38:17 PDT
Comment on
attachment 171505
[details]
Patch for landing Clearing flags on attachment: 171505 Committed
r132949
: <
http://trac.webkit.org/changeset/132949
>
WebKit Review Bot
Comment 11
2012-10-30 15:38:21 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 12
2012-11-01 09:53:39 PDT
Comment on
attachment 171505
[details]
Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=171505&action=review
> Source/WebCore/ChangeLog:13 > + insert, append and grow all use the same expandCapacity logic under the covers > + and Vector::insert uses TypeOperations::moveOverlapping which should use memmove > + by default for unknown types.
I think this comment is not quite right. For truly arbitrary “unknown” types, Vector can’t use memmove. Vector can only use memmove as an optimization if it knows that is safe. I think it’s possible, maybe even likely, that it can figure this out for ColumnStruct without the RenderTable code having to do something explicitly because of the type traits machinery it uses, but I think the wording we are using here in the comment is misleading and doesn’t mention what it takes to make sure that Vector uses memmove.
Eric Seidel (no email)
Comment 13
2012-11-01 10:43:48 PDT
(In reply to
comment #12
)
> (From update of
attachment 171505
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=171505&action=review
> > > Source/WebCore/ChangeLog:13 > > + insert, append and grow all use the same expandCapacity logic under the covers > > + and Vector::insert uses TypeOperations::moveOverlapping which should use memmove > > + by default for unknown types. > > I think this comment is not quite right. For truly arbitrary “unknown” types, Vector can’t use memmove. Vector can only use memmove as an optimization if it knows that is safe. I think it’s possible, maybe even likely, that it can figure this out for ColumnStruct without the RenderTable code having to do something explicitly because of the type traits machinery it uses, but I think the wording we are using here in the comment is misleading and doesn’t mention what it takes to make sure that Vector uses memmove.
It's possible that I've misunderstood and regressed things. I have not seen this code show up in benchmarks, but I'll keep my eye out for it.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug