3 ms·
It's because back then V8 didn't save the AST in `SharedFunctionInfo`, so AST was inaccessible, so to avoid re-parsing and generating the AST to use AST-specifi
by spoiler 9y ago
It's because back then V8 didn't save the AST in `SharedFunctionInfo`, so AST was inaccessible, so to avoid re-parsing and generating the AST to use AST-specific heuristics for inlining big function bodies, it used just the source length as part of the inlining strategy. This has been fixed for a while now with TurboFan[0] (also, now you can call `ast_node_count()` and get the AST count directly).
[0]: https://github.com/v8/v8/wiki/TurboFan https://github.com/v8/v8/wiki/TurboFan
EDIT: added information about `ast_node_count()`