https://codereview.chromium.org/657893003/diff/1/src/ast.h
File src/ast.h (right):

https://codereview.chromium.org/657893003/diff/1/src/ast.h#newcode3404
src/ast.h:3404: const AstValue* value = b ?
ast_value_factory_->true_value()
On 2014/10/23 12:27:32, marja wrote:
On 2014/10/23 12:12:21, rossberg wrote:
> Instead of making these changes here, can't we encapsulate the
caching by
having
> the respective New operators just return the cached versions
internally?

Do you mean only for booleans (true_value & false_value), or for all
changes in
this file (undefined_value instead of NewUndefined)?

I think this version is clearer, since it makes it clear when new
stuff is
created (NewSomething, such as NewConsString, returns a new object,
things like
null_value() and this_string() return pointers to cached objects).

For all. It's preferable because it properly abstracts caching as an
implementation detail instead of leaking it into the interface. That's
more uniform and more extensible (e.g., one might implement caching of
some common number literals as well). The calling code shouldn't need to
care.

https://codereview.chromium.org/657893003/

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