Well that depends on where the function comes from. In baseline code we
have a load before the call, and the inline cache records what has been
loaded. When we compile optimized code, the recorded callees tell us what
to inline. Before calling the inlined code we indeed have to check that the
callee is the expected function.

On Tue, Oct 18, 2016, 22:20 Dean McNamee <de...@chromium.org> wrote:

> Thanks.  Then what does the generated code look like, does it need to
> do a check to make sure that Math.abs hasn't changed?
>
> On Tue, Oct 18, 2016 at 10:10 PM, Yang Guo <yang...@chromium.org> wrote:
> > Iirc we inline by recognizing the function object, not by recognizing
> that
> > it's stored as Math.abs. I.e. we compare the inlinee to the known
> Math.abs
> > function object.
> >
> > Yang
> >
> >
> > On Tue, Oct 18, 2016, 21:45 Dean McNamee <de...@chromium.org> wrote:
> >>
> >> Sorry, I'm sure this has been discussed before but I couldn't find the
> >> answer.  If I understand correctly, it's possible to inline things
> >> like Math.abs.  How exactly does that work if later on some other code
> >> overwrites Math.abs?  Is there some guard in the generated code or
> >> some sort of barrier upon overwriting Math.abs that expires the code?
> >>
> >> Thanks!
> >>
> >> --
> >> --
> >> v8-dev mailing list
> >> v8-dev@googlegroups.com
> >> 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 v8-dev+unsubscr...@googlegroups.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > --
> > v8-dev mailing list
> > v8-dev@googlegroups.com
> > 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 v8-dev+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> v8-dev mailing list
> v8-dev@googlegroups.com
> 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 v8-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to