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

Side by Side Diff: lib/runtime/dart/math.js

Issue 1100633006: Generate static calls for Object fields and methods (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Better static dispatch check 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
OLDNEW
1 var math; 1 var math;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 class _JenkinsSmiHash extends core.Object { 4 class _JenkinsSmiHash extends core.Object {
5 static combine(hash, value) { 5 static combine(hash, value) {
6 hash = 536870911 & dart.notNull(hash) + dart.notNull(value); 6 hash = 536870911 & dart.notNull(hash) + dart.notNull(value);
7 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) << 10); 7 hash = 536870911 & dart.notNull(hash) + ((524287 & dart.notNull(hash)) << 10);
8 return dart.notNull(hash) ^ dart.notNull(hash) >> 6; 8 return dart.notNull(hash) ^ dart.notNull(hash) >> 6;
9 } 9 }
10 static finish(hash) { 10 static finish(hash) {
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 toString() { 28 toString() {
29 return `Point(${this.x}, ${this.y})`; 29 return `Point(${this.x}, ${this.y})`;
30 } 30 }
31 ['=='](other) { 31 ['=='](other) {
32 if (!dart.is(other, Point)) 32 if (!dart.is(other, Point))
33 return false; 33 return false;
34 return dart.notNull(dart.equals(this.x, dart.dload(other, 'x'))) && dart .notNull(dart.equals(this.y, dart.dload(other, 'y'))); 34 return dart.notNull(dart.equals(this.x, dart.dload(other, 'x'))) && dart .notNull(dart.equals(this.y, dart.dload(other, 'y')));
35 } 35 }
36 get hashCode() { 36 get hashCode() {
37 return _JenkinsSmiHash.hash2(this.x.hashCode, this.y.hashCode); 37 return _JenkinsSmiHash.hash2(dart.hashCode(this.x), dart.hashCode(this.y ));
38 } 38 }
39 ['+'](other) { 39 ['+'](other) {
40 return new (Point$(T))(dart.as(this.x['+'](other.x), T), dart.as(this.y[ '+'](other.y), T)); 40 return new (Point$(T))(dart.as(this.x['+'](other.x), T), dart.as(this.y[ '+'](other.y), T));
41 } 41 }
42 ['-'](other) { 42 ['-'](other) {
43 return new (Point$(T))(dart.as(this.x['-'](other.x), T), dart.as(this.y[ '-'](other.y), T)); 43 return new (Point$(T))(dart.as(this.x['-'](other.x), T), dart.as(this.y[ '-'](other.y), T));
44 } 44 }
45 ['*'](factor) { 45 ['*'](factor) {
46 return new (Point$(T))(dart.as(this.x['*'](factor), T), dart.as(this.y[' *'](factor), T)); 46 return new (Point$(T))(dart.as(this.x['*'](factor), T), dart.as(this.y[' *'](factor), T));
47 } 47 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 toString() { 82 toString() {
83 return `Rectangle (${this.left}, ${this.top}) ${this.width} x ${this.hei ght}`; 83 return `Rectangle (${this.left}, ${this.top}) ${this.width} x ${this.hei ght}`;
84 } 84 }
85 ['=='](other) { 85 ['=='](other) {
86 if (!dart.is(other, Rectangle)) 86 if (!dart.is(other, Rectangle))
87 return false; 87 return false;
88 return dart.notNull(dart.equals(this.left, dart.dload(other, 'left'))) & & dart.notNull(dart.equals(this.top, dart.dload(other, 'top'))) && dart.notNull( dart.equals(this.right, dart.dload(other, 'right'))) && dart.notNull(dart.equals (this.bottom, dart.dload(other, 'bottom'))); 88 return dart.notNull(dart.equals(this.left, dart.dload(other, 'left'))) & & dart.notNull(dart.equals(this.top, dart.dload(other, 'top'))) && dart.notNull( dart.equals(this.right, dart.dload(other, 'right'))) && dart.notNull(dart.equals (this.bottom, dart.dload(other, 'bottom')));
89 } 89 }
90 get hashCode() { 90 get hashCode() {
91 return _JenkinsSmiHash.hash4(this.left.hashCode, this.top.hashCode, this .right.hashCode, this.bottom.hashCode); 91 return _JenkinsSmiHash.hash4(dart.hashCode(this.left), dart.hashCode(thi s.top), dart.hashCode(this.right), dart.hashCode(this.bottom));
92 } 92 }
93 intersection(other) { 93 intersection(other) {
94 let x0 = max(this.left, other.left); 94 let x0 = max(this.left, other.left);
95 let x1 = min(this.left['+'](this.width), other.left['+'](other.width)); 95 let x1 = min(this.left['+'](this.width), other.left['+'](other.width));
96 if (dart.notNull(x0) <= dart.notNull(x1)) { 96 if (dart.notNull(x0) <= dart.notNull(x1)) {
97 let y0 = max(this.top, other.top); 97 let y0 = max(this.top, other.top);
98 let y1 = min(this.top['+'](this.height), other.top['+'](other.height)) ; 98 let y1 = min(this.top['+'](this.height), other.top['+'](other.height)) ;
99 if (dart.notNull(y0) <= dart.notNull(y1)) { 99 if (dart.notNull(y0) <= dart.notNull(y1)) {
100 return new (Rectangle$(T))(dart.as(x0, T), dart.as(y0, T), dart.as(d art.notNull(x1) - dart.notNull(x0), T), dart.as(dart.notNull(y1) - dart.notNull( y0), T)); 100 return new (Rectangle$(T))(dart.as(x0, T), dart.as(y0, T), dart.as(d art.notNull(x1) - dart.notNull(x0), T), dart.as(dart.notNull(y1) - dart.notNull( y0), T));
101 } 101 }
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 exports.sin = sin; 449 exports.sin = sin;
450 exports.cos = cos; 450 exports.cos = cos;
451 exports.tan = tan; 451 exports.tan = tan;
452 exports.acos = acos; 452 exports.acos = acos;
453 exports.asin = asin; 453 exports.asin = asin;
454 exports.atan = atan; 454 exports.atan = atan;
455 exports.sqrt = sqrt; 455 exports.sqrt = sqrt;
456 exports.exp = exp; 456 exports.exp = exp;
457 exports.log = log; 457 exports.log = log;
458 })(math || (math = {})); 458 })(math || (math = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698