On Wed, Sep 30, 2015 at 6:59 PM, dmonji <[email protected]> wrote:
> I understand that inline caching is helpful only when a particular accesses
> is repeatedly executed at the same location.
>
> It does not consider the accesses made seperately.
>
>
> For example,
> for(i=0;i<1000;i++) obj.x;
>
> Here Inline caching will be helpful. But consider following
>
>
> obj.x; obj.x; .... 1000 times..
>
>
> In this case, inline caching is not helpful because each access is made
> independently. Is that true?
>
>
> If this is the case, what is the point of patching inline caching stub at
> locations/accesses which will not be repeated.

ICs are not patched in until the second time a property access is
executed.  The transition is UNINITIALIZED -> PREMONOMORPHIC ->
MONOMORPHIC.  In other words:

  function f(o) {
    return o.x;  // call site
  }
  var o = { x: 42 };
  f(o);  // call site is now premonomorphic
  f(o);  // call site is now monomorphic

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" 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.

Reply via email to