On 2014/10/29 01:06:56, caitp wrote:
I've implemented arv@'s suggestion to generate code for untagged templates as
a
tree of BinaryOps --- it works pretty nicely, here's output from d8:

```
d8> function x(i) { print(i); return i; }
undefined
d8> `foo${x(1)}${x(2)}`
1
2
"foo12"
```

So I'll upload the changes and look at writing some test cases for it, but
it's
pretty cool. Unfortunately, tagged templates are still under water.

Right, the key issue with tagged is where and how to cache the template call
site.
We cannot cache it on AST node since AST nodes are very transient - they only exist while parsing and compiling. If the function is recompiled (e.g. by the
hydrogen) the AST is rebuilt.

I think the right way to proceed here would be to write a design doc (Google
docs work fine for this), and share it so that we can have a discussion on the
implemnentation there.


https://codereview.chromium.org/663683006/

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

Reply via email to