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

Issue 10558022: Better bitwise and binary arithmetic when the left operand is known to be a number. (Closed)

Created:
8 years, 6 months ago by kasperl
Modified:
8 years, 6 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Better bitwise and binary arithmetic when the left operand is known to be a primitive. R=ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8836

Patch Set 1 #

Patch Set 2 : Merge master. #

Patch Set 3 : Replace dominated uses. #

Patch Set 4 : Enable more argument type conversions. #

Total comments: 1

Patch Set 5 : Cleanup HTypeConversion usage. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -58 lines) Patch
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 4 5 chunks +20 lines, -13 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen_helpers.dart View 1 2 3 4 1 chunk +7 lines, -2 lines 2 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 2 3 4 6 chunks +35 lines, -38 lines 3 comments Download
M lib/compiler/implementation/ssa/types_propagation.dart View 1 2 3 4 4 chunks +77 lines, -0 lines 2 comments Download
M tests/compiler/dart2js/generate_at_use_site_test.dart View 1 2 3 4 1 chunk +8 lines, -1 line 0 comments Download
M tests/compiler/dart2js/mock_compiler.dart View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M tests/compiler/dart2js/type_guard_unuser_test.dart View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
kasperl
I'll do something about the HTypeConversion.arg flag -- either make this kind of type conversion ...
8 years, 6 months ago (2012-06-19 06:20:24 UTC) #1
Mads Ager (google)
This will be very nice. I like the idea of the three named constructors for ...
8 years, 6 months ago (2012-06-19 07:15:09 UTC) #2
kasperl
I found an interesting issue with the bitwise operation helpers in js_helpers.dart (they do not ...
8 years, 6 months ago (2012-06-19 09:06:48 UTC) #3
Mads Ager (google)
lgtm
8 years, 6 months ago (2012-06-19 09:10:21 UTC) #4
floitsch
LGTM but one big comment. https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/implementation/ssa/codegen_helpers.dart File lib/compiler/implementation/ssa/codegen_helpers.dart (right): https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/implementation/ssa/codegen_helpers.dart#newcode55 lib/compiler/implementation/ssa/codegen_helpers.dart:55: // once, so we ...
8 years, 6 months ago (2012-06-19 11:15:58 UTC) #5
kasperl
8 years, 6 months ago (2012-06-19 11:22:06 UTC) #6
https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/imple...
File lib/compiler/implementation/ssa/codegen_helpers.dart (right):

https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/imple...
lib/compiler/implementation/ssa/codegen_helpers.dart:55: // once, so we can
safely visit them an try to merge the input.
On 2012/06/19 11:15:58, floitsch wrote:
> and

Done.

https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/imple...
File lib/compiler/implementation/ssa/nodes.dart (right):

https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/imple...
lib/compiler/implementation/ssa/nodes.dart:943: bool isConstantInteger() =>
false;
On 2012/06/19 11:15:58, floitsch wrote:
> move next to isConstantNumber

Done.

https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/imple...
File lib/compiler/implementation/ssa/types_propagation.dart (right):

https://chromiumcodereview.appspot.com/10558022/diff/12001/lib/compiler/imple...
lib/compiler/implementation/ssa/types_propagation.dart:44: if
(!left.isInteger()) convertInput(instruction, left, HType.INTEGER);
On 2012/06/19 11:15:58, floitsch wrote:
> we cannot convert an input until the type-propagation is stable.
> Failing example:
> 
> bar(t) => t;
> 
> foo(y) {
>   var x = 3;
>   for (int i = 0; i < 2; i++) {
>     if (i == 1) bar(x + y);
>     x = new A();
>   }
> }
> 
> class A {
>   A() {}
>   operator +(x) => x;
> }
> 
> main() {
>   foo("str");
> }

Yeah, that's a good point. I'll fix it and send you the CL.

Powered by Google App Engine
This is Rietveld 408576698