DescriptionGenerateNot was not respecting "generateAtUseSite".
This fixes a severe issue when the first condition of a logical-or was used
by more than one expression.
Example:
var cond = foo();
if (cond || bar()) ...
if (cond || gee()) ...
An intermediate step transformed this into:
var t1 = !foo(); // <== note the "!".
if (t1) if (bar()) -> jump to correct block
if (t1) if (gee()) -> jump to correct block.
The variable 't1' was marked as "not-generate-at-use-site", since it
was shared between the two 'ifs'.
Later we realize that we want to emit a logical or.
However, in the back-end we had an optimization that basically said:
if we produce a logical or, we have to invert the first argument.
if that argument is a Not, we can ignore the Not-node and use its expression
directly.
This jumped over the "not-generate-at-use-site" of the Not node, and
looked directly at "cond", which was allowed to be generated at
use-site (at the initialization of "t1").
BUG= http://dartbug.com/16996
R=sra@google.com
Committed: https://code.google.com/p/dart/source/detail?r=32951
Patch Set 1 #
Total comments: 4
Patch Set 2 : Address Nicolas' comments. #Patch Set 3 : Address Nicolas' comments. (reupload:500) #
Total comments: 2
Messages
Total messages: 7 (0 generated)
|