https://codereview.chromium.org/768203002/diff/1/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/768203002/diff/1/src/parser.cc#newcode5311
src/parser.cc:5311: StringCharacterStream
stream(String::cast(script()->source()), span_start);
On 2014/12/01 20:05:15, caitp wrote:
On 2014/12/01 20:01:34, marja wrote:
> Oops; this problem was already present before this CL: We might not
have the
> source string yet. In the streaming parsing case, we don't have it.
:/
>
> Can we get the string from somewhere else? Can we delay constructing
the raw
> strings until they're really needed? (I probably thought that
they're
> constructed on demand, not parse time, when I originally thought
this would
> work...)

I see.

What happens is, we are setting up some array literals to pass to
GetTemplateCallSite(), which will use them to produce the objects it
needs ---
perhaps we could pass the offsets to that function instead, and use a
runtime
function to fetch the strings?

But the trouble with this is that it would always be a runtime
operation, and
we'd have to do it every single time a tagged template is invoked....

An alternative solution would be to ensure that source is available,
somehow...

We'll have to think a bit more about this. The source code up to the end
of the template literal has been parsed before we get here. Maybe we
should just get the source from the Scanner here.

https://codereview.chromium.org/768203002/diff/1/src/parser.cc#newcode5314
src/parser.cc:5314: for (int from_index = 0; from_index < length &&
stream.HasMore();
On 2014/12/01 19:58:05, Dmitry Lomov (chromium) wrote:
Can you assert that at the end of this loop, always !stream.HasMore()
(I believe
that should be true if this algo is correct?)

The stream is on the entire script so it will most likely have more
characters.

https://codereview.chromium.org/768203002/diff/1/src/parser.cc#newcode5326
src/parser.cc:5326: normalized_raw_chars[to_index++] = ch;
On 2014/12/01 19:57:36, caitp wrote:
move `last_was_cr = false;` here I think? (then can remove the
`continue` also)

We need to reset it even if last_was_cr was true.

I tried a different forms for this logic and none of them turned out
nice.

https://codereview.chromium.org/768203002/

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