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

Side by Side Diff: test/codegen/expect/DeltaBlue.js

Issue 1099333002: canonicalize const (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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 | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/sunflower/dom.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 var DeltaBlue; 1 var DeltaBlue;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 // Function main: () → dynamic 4 // Function main: () → dynamic
5 function main() { 5 function main() {
6 new DeltaBlue().report(); 6 new DeltaBlue().report();
7 } 7 }
8 class DeltaBlue extends BenchmarkBase.BenchmarkBase { 8 class DeltaBlue extends BenchmarkBase.BenchmarkBase {
9 DeltaBlue() { 9 DeltaBlue() {
10 super.BenchmarkBase("DeltaBlue"); 10 super.BenchmarkBase("DeltaBlue");
11 } 11 }
12 run() { 12 run() {
13 chainTest(100); 13 chainTest(100);
14 projectionTest(100); 14 projectionTest(100);
15 } 15 }
16 } 16 }
17 class Strength extends core.Object { 17 class Strength extends core.Object {
18 Strength(value, name) { 18 Strength(value, name) {
19 this.value = value; 19 this.value = value;
20 this.name = name; 20 this.name = name;
21 } 21 }
22 nextWeaker() { 22 nextWeaker() {
23 return /* Unimplemented const */dart.setType([STRONG_PREFERRED, PREFERRED, STRONG_DEFAULT, NORMAL, WEAK_DEFAULT, WEAKEST], core.List$(Strength))[core.$get ](this.value); 23 return dart.const(dart.setType([STRONG_PREFERRED, PREFERRED, STRONG_DEFAUL T, NORMAL, WEAK_DEFAULT, WEAKEST], core.List$(Strength)))[core.$get](this.value) ;
24 } 24 }
25 static stronger(s1, s2) { 25 static stronger(s1, s2) {
26 return dart.notNull(s1.value) < dart.notNull(s2.value); 26 return dart.notNull(s1.value) < dart.notNull(s2.value);
27 } 27 }
28 static weaker(s1, s2) { 28 static weaker(s1, s2) {
29 return dart.notNull(s1.value) > dart.notNull(s2.value); 29 return dart.notNull(s1.value) > dart.notNull(s2.value);
30 } 30 }
31 static weakest(s1, s2) { 31 static weakest(s1, s2) {
32 return Strength.weaker(s1, s2) ? s1 : s2; 32 return Strength.weaker(s1, s2) ? s1 : s2;
33 } 33 }
34 static strongest(s1, s2) { 34 static strongest(s1, s2) {
35 return Strength.stronger(s1, s2) ? s1 : s2; 35 return Strength.stronger(s1, s2) ? s1 : s2;
36 } 36 }
37 } 37 }
38 let REQUIRED = new Strength(0, "required"); 38 let REQUIRED = dart.const(new Strength(0, "required"));
39 let STRONG_PREFERRED = new Strength(1, "strongPreferred"); 39 let STRONG_PREFERRED = dart.const(new Strength(1, "strongPreferred"));
40 let PREFERRED = new Strength(2, "preferred"); 40 let PREFERRED = dart.const(new Strength(2, "preferred"));
41 let STRONG_DEFAULT = new Strength(3, "strongDefault"); 41 let STRONG_DEFAULT = dart.const(new Strength(3, "strongDefault"));
42 let NORMAL = new Strength(4, "normal"); 42 let NORMAL = dart.const(new Strength(4, "normal"));
43 let WEAK_DEFAULT = new Strength(5, "weakDefault"); 43 let WEAK_DEFAULT = dart.const(new Strength(5, "weakDefault"));
44 let WEAKEST = new Strength(6, "weakest"); 44 let WEAKEST = dart.const(new Strength(6, "weakest"));
45 class Constraint extends core.Object { 45 class Constraint extends core.Object {
46 Constraint(strength) { 46 Constraint(strength) {
47 this.strength = strength; 47 this.strength = strength;
48 } 48 }
49 addConstraint() { 49 addConstraint() {
50 this.addToGraph(); 50 this.addToGraph();
51 exports.planner.incrementalAdd(this); 51 exports.planner.incrementalAdd(this);
52 } 52 }
53 satisfy(mark) { 53 satisfy(mark) {
54 this.chooseMethod(dart.as(mark, core.int)); 54 this.chooseMethod(dart.as(mark, core.int));
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 exports.BinaryConstraint = BinaryConstraint; 460 exports.BinaryConstraint = BinaryConstraint;
461 exports.ScaleConstraint = ScaleConstraint; 461 exports.ScaleConstraint = ScaleConstraint;
462 exports.EqualityConstraint = EqualityConstraint; 462 exports.EqualityConstraint = EqualityConstraint;
463 exports.Variable = Variable; 463 exports.Variable = Variable;
464 exports.Planner = Planner; 464 exports.Planner = Planner;
465 exports.Plan = Plan; 465 exports.Plan = Plan;
466 exports.chainTest = chainTest; 466 exports.chainTest = chainTest;
467 exports.projectionTest = projectionTest; 467 exports.projectionTest = projectionTest;
468 exports.change = change; 468 exports.change = change;
469 })(DeltaBlue || (DeltaBlue = {})); 469 })(DeltaBlue || (DeltaBlue = {}));
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | test/codegen/expect/sunflower/dom.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698