Bug 7775 - KJS::Node and KJS::StatementNode are bigger than they need to be
Summary: KJS::Node and KJS::StatementNode are bigger than they need to be
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Maciej Stachowiak
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2006-03-14 23:10 PST by Maciej Stachowiak
Modified: 2006-03-17 14:48 PST (History)
0 users

See Also:


Attachments
this could reduce memory use by a decent chunk for big widgets (32.34 KB, patch)
2006-03-14 23:12 PST, Maciej Stachowiak
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2006-03-14 23:10:38 PST
KJS::Node and KJS::StatementNode are bigger than they need to be. Many fields could be removed entirely, or the info could be stored elsewhere more efficiently.
Comment 1 Maciej Stachowiak 2006-03-14 23:12:49 PST
Created attachment 7075 [details]
this could reduce memory use by a decent chunk for big widgets
Comment 2 Maciej Stachowiak 2006-03-14 23:15:49 PST
Also <rdar://problem/4478522>
Comment 3 Anders Carlsson 2006-03-14 23:34:30 PST
Comment on attachment 7075 [details]
this could reduce memory use by a decent chunk for big widgets

Just two small comments:

+        (KJS::StatementNode::lastLine): Renamed l1 to m_line

this should be m_lastLine

+    int m_lastLine;;

has an extra semi-colon.

Otherwise, looks great!
Comment 4 Darin Adler 2006-03-15 09:36:42 PST
Comment on attachment 7075 [details]
this could reduce memory use by a decent chunk for big widgets

I'd like to see more consistency assertions.

For example, an assertion that a node is either in newNodes or nodeExtraRefCounts but not both. An assertion in Node::deref that the node is not in newNodes. An assertion in clearNewNodes that none of the nodes in newNodes are also in nodeExtraRefCounts. None of these are likely to immediately find a problem, but I'd like to have those.

Instead of implementing Node::refcount() I think you should have removed the function. I can't find a single caller.

I'm surprised by the use of "unsigned int". Do we use "unsigned" or "unsigned int", idiomatically?

Very nice stuff. I'd been wondering for a long time why every single object needed a source URL and this seems a good solution.