WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
136906
CSS JIT: minimumRegisterRequirements() can be one register short for :nth-child()
https://bugs.webkit.org/show_bug.cgi?id=136906
Summary
CSS JIT: minimumRegisterRequirements() can be one register short for :nth-chi...
Benjamin Poulain
Reported
2014-09-17 21:11:25 PDT
CSS JIT: The backtracking register can be ignored from the minimumRegisterRequirements
Attachments
Patch
(5.05 KB, patch)
2014-09-17 21:17 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(5.05 KB, patch)
2014-09-17 23:37 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(6.09 KB, patch)
2014-09-18 00:57 PDT
,
Benjamin Poulain
darin
: review+
benjamin
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Benjamin Poulain
Comment 1
2014-09-17 21:17:55 PDT
Created
attachment 238286
[details]
Patch
Benjamin Poulain
Comment 2
2014-09-17 21:19:51 PDT
Yusuke, could you please double check I am not missing any case? I'll add more testing infrastructure tomorrow but I would like multiple reviews on this.
Benjamin Poulain
Comment 3
2014-09-17 21:20:06 PDT
rdar://problem/18368294
Yusuke Suzuki
Comment 4
2014-09-17 22:29:16 PDT
(In reply to
comment #2
)
> Yusuke, could you please double check I am not missing any case? > > I'll add more testing infrastructure tomorrow but I would like multiple reviews on this.
Sure. I'll check it now :)
Yusuke Suzuki
Comment 5
2014-09-17 23:00:20 PDT
Comment on
attachment 238286
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=238286&action=review
Maybe I don't understand the issue's background enough, sorry, I can't see the rdar link... If I understand this issue correctly, I think there's 2 meanings. Please point it :) 1. When there's no :not, :-webkit-any or attributes, `backtrackingRegisterRequirements` is not added to the minimum requirements. However, seeing the comment on `minimumRequiredRegisterCount`, it contains `BacktrackingRegister`. So I think that `BacktrackingRegister` count is already added, right? 2. `BacktrackingRegister` count is always added to the minimum register requirements whenever it isn't used. I think this pointing is right. So to fix it, 1) changing `minimumRequiredRegisterCount` to 5, it doesn't contains `BacktrackingRegister`. 2) defining `minimum` as `minimumRequiredRegisterCount + backtrackingRegisterRequirements` after the `InChainWithDescendantTail` check. OR adding `backtrackingRegisterRequirements` to `minimum` inside the `InChainWithDescendantTail` check. (like your change!) Is it correct?
> Source/WebCore/cssjit/SelectorCompiler.cpp:859 > + minimum += minimumRequiredRegisterCount;
I think it would be `+= backtrackingRegisterRequirements`. Is it correct?
Benjamin Poulain
Comment 6
2014-09-17 23:36:38 PDT
Comment on
attachment 238286
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=238286&action=review
>> Source/WebCore/cssjit/SelectorCompiler.cpp:859 >> + minimum += minimumRequiredRegisterCount; > > I think it would be `+= backtrackingRegisterRequirements`. Is it correct?
Arg, ffs. I did a last minute change and I messed up the copy-paste. I am glad I asked you for a review.
Benjamin Poulain
Comment 7
2014-09-17 23:37:57 PDT
Created
attachment 238289
[details]
Patch
Benjamin Poulain
Comment 8
2014-09-17 23:43:17 PDT
You are right, this is wrong as you pointed out, minimumRequiredRegisterCount already account for the backtracking register. Looks like :nth-child() uses 6 registers in some path then. I'll look into it and upload a new patch asap.
Benjamin Poulain
Comment 9
2014-09-18 00:57:10 PDT
Created
attachment 238292
[details]
Patch
Benjamin Poulain
Comment 10
2014-09-18 00:58:33 PDT
Comment on
attachment 238292
[details]
Patch The patch is for the branches. ToT will get a different patch, I'll work that out tomorrow. The test is for ToT and the branches.
Benjamin Poulain
Comment 11
2014-09-18 12:49:30 PDT
Committed
r173730
: <
http://trac.webkit.org/changeset/173730
>
Benjamin Poulain
Comment 12
2014-09-18 17:38:57 PDT
Closing: Patch submitted in the branch. Test submitted in ToT. Added some code to catch such case earlier next time:
https://bugs.webkit.org/show_bug.cgi?id=136933
ToT does not need the extra register. There are two patch of maximum allocation: 1) currentElement 2) elementCounter 3) previousSibling 4) elementRareData 5) cachedChildIndex and 1) currentElement 2) elementCounter 3) checkingContext 4) childStyle 5) flags 6) isFirstChildStateFlagImmediate The second path is safe for now because it is only executed on for the rightmost element. By definition, it cannot have a backtracking register.
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