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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/bounds_checker.dart

Issue 1713983002: dart2js cps: Add SetLength instruction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Use trust-primitives and refine type of length to uint32' Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/builtin_operator.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.cps_ir.bounds_checker; 5 library dart2js.cps_ir.bounds_checker;
6 6
7 import 'cps_ir_nodes.dart'; 7 import 'cps_ir_nodes.dart';
8 import 'optimizers.dart' show Pass; 8 import 'optimizers.dart' show Pass;
9 import 'octagon.dart'; 9 import 'octagon.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 case BuiltinMethod.Push: 697 case BuiltinMethod.Push:
698 // after = before + count 698 // after = before + count
699 int count = node.arguments.length; 699 int count = node.arguments.length;
700 makeExactSum(lengthAfter, lengthBefore, count); 700 makeExactSum(lengthAfter, lengthBefore, count);
701 break; 701 break;
702 702
703 case BuiltinMethod.Pop: 703 case BuiltinMethod.Pop:
704 // after = before - 1 704 // after = before - 1
705 makeExactSum(lengthAfter, lengthBefore, -1); 705 makeExactSum(lengthAfter, lengthBefore, -1);
706 break; 706 break;
707
708 case BuiltinMethod.SetLength:
709 makeEqual(lengthAfter, getValue(node.arguments[0].definition));
710 break;
707 } 711 }
708 } 712 }
709 713
710 @override 714 @override
711 void visitLiteralList(LiteralList node) { 715 void visitLiteralList(LiteralList node) {
712 makeConstant(getLength(node, currentEffectNumber), node.values.length); 716 makeConstant(getLength(node, currentEffectNumber), node.values.length);
713 } 717 }
714 718
715 // ---------------- INTERIOR EXPRESSIONS -------------------- 719 // ---------------- INTERIOR EXPRESSIONS --------------------
716 720
(...skipping 24 matching lines...) Expand all
741 } 745 }
742 return node.body; 746 return node.body;
743 } 747 }
744 } 748 }
745 749
746 /// Lattice representing the known (weak) monotonicity of a loop variable. 750 /// Lattice representing the known (weak) monotonicity of a loop variable.
747 /// 751 ///
748 /// The lattice bottom is represented by `null` and represents the case where 752 /// The lattice bottom is represented by `null` and represents the case where
749 /// the loop variable never changes value during the loop. 753 /// the loop variable never changes value during the loop.
750 enum Monotonicity { NotMonotone, Increasing, Decreasing, } 754 enum Monotonicity { NotMonotone, Increasing, Decreasing, }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/builtin_operator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698