We should probably rename the "call site object" to "template object" or
"template pattern object".

The OneByte vs TwoByte issues are not related to this CL so if my suspicions are
correct we can deal with it in a different CL.


https://codereview.chromium.org/742643003/diff/40001/src/harmony-templates.js
File src/harmony-templates.js (right):

https://codereview.chromium.org/742643003/diff/40001/src/harmony-templates.js#newcode45
src/harmony-templates.js:45: %MapSet(callSiteCache, hash,
%ArrayConcat(args));
The following looks cleaner to me.

var array = %MapGet(callSiteCache, hash);
if (IS_UNDEFINED(array)) {
  array = new InternalArray();
  %MapSet(callSiteCache, hash, array);
}
array.push(siteObj);

Push is safe on InternalArray.

https://codereview.chromium.org/742643003/diff/40001/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/742643003/diff/40001/src/parser.cc#newcode5287
src/parser.cc:5287: int num_dummy_chars = (total - 1) * 4;
Can you add a comment about why this is needed?

https://codereview.chromium.org/742643003/diff/40001/src/parser.cc#newcode5309
src/parser.cc:5309: source->ToCString(ALLOW_NULLS,
FAST_STRING_TRAVERSAL, span_start,
I'm actually starting to wonder if this is correct. Don't we want to
this to either be a 8bit or 16bit string?

https://codereview.chromium.org/742643003/diff/40001/src/parser.cc#newcode5327
src/parser.cc:5327: OneByteVector(raw_chars.get(), to_index));
I don't think this is correct. The string might need two bytes here.

https://codereview.chromium.org/742643003/

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