The 'typeof' operator now accounts for about 4.7% of the Shark profile of the V8 Earley-Boyer benchmark. We should look at optimizing it, probably taking advantage of StructureIDs. A lot of the examples in Earley-Boyer are of the form typeof <expression> == <string> We can optimize these using a peephole optimization in CodeGenerator and some new opcodes. I'll assign this to myself.
Created attachment 23407 [details] Proposed patch This patch is a 6% speedup on Earley-Boyer, but it unfortunately triggers the Richards compilation-related badness on my machine. I will try again soon.
Created attachment 23423 [details] Proposed patch with ChangeLog
Comment on attachment 23423 [details] Proposed patch with ChangeLog Oops, I posted the wrong typeof patch.
Created attachment 23424 [details] Proposed patch with ChangeLog
Comment on attachment 23424 [details] Proposed patch with ChangeLog r=me subject to comments from IRC.
Landed with requested changes in r36412.