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.
Created attachment 7075 [details] this could reduce memory use by a decent chunk for big widgets
Also <rdar://problem/4478522>
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 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.