If I understand this correctly:
- the first time we execute a regexp on an input, we set saveAnswer to false
(cache miss)
- the second time we execute a regexp on the same input (first cache hit), we
set saveAnswer to true and saves and clones the result.
- any subsequent time we execute the regexp on the same input (further cache
hits), we return a clone of the result.

This avoids a cloning of the result of regexps that are only executed once.

If this is correct, LGTM.

http://codereview.chromium.org/1556019/show

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

To unsubscribe, reply using "remove me" as the subject.

Reply via email to