Bug 40415 - [Qt] Optimization of the QScriptValuePrivate.
Summary: [Qt] Optimization of the QScriptValuePrivate.
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jędrzej Nowacki
Keywords: Qt, QtTriaged
Depends on: 40412
Blocks: 31863
  Show dependency treegraph
Reported: 2010-06-10 03:28 PDT by Jędrzej Nowacki
Modified: 2010-06-23 18:49 PDT (History)
4 users (show)

See Also:

Fix v1 (15.87 KB, patch)
2010-06-10 03:54 PDT, Jędrzej Nowacki
eric: commit-queue-
Details | Formatted Diff | Diff
Fix (15.87 KB, patch)
2010-06-14 02:00 PDT, Jędrzej Nowacki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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]

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]

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.