[Webkit-unassigned] [Bug 131515] Inlining native functions into the JavaScript in the FTL

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 11 17:22:37 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=131515





--- Comment #8 from Matthew Mirman <mmirman at apple.com>  2014-04-11 17:22:56 PST ---
(In reply to comment #6)
> (From update of attachment 229180 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=229180&action=review
> 
> Does this have heuristics for deciding not to inline functions that are too big?  

I'm relying on the LLVM's heuristics to do that. http://llvm.org/docs/doxygen/html/InlinerPass_8h_source.html

> What is the performance impact?

I'm not exactly sure.  Loading the symbol table is a pretty trivial one time cost.   Loading each llvm module appears to be pretty quick and is also a one time cost per module.

> > Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp:3584
> > +                llvm->GetParamTypes(tyCallee, &tyCalleeArg);
> > +                LValue call = m_out.call(callee, 
> > +                    m_out.bitCast(m_out.address(m_execState, m_heaps.CallFrame_callerFrame ).value(), tyCalleeArg));
> 
> This doesn't actually inline, right?  If so, you should either change the name of this bug, or implement the inlining.  That probably involves adding some inlining phases to the LLVM pipeline in FTLCompile.cpp.

I'm not certain, but I'm pretty sure LLVM does the inlining in the optimization pass.  Remember when we were debugging the segfault on the random inline test and noticed that the resulting assembly for "foo" was gigantic?   I was under the impression that this was because "random" had been inlined.   Of course, the heuristics could get more interesting since we know something about the heat of individual paths, and llvm includes a tag which you can paste to a function in a module which tells it either to always inline or never inline it (I wonder if the "always inline" is as much of a lie as it is for C).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list