I think this is the wrong approach to tackle this problem. And (again) I
think
this should be split up into multiple CLs.
It's fine to hack something like this together to measure the benefits, but
we'll never land such local hard/hand-coded optimizations. Once you see that
benefits are to be had of a certain optimization, think of a general
framework
that fits within what we already have. And make sure that either there can
be
future extensions to the framework, or that your extension is really a
leaf-extension (such as inlining kArraySlice). But even in that example,
there
should be a framework for inlining builtins, rather than a local hack, and a
single such framework that's usable by everyone who tries to inline
builtins.
As for this CL, what you want to do is first support .call in a similar way
to
how .apply works. It just sets up the method, receiver and arguments and
make a
call (which may be inlined). Then use the
regular "TryInlineBuiltinMethodCall"
to inline kArraySlice.
Lastly, finding out whether we are calling .call on Array.prototype.slice
might
need some guessing, but you surely shouldn't be using a runtime call to
locally
disable assumptions. There should be a general framework behind it.
But before we dive into that, I actually doubt it will even be necessary. If
it's actually written as Array.prototype.slice.call, or even [].slice.call,
we
can load both Array.prototype and [] as HConstants, from which we can
probably
gather that .slice is that builtin, etc. That by itself might need some
extra
work to avoid deopts due to missing feedback. But whenever we have static
guarantees we shouldn't be inserting soft-deopts anyway (if we are).
https://codereview.chromium.org/327173002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.