Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Issue 175403002: GenerateNot was not respecting "generateAtUseSite". (Closed)

Created:
6 years, 10 months ago by floitsch
Modified:
6 years, 10 months ago
Reviewers:
sra1, ngeoffray, kasperl
CC:
reviews_dartlang.org, kasperl
Visibility:
Public.

Description

GenerateNot 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -5 lines) Patch
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 2 chunks +3 lines, -5 lines 0 comments Download
M tests/compiler/dart2js/dart2js.status View 1 chunk +2 lines, -0 lines 2 comments Download
A tests/compiler/dart2js/logical_expression_test.dart View 1 1 chunk +47 lines, -0 lines 0 comments Download
A tests/language/logical_expression_test.dart View 1 chunk +119 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
floitsch
6 years, 10 months ago (2014-02-21 17:41:17 UTC) #1
ngeoffray
DBC Pretty bad bug.... https://codereview.chromium.org/175403002/diff/1/tests/compiler/dart2js/logical_expression_test.dart File tests/compiler/dart2js/logical_expression_test.dart (right): https://codereview.chromium.org/175403002/diff/1/tests/compiler/dart2js/logical_expression_test.dart#newcode1 tests/compiler/dart2js/logical_expression_test.dart:1: // Copyright (c) 2012, the ...
6 years, 10 months ago (2014-02-21 17:52:26 UTC) #2
floitsch
https://codereview.chromium.org/175403002/diff/1/tests/compiler/dart2js/logical_expression_test.dart File tests/compiler/dart2js/logical_expression_test.dart (right): https://codereview.chromium.org/175403002/diff/1/tests/compiler/dart2js/logical_expression_test.dart#newcode1 tests/compiler/dart2js/logical_expression_test.dart:1: // Copyright (c) 2012, the Dart project authors. Please ...
6 years, 10 months ago (2014-02-21 18:35:26 UTC) #3
sra1
lgtm
6 years, 10 months ago (2014-02-22 01:41:54 UTC) #4
kasperl
https://codereview.chromium.org/175403002/diff/80001/tests/compiler/dart2js/dart2js.status File tests/compiler/dart2js/dart2js.status (right): https://codereview.chromium.org/175403002/diff/80001/tests/compiler/dart2js/dart2js.status#newcode16 tests/compiler/dart2js/dart2js.status:16: logical_expression_test: Fail # Issue 17027 This is just a ...
6 years, 10 months ago (2014-02-22 13:16:40 UTC) #5
floitsch
https://codereview.chromium.org/175403002/diff/80001/tests/compiler/dart2js/dart2js.status File tests/compiler/dart2js/dart2js.status (right): https://codereview.chromium.org/175403002/diff/80001/tests/compiler/dart2js/dart2js.status#newcode16 tests/compiler/dart2js/dart2js.status:16: logical_expression_test: Fail # Issue 17027 On 2014/02/22 13:16:41, kasperl ...
6 years, 10 months ago (2014-02-22 20:53:08 UTC) #6
floitsch
6 years, 10 months ago (2014-02-24 07:25:52 UTC) #7
Message was sent while issue was closed.
Committed patchset #3 manually as r32951 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698