Summarizing the chat we had with Mads: 1. Doesn't this mean that we will always enter the runtime system for > calling > functions in arrays: a[0]()? This used to be a KeyedLoadIC followed by a > call > which is pretty fast. We should make sure that this is still fast. >
This has been my oversight. I hacked out a bit of code for smi-indexed fixed arrays from KeyedLoadIC::GenerateGeneric to CallIC::GenerateMegamorphic and it seems to be as fast as TOT. Now thinking how to do it right. > 2. Do we really want to have a megamorphic case here or do we want an > approach > more like for the KeyedLoadICs where we have a generic stub that handles > most > cases (array loads and the like) fairly well and just always go back to the > generic version on miss? > > The megamorphic case seems to work really well for some of the Closure tests. If I simply remove it the perf gain provided by my change goes down (from 27% to 11% for one of the tests, and the geometric mean goes from 16% to 12%). KeyedLoadIC::GenerateGeneric does a lot of useful things most of which can (and should) be reused in a fairly straightforward way. The only interesting question here is what to do for a symbol string key. KeyedLoadIC does a dictionary lookup while CallIC::GenerateMegamorphic does an IC cache lookup. I suspect CallIC::GenerateMegamorphic is faster when the IC cache contains many CONST_FUNCTION stubs, but for other cases I will need to experiment. Vlad On Thu, May 27, 2010 at 4:07 PM, <[email protected]> wrote: > First high-level comments without really reading much of the code: > > 1. Doesn't this mean that we will always enter the runtime system for > calling > functions in arrays: a[0]()? This used to be a KeyedLoadIC followed by a > call > which is pretty fast. We should make sure that this is still fast. > > 2. Do we really want to have a megamorphic case here or do we want an > approach > more like for the KeyedLoadICs where we have a generic stub that handles > most > cases (array loads and the like) fairly well and just always go back to the > generic version on miss? > > > http://codereview.chromium.org/2280007/show > -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
