Bug 40415

Summary: [Qt] Optimization of the QScriptValuePrivate.
Product: WebKit Reporter: Jędrzej Nowacki <jedrzej.nowacki>
Component: JavaScriptCoreAssignee: Jędrzej Nowacki <jedrzej.nowacki>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, jedrzej.nowacki, kenneth, kent.hansen
Priority: P2 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 40412    
Bug Blocks: 31863    
Attachments:
Description Flags
Fix v1
eric: commit-queue-
Fix none

Description Jędrzej Nowacki 2010-06-10 03:28:17 PDT
The QScriptValuePrivate can optimized. Now, each state have a separate attribute in which his value is kept. So, for the CString state the value is stored in m_string, for CNumber it is m_numbe... It would be much better to store the value in an union to save a memory and maybe unnecessary initialization.
Comment 1 Jędrzej Nowacki 2010-06-10 03:54:55 PDT
Created attachment 58358 [details]
Fix v1

NOTE: The patch can be applied after 40412.
Comment 2 Jędrzej Nowacki 2010-06-11 07:58:02 PDT
Bug 40412 is closed. Should I reapply the patch to bugzilla?
Comment 3 Eric Seidel (no email) 2010-06-12 20:36:49 PDT
Comment on attachment 58358 [details]
Fix v1

This patch can't be landed by the commit-queue since it does not apply.
Comment 4 Jędrzej Nowacki 2010-06-14 02:00:06 PDT
Created attachment 58630 [details]
Fix
Comment 5 Jędrzej Nowacki 2010-06-14 03:57:56 PDT
(In reply to comment #3)
> (From update of attachment 58358 [details])
> This patch can't be landed by the commit-queue since it does not apply.

Does it mean that commit-queue would block it? As I worte the patch couldn't be applied before 40412, I posted it for review.

I have uploaded the same patch again.
Comment 6 Kent Hansen 2010-06-22 06:58:12 PDT
Patch applies cleanly now and looks OK.
As we discussed offline, one could use an anonymous union; this reduces the size of the patch. However, the "u." does make it more apparent that it's a union that's being manipulated. (I'm not aware of any WebKit style guidelines for unions, their naming etc.)
Comment 7 Simon Hausmann 2010-06-23 03:07:36 PDT
Comment on attachment 58630 [details]
Fix

r=me. This miight cause problems with non-gcc compilers in the future, but let's deal with that when we cross that bridge :). This certainly improves the readability at lot, too.
Comment 8 WebKit Commit Bot 2010-06-23 18:49:29 PDT
Comment on attachment 58630 [details]
Fix

Clearing flags on attachment: 58630

Committed r61726: <http://trac.webkit.org/changeset/61726>
Comment 9 WebKit Commit Bot 2010-06-23 18:49:34 PDT
All reviewed patches have been landed.  Closing bug.