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

Issue 1393763004: dart2js cps_ir: BuiltinOperation improvements. (Closed)

Created:
5 years, 2 months ago by sra1
Modified:
5 years, 2 months ago
Reviewers:
asgerf
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js cps_ir: BuiltinOperation improvements Type propagation: Added better type_propagation rules for various operators to detect more uint31/uint32/non-negative cases. Moved the rules to per-operator code so the rules can be shared by invokes (e.g. '<') and the builtin operations they are lowered to (NumLt). In the case of NumLt, this removes lower bounds checks from injected bounds checks (i.e. NumLt(index, 0)) for constant indexes by simple constant folding. Bit operations: The '>>> 0' coercion is often not needed. If we can tell the result is in the uint31 range then the result generated by JavaScript's bit operations will not have become negative. Added a tree analysis to codegen to tell if the result fits in uint31. This works quite well and removes about as many coercions as SSA. It misses some coercions due to lack of type information in tree_ir. Added missing operators: NumShr aka '>>>', valid on limited inputs. NumDiv (Seems like a simple omission, boost some math code) NumTruncatingDivideToSigned32 R=asgerf@google.com Committed: https://github.com/dart-lang/sdk/commit/5ac49b5f2959f1c017d6e08a9420e14a897d8e09

Patch Set 1 : #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+488 lines, -49 lines) Patch
M pkg/compiler/lib/src/cps_ir/builtin_operator.dart View 2 chunks +17 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_mask_system.dart View 1 2 chunks +19 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/cps_ir/type_propagation.dart View 1 10 chunks +369 lines, -43 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/codegen/codegen.dart View 1 3 chunks +81 lines, -4 lines 0 comments Download
M tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (3 generated)
sra1
This brings cps_ir into the same kind of quality as SSA for bit arithmetic. Still ...
5 years, 2 months ago (2015-10-10 02:31:51 UTC) #4
asgerf
Very nice, LGTM! And thanks for tying up some of the loose ends I've left ...
5 years, 2 months ago (2015-10-12 09:23:12 UTC) #5
sra1
5 years, 2 months ago (2015-10-12 19:29:21 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:60001) manually as
5ac49b5f2959f1c017d6e08a9420e14a897d8e09 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698