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

Issue 10539042: Recognize nested logical operations. (Closed)

Created:
8 years, 6 months ago by ngeoffray
Modified:
8 years, 6 months ago
CC:
reviews_dartlang.org, floitsch, karlklose, ahe
Visibility:
Public.

Description

Recognize nested logical operations. Committed: https://code.google.com/p/dart/source/detail?r=8393

Patch Set 1 : #

Total comments: 2

Patch Set 2 : #

Total comments: 11

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -22 lines) Patch
M lib/compiler/implementation/ssa/codegen.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/ssa/codegen_helpers.dart View 1 2 3 3 chunks +37 lines, -21 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
ngeoffray
8 years, 6 months ago (2012-06-07 07:56:06 UTC) #1
floitsch
DBC. https://chromiumcodereview.appspot.com/10539042/diff/2001/lib/compiler/implementation/ssa/codegen.dart File lib/compiler/implementation/ssa/codegen.dart (right): https://chromiumcodereview.appspot.com/10539042/diff/2001/lib/compiler/implementation/ssa/codegen.dart#newcode1728 lib/compiler/implementation/ssa/codegen.dart:1728: // This method is only called for phis ...
8 years, 6 months ago (2012-06-07 09:23:23 UTC) #2
ngeoffray
https://chromiumcodereview.appspot.com/10539042/diff/2001/lib/compiler/implementation/ssa/codegen.dart File lib/compiler/implementation/ssa/codegen.dart (right): https://chromiumcodereview.appspot.com/10539042/diff/2001/lib/compiler/implementation/ssa/codegen.dart#newcode1728 lib/compiler/implementation/ssa/codegen.dart:1728: // This method is only called for phis that ...
8 years, 6 months ago (2012-06-07 10:05:48 UTC) #3
Lasse Reichstein Nielsen
LGTM http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation/ssa/codegen_helpers.dart File lib/compiler/implementation/ssa/codegen_helpers.dart (right): http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation/ssa/codegen_helpers.dart#newcode157 lib/compiler/implementation/ssa/codegen_helpers.dart:157: && instruction !== block.last.previous) return true; Putting "&&" ...
8 years, 6 months ago (2012-06-07 12:02:46 UTC) #4
ngeoffray
8 years, 6 months ago (2012-06-07 12:39:18 UTC) #5
Thanks Lasse.

http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation...
File lib/compiler/implementation/ssa/codegen_helpers.dart (right):

http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation...
lib/compiler/implementation/ssa/codegen_helpers.dart:195: if (elseBlock.first
!== elseBlock.last) return;
On 2012/06/07 12:02:47, Lasse Reichstein Nielsen wrote:
> Or "if (elseBlock.first is! HGoto) return;"?

Done.

http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation...
lib/compiler/implementation/ssa/codegen_helpers.dart:200: && thenBlock.first ==
thenBlock.last
On 2012/06/07 12:02:47, Lasse Reichstein Nielsen wrote:
> You could just check that thenBlock.first is HGoto.

Done.

http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation...
lib/compiler/implementation/ssa/codegen_helpers.dart:208: // have statements, we
can emit a sequence of logical operation.
On 2012/06/07 12:02:47, Lasse Reichstein Nielsen wrote:
> "have a statement" to match the call to "hasStatement" below.

Done.

http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation...
lib/compiler/implementation/ssa/codegen_helpers.dart:219:
assert(thenInput.usedBy.length == 1);
On 2012/06/07 12:02:47, Lasse Reichstein Nielsen wrote:
> Can't it also be used internally in the block?

No, because otherwise there would be an instruction in-between the instruction
and the control flow instruction, which I guard against in hasStatement. I added
a comment.

http://codereview.chromium.org/10539042/diff/4002/lib/compiler/implementation...
lib/compiler/implementation/ssa/codegen_helpers.dart:227: // and the join branch
to have more than two predecessors.
On 2012/06/07 12:02:47, Lasse Reichstein Nielsen wrote:
> Then check if that's the case and return if it isn't.
> Before setting the generateAtUseSite bit.

Added asserts instead.

Powered by Google App Engine
This is Rietveld 408576698