Comment #6 on issue 3814 by ape...@igalia.com: Support context-allocated “this” in Crankshaft
https://code.google.com/p/v8/issues/detail?id=3814

You can take a look at what I have working (for x64) in this CL:
  https://codereview.chromium.org/791603003/

In short:

 - When generating code for non-arrow function, *if* (and only if) it
   contains an arrow function *and* the arrow function uses “this”:
    → Then code is added to save a copy of the receiver in the context.

 - When generating code for an arrow function, *if* (and only if) it
   uses “this”:
    → Then code is added to the prologue of the arrow function to lookup
      the value of the receiver from the context chain, and the value
      retrieved from the context is copied to the appropiate place in the
      stack.

I think this is a reasonable approach and it has zero overhead even when
arrow functions are used, as long as “this” is not used inside them. Also
note that the receiver is looked up from the context only once in the
function prologue, so repeated usage of “this” inside an arrow function
does not have any other overhead.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
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