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

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

Issue 1144303003: Use signature inheritance when method types are unchanged (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 7 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
« lib/runtime/dart/async.js ('K') | « test/browser/runtime_tests.js ('k') | no next file » | 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 = dart.defineLibrary(DeltaBlue, {}); 1 var DeltaBlue = dart.defineLibrary(DeltaBlue, {});
2 var BenchmarkBase = dart.import(BenchmarkBase); 2 var BenchmarkBase = dart.import(BenchmarkBase);
3 var core = dart.import(core); 3 var core = dart.import(core);
4 (function(exports, BenchmarkBase, core) { 4 (function(exports, BenchmarkBase, core) {
5 'use strict'; 5 'use strict';
6 function main() { 6 function main() {
7 new DeltaBlue().report(); 7 new DeltaBlue().report();
8 } 8 }
9 dart.fn(main); 9 dart.fn(main);
10 class DeltaBlue extends BenchmarkBase.BenchmarkBase { 10 class DeltaBlue extends BenchmarkBase.BenchmarkBase {
11 DeltaBlue() { 11 DeltaBlue() {
12 super.BenchmarkBase("DeltaBlue"); 12 super.BenchmarkBase("DeltaBlue");
13 } 13 }
14 run() { 14 run() {
15 chainTest(100); 15 chainTest(100);
16 projectionTest(100); 16 projectionTest(100);
17 } 17 }
18 } 18 }
19 dart.setSignature(DeltaBlue, { 19 dart.setSignature(DeltaBlue, {});
20 methods: () => ({run: dart.functionType(dart.void, [])})
21 });
22 class Strength extends core.Object { 20 class Strength extends core.Object {
23 Strength(value, name) { 21 Strength(value, name) {
24 this.value = value; 22 this.value = value;
25 this.name = name; 23 this.name = name;
26 } 24 }
27 nextWeaker() { 25 nextWeaker() {
28 return dart.const(dart.setType([STRONG_PREFERRED, PREFERRED, STRONG_DEFAUL T, NORMAL, WEAK_DEFAULT, WEAKEST], core.List$(Strength)))[core.$get](this.value) ; 26 return dart.const(dart.setType([STRONG_PREFERRED, PREFERRED, STRONG_DEFAUL T, NORMAL, WEAK_DEFAULT, WEAKEST], core.List$(Strength)))[core.$get](this.value) ;
29 } 27 }
30 static stronger(s1, s2) { 28 static stronger(s1, s2) {
31 return dart.notNull(s1.value) < dart.notNull(s2.value); 29 return dart.notNull(s1.value) < dart.notNull(s2.value);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 class EditConstraint extends UnaryConstraint { 163 class EditConstraint extends UnaryConstraint {
166 EditConstraint(v, str) { 164 EditConstraint(v, str) {
167 super.UnaryConstraint(v, str); 165 super.UnaryConstraint(v, str);
168 } 166 }
169 isInput() { 167 isInput() {
170 return true; 168 return true;
171 } 169 }
172 execute() {} 170 execute() {}
173 } 171 }
174 dart.setSignature(EditConstraint, { 172 dart.setSignature(EditConstraint, {
175 methods: () => ({ 173 methods: () => ({execute: dart.functionType(dart.void, [])})
176 isInput: dart.functionType(core.bool, []),
177 execute: dart.functionType(dart.void, [])
178 })
179 }); 174 });
180 let NONE = 1; 175 let NONE = 1;
181 let FORWARD = 2; 176 let FORWARD = 2;
182 let BACKWARD = 0; 177 let BACKWARD = 0;
183 class BinaryConstraint extends Constraint { 178 class BinaryConstraint extends Constraint {
184 BinaryConstraint(v1, v2, strength) { 179 BinaryConstraint(v1, v2, strength) {
185 this.v1 = v1; 180 this.v1 = v1;
186 this.v2 = v2; 181 this.v2 = v2;
187 this.direction = NONE; 182 this.direction = NONE;
188 super.Constraint(strength); 183 super.Constraint(strength);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 280 }
286 recalculate() { 281 recalculate() {
287 let ihn = this.input(), out = this.output(); 282 let ihn = this.input(), out = this.output();
288 out.walkStrength = Strength.weakest(this.strength, ihn.walkStrength); 283 out.walkStrength = Strength.weakest(this.strength, ihn.walkStrength);
289 out.stay = dart.notNull(ihn.stay) && dart.notNull(this.scale.stay) && dart .notNull(this.offset.stay); 284 out.stay = dart.notNull(ihn.stay) && dart.notNull(this.scale.stay) && dart .notNull(this.offset.stay);
290 if (out.stay) 285 if (out.stay)
291 this.execute(); 286 this.execute();
292 } 287 }
293 } 288 }
294 dart.setSignature(ScaleConstraint, { 289 dart.setSignature(ScaleConstraint, {
295 methods: () => ({ 290 methods: () => ({execute: dart.functionType(dart.void, [])})
296 addToGraph: dart.functionType(dart.void, []),
297 removeFromGraph: dart.functionType(dart.void, []),
298 markInputs: dart.functionType(dart.void, [core.int]),
299 execute: dart.functionType(dart.void, []),
300 recalculate: dart.functionType(dart.void, [])
301 })
302 }); 291 });
303 class EqualityConstraint extends BinaryConstraint { 292 class EqualityConstraint extends BinaryConstraint {
304 EqualityConstraint(v1, v2, strength) { 293 EqualityConstraint(v1, v2, strength) {
305 super.BinaryConstraint(v1, v2, strength); 294 super.BinaryConstraint(v1, v2, strength);
306 } 295 }
307 execute() { 296 execute() {
308 this.output().value = this.input().value; 297 this.output().value = this.input().value;
309 } 298 }
310 } 299 }
311 dart.setSignature(EqualityConstraint, { 300 dart.setSignature(EqualityConstraint, {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 exports.BinaryConstraint = BinaryConstraint; 545 exports.BinaryConstraint = BinaryConstraint;
557 exports.ScaleConstraint = ScaleConstraint; 546 exports.ScaleConstraint = ScaleConstraint;
558 exports.EqualityConstraint = EqualityConstraint; 547 exports.EqualityConstraint = EqualityConstraint;
559 exports.Variable = Variable; 548 exports.Variable = Variable;
560 exports.Planner = Planner; 549 exports.Planner = Planner;
561 exports.Plan = Plan; 550 exports.Plan = Plan;
562 exports.chainTest = chainTest; 551 exports.chainTest = chainTest;
563 exports.projectionTest = projectionTest; 552 exports.projectionTest = projectionTest;
564 exports.change = change; 553 exports.change = change;
565 })(DeltaBlue, BenchmarkBase, core); 554 })(DeltaBlue, BenchmarkBase, core);
OLDNEW
« lib/runtime/dart/async.js ('K') | « test/browser/runtime_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698