In builtin JS, there are so many `throw @TypeError(".....");` things. But it spreads so large byte code sequence, effectively enlarges the size of bytecodes, and prevent us from inlining! [ 15] resolve_scope loc8, loc3, PrivateSymbol.TypeError(@id0), <GlobalVar>, 0, 0x110bdc0a0 [ 22] get_from_scope loc9, loc8, PrivateSymbol.TypeError(@id0), 2049<ThrowIfNotFound|GlobalVar|NotInitialization>, 238692432 predicting None [ 30] mov loc12, loc9 [ 33] mov loc11, String (atomic) (identifier): Properties can only be defined on Objects., ID: 4(const0) [ 36] construct loc9, loc9, 2, 18 (this at loc12) status(Could Take Slow Path) predicting None [ 45] throw loc9 [ 47] ... Oh, it bloats 32 intructions! We already have great solution. Let's emit op_throw_static_error instead (size is only 3).
Some motivation: we would like to implement Object.defineProperty in builtin JS and allows it inlined. By doing so, property descriptor object { value: xxx } can get a chance to be allocation sinked in FTL. But it turns out that @TypeError etc. operations easily enlarge the size of byte code sequence and prevent us from inlining.
Created attachment 290786 [details] Patch
Comment on attachment 290786 [details] Patch Maybe it's worth fixing the builtins in WebCore too? Or maybe in a follow up patch?
(In reply to comment #3) > Comment on attachment 290786 [details] > Patch > > Maybe it's worth fixing the builtins in WebCore too? Or maybe in a follow up > patch? Yeah, it's worth fixing in WebCore! I'll upload it separately soon.
Committed r206853: <http://trac.webkit.org/changeset/206853>