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

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: Remove empty signatures 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
« no previous file with comments | « test/browser/runtime_tests.js ('k') | test/codegen/expect/cascade.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 = 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, {
20 methods: () => ({run: dart.functionType(dart.void, [])})
21 });
22 class Strength extends core.Object { 19 class Strength extends core.Object {
23 Strength(value, name) { 20 Strength(value, name) {
24 this.value = value; 21 this.value = value;
25 this.name = name; 22 this.name = name;
26 } 23 }
27 nextWeaker() { 24 nextWeaker() {
28 return dart.const(dart.setType([STRONG_PREFERRED, PREFERRED, STRONG_DEFAUL T, NORMAL, WEAK_DEFAULT, WEAKEST], core.List$(Strength)))[core.$get](this.value) ; 25 return dart.const(dart.setType([STRONG_PREFERRED, PREFERRED, STRONG_DEFAUL T, NORMAL, WEAK_DEFAULT, WEAKEST], core.List$(Strength)))[core.$get](this.value) ;
29 } 26 }
30 static stronger(s1, s2) { 27 static stronger(s1, s2) {
31 return dart.notNull(s1.value) < dart.notNull(s2.value); 28 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 { 162 class EditConstraint extends UnaryConstraint {
166 EditConstraint(v, str) { 163 EditConstraint(v, str) {
167 super.UnaryConstraint(v, str); 164 super.UnaryConstraint(v, str);
168 } 165 }
169 isInput() { 166 isInput() {
170 return true; 167 return true;
171 } 168 }
172 execute() {} 169 execute() {}
173 } 170 }
174 dart.setSignature(EditConstraint, { 171 dart.setSignature(EditConstraint, {
175 methods: () => ({ 172 methods: () => ({execute: dart.functionType(dart.void, [])})
176 isInput: dart.functionType(core.bool, []),
177 execute: dart.functionType(dart.void, [])
178 })
179 }); 173 });
180 let NONE = 1; 174 let NONE = 1;
181 let FORWARD = 2; 175 let FORWARD = 2;
182 let BACKWARD = 0; 176 let BACKWARD = 0;
183 class BinaryConstraint extends Constraint { 177 class BinaryConstraint extends Constraint {
184 BinaryConstraint(v1, v2, strength) { 178 BinaryConstraint(v1, v2, strength) {
185 this.v1 = v1; 179 this.v1 = v1;
186 this.v2 = v2; 180 this.v2 = v2;
187 this.direction = NONE; 181 this.direction = NONE;
188 super.Constraint(strength); 182 super.Constraint(strength);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 279 }
286 recalculate() { 280 recalculate() {
287 let ihn = this.input(), out = this.output(); 281 let ihn = this.input(), out = this.output();
288 out.walkStrength = Strength.weakest(this.strength, ihn.walkStrength); 282 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); 283 out.stay = dart.notNull(ihn.stay) && dart.notNull(this.scale.stay) && dart .notNull(this.offset.stay);
290 if (out.stay) 284 if (out.stay)
291 this.execute(); 285 this.execute();
292 } 286 }
293 } 287 }
294 dart.setSignature(ScaleConstraint, { 288 dart.setSignature(ScaleConstraint, {
295 methods: () => ({ 289 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 }); 290 });
303 class EqualityConstraint extends BinaryConstraint { 291 class EqualityConstraint extends BinaryConstraint {
304 EqualityConstraint(v1, v2, strength) { 292 EqualityConstraint(v1, v2, strength) {
305 super.BinaryConstraint(v1, v2, strength); 293 super.BinaryConstraint(v1, v2, strength);
306 } 294 }
307 execute() { 295 execute() {
308 this.output().value = this.input().value; 296 this.output().value = this.input().value;
309 } 297 }
310 } 298 }
311 dart.setSignature(EqualityConstraint, { 299 dart.setSignature(EqualityConstraint, {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 exports.BinaryConstraint = BinaryConstraint; 544 exports.BinaryConstraint = BinaryConstraint;
557 exports.ScaleConstraint = ScaleConstraint; 545 exports.ScaleConstraint = ScaleConstraint;
558 exports.EqualityConstraint = EqualityConstraint; 546 exports.EqualityConstraint = EqualityConstraint;
559 exports.Variable = Variable; 547 exports.Variable = Variable;
560 exports.Planner = Planner; 548 exports.Planner = Planner;
561 exports.Plan = Plan; 549 exports.Plan = Plan;
562 exports.chainTest = chainTest; 550 exports.chainTest = chainTest;
563 exports.projectionTest = projectionTest; 551 exports.projectionTest = projectionTest;
564 exports.change = change; 552 exports.change = change;
565 })(DeltaBlue, BenchmarkBase, core); 553 })(DeltaBlue, BenchmarkBase, core);
OLDNEW
« no previous file with comments | « test/browser/runtime_tests.js ('k') | test/codegen/expect/cascade.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698