Constant fold !{number} in the parser
Created attachment 179839 [details] Patch
Comment on attachment 179839 [details] Patch R=me We should have the parser do more extensive constant folding. It will reduce (a) reduce amount of bytecode, (b) reduce amount of baseline JIT machine code, and (c) reduce the amount of work that the DFG has to do.
Committed r137988: <http://trac.webkit.org/changeset/137988>
The comment makes it sound like you’d want to do this for other constant nodes such as NullNode, BooleanNode, StringNode, RegExpNode, ThisNode, and ArrayNode. I’m assuming we don’t do that because the only cases that are actually common are !0 and !1, not, say !null or !true or !false. Since we’re already calling a virtual function just to find out it’s a number node it seems like we could do a version with more coverage. The only cost of this seems to be more code in Nodes.h/cpp.