Bug 131237 - Use preallocated stack reference to store adjacentBacktrackingStart
Summary: Use preallocated stack reference to store adjacentBacktrackingStart
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-04 12:14 PDT by Yusuke Suzuki
Modified: 2014-04-06 21:53 PDT (History)
2 users (show)

See Also:


Attachments
Patch (11.06 KB, patch)
2014-04-04 12:29 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (11.08 KB, patch)
2014-04-05 00:42 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2014-04-04 12:14:40 PDT
Instead of using push / pop, allocate stack reference in prologue and store adjacentBacktrackingStart to it.
Comment 1 Yusuke Suzuki 2014-04-04 12:29:31 PDT
Created attachment 228614 [details]
Patch
Comment 2 Benjamin Poulain 2014-04-04 15:12:55 PDT
Comment on attachment 228614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=228614&action=review

Everything looks correct to me.  CQ- because of two nitpicks.

> Source/WebCore/cssjit/SelectorCompiler.cpp:210
> +    bool m_needsAdjacentBacktrackingStart : 1;

You should not use a bit field here.

I would put the field just after m_selectorFragments since it is related to a global state of code generation.

> Source/WebCore/cssjit/StackAllocator.h:63
> +    StackReference push()

The name push() is a bit misleading. I think allocate() or allocateUninitialized() would be better.
Comment 3 Yusuke Suzuki 2014-04-05 00:42:55 PDT
Created attachment 228665 [details]
Patch
Comment 4 Yusuke Suzuki 2014-04-05 00:46:38 PDT
Comment on attachment 228614 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=228614&action=review

Thank you for your review!
I've fixed and attached revised patch.

>> Source/WebCore/cssjit/SelectorCompiler.cpp:210
>> +    bool m_needsAdjacentBacktrackingStart : 1;
> 
> You should not use a bit field here.
> 
> I would put the field just after m_selectorFragments since it is related to a global state of code generation.

Thank you! You're right.
I've removed a bit field. And moved m_needsAdjacentBacktrackingStart to just after m_selectorFragments.

>> Source/WebCore/cssjit/StackAllocator.h:63
>> +    StackReference push()
> 
> The name push() is a bit misleading. I think allocate() or allocateUninitialized() would be better.

Right. I've renamed it to allocateUninitialized.
Comment 5 Benjamin Poulain 2014-04-05 12:03:57 PDT
Comment on attachment 228665 [details]
Patch

Everything looks good to me.
Comment 6 WebKit Commit Bot 2014-04-05 12:32:25 PDT
Comment on attachment 228665 [details]
Patch

Clearing flags on attachment: 228665

Committed r166834: <http://trac.webkit.org/changeset/166834>
Comment 7 WebKit Commit Bot 2014-04-05 12:32:29 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Yusuke Suzuki 2014-04-06 21:53:57 PDT
Thank you!