https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc
File src/compiler/ast-graph-builder.cc (right):
https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016
src/compiler/ast-graph-builder.cc:2016: if
(variable->IsSignallingAssignmentToConst(op, strict_mode())) {
On 2014/11/25 15:51:01, Dmitry Lomov (chromium) wrote:
On 2014/11/25 15:23:36, rossberg wrote:
> I'm not sure I like this factorisation, since it breaks the symmetry
with the
> other cases below and thereby makes the code less readable. It also
duplicates
> some of the cases analysis. Better factor it out into the two
relevant cases
> below.
>
> Michi, what do you think?
I'd prefer to share logic with the backends. Michi?
Well, sharing the logic would make sense if we did so consistently for
the rest of this branching logic as well. But arbitrarily picking one
case for a remote helper function is "spurious abstraction" -- which is
harmful because it pretends there is something special going on when
there isn't.
So unless you think there is benefit in also introducing
IsSignallingTheHoleAssignment, IsSilentlyIgnoredAssignment and
IsSilentlyIgnoredButSignallingTheHoleAssignment, you don't want to
introduce this one. ;)
https://codereview.chromium.org/749633002/diff/80001/src/variables.h
File src/variables.h (right):
https://codereview.chromium.org/749633002/diff/80001/src/variables.h#newcode142
src/variables.h:142: if (mode() == CONST) return op !=
Token::INIT_CONST;
On 2014/11/25 15:51:01, Dmitry Lomov (chromium) wrote:
On 2014/11/25 15:23:36, rossberg wrote:
> Hm, wouldn't it be easier and more accurate to implement this as
follows:
>
> if (strict_mode = SLOPPY) return false;
> if (op == Token::INIT_CONST || op == Token::INIT_CONST_LEGACY)
return false;
> return mode() == CONST || mode() == CONST_LEGACY;
Hmm, I like my version better since it puts the variable mode first.
I did a hybrid of the two which I think is more readable
Looks good.
https://codereview.chromium.org/749633002/
--
--
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.