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

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

Issue 1143273002: Add types to shift operations (Closed) Base URL: https://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
OLDNEW
1 var _interceptors = dart.defineLibrary(_interceptors, {}); 1 var _interceptors = dart.defineLibrary(_interceptors, {});
2 var core = dart.import(core); 2 var core = dart.import(core);
3 var _js_helper = dart.lazyImport(_js_helper); 3 var _js_helper = dart.lazyImport(_js_helper);
4 var _internal = dart.import(_internal); 4 var _internal = dart.import(_internal);
5 var _foreign_helper = dart.import(_foreign_helper); 5 var _foreign_helper = dart.import(_foreign_helper);
6 var _js_embedded_names = dart.import(_js_embedded_names); 6 var _js_embedded_names = dart.import(_js_embedded_names);
7 (function(exports, core, _js_helper, _internal, _foreign_helper, _js_embedded_na mes) { 7 (function(exports, core, _js_helper, _internal, _foreign_helper, _js_embedded_na mes) {
8 'use strict'; 8 'use strict';
9 let JSArray = Array; 9 let JSArray = Array;
10 let JSMutableArray$ = dart.generic(function(E) { 10 let JSMutableArray$ = dart.generic(function(E) {
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 438 }
439 get bitLength() { 439 get bitLength() {
440 let nonneg = this['<'](0) ? dart.notNull(this['unary-']()) - 1 : this; 440 let nonneg = this['<'](0) ? dart.notNull(this['unary-']()) - 1 : this;
441 if (dart.notNull(nonneg) >= 4294967296) { 441 if (dart.notNull(nonneg) >= 4294967296) {
442 nonneg = (dart.notNull(nonneg) / 4294967296).truncate(); 442 nonneg = (dart.notNull(nonneg) / 4294967296).truncate();
443 return dart.notNull(JSInt._bitCount(JSInt._spread(nonneg))) + 32; 443 return dart.notNull(JSInt._bitCount(JSInt._spread(nonneg))) + 32;
444 } 444 }
445 return JSInt._bitCount(JSInt._spread(nonneg)); 445 return JSInt._bitCount(JSInt._spread(nonneg));
446 } 446 }
447 static _bitCount(i) { 447 static _bitCount(i) {
448 i = dart.as(dart.dsend(JSInt._shru(i, 0), '-', dart.dsend(JSInt._shru(i, 1 ), '&', 1431655765)), core.int); 448 i = dart.notNull(JSInt._shru(i, 0)) - (dart.notNull(JSInt._shru(i, 1)) & 1 431655765);
449 i = (dart.notNull(i) & 858993459)['+'](dart.as(dart.dsend(JSInt._shru(i, 2 ), '&', 858993459), core.num)); 449 i = (dart.notNull(i) & 858993459) + (dart.notNull(JSInt._shru(i, 2)) & 858 993459);
450 i = 252645135 & dart.notNull(dart.notNull(i) + dart.notNull(dart.as(JSInt. _shru(i, 4), core.num))); 450 i = 252645135 & dart.notNull(i) + dart.notNull(JSInt._shru(i, 4));
451 i = dart.notNull(i) + dart.notNull(dart.as(JSInt._shru(i, 8), core.int)); 451 i = dart.notNull(i) + dart.notNull(JSInt._shru(i, 8));
452 i = dart.notNull(i) + dart.notNull(dart.as(JSInt._shru(i, 16), core.int)); 452 i = dart.notNull(i) + dart.notNull(JSInt._shru(i, 16));
453 return dart.notNull(i) & 63; 453 return dart.notNull(i) & 63;
454 } 454 }
455 static _shru(value, shift) { 455 static _shru(value, shift) {
456 return value >>> shift; 456 return value >>> shift;
457 } 457 }
458 static _shrs(value, shift) { 458 static _shrs(value, shift) {
459 return value >> shift; 459 return value >> shift;
460 } 460 }
461 static _ors(a, b) { 461 static _ors(a, b) {
462 return a | b; 462 return a | b;
463 } 463 }
464 static _spread(i) { 464 static _spread(i) {
465 i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 1), core.int)), core.int) ; 465 i = JSInt._ors(i, JSInt._shrs(i, 1));
466 i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 2), core.int)), core.int) ; 466 i = JSInt._ors(i, JSInt._shrs(i, 2));
467 i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 4), core.int)), core.int) ; 467 i = JSInt._ors(i, JSInt._shrs(i, 4));
468 i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 8), core.int)), core.int) ; 468 i = JSInt._ors(i, JSInt._shrs(i, 8));
469 i = dart.as(JSInt._shru(dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 16), core.int)), core.int), 0), core.int); 469 i = JSInt._shru(JSInt._ors(i, JSInt._shrs(i, 16)), 0);
470 return i; 470 return i;
471 } 471 }
472 get runtimeType() { 472 get runtimeType() {
473 return core.int; 473 return core.int;
474 } 474 }
475 ['~']() { 475 ['~']() {
476 return dart.as(~this >>> 0, core.int); 476 return dart.as(~this >>> 0, core.int);
477 } 477 }
478 } 478 }
479 JSInt[dart.implements] = () => [core.int, core.double]; 479 JSInt[dart.implements] = () => [core.int, core.double];
480 dart.setSignature(JSInt, { 480 dart.setSignature(JSInt, {
481 methods: () => ({ 481 methods: () => ({
482 toUnsigned: dart.functionType(core.int, [core.int]), 482 toUnsigned: dart.functionType(core.int, [core.int]),
483 toSigned: dart.functionType(core.int, [core.int]), 483 toSigned: dart.functionType(core.int, [core.int]),
484 '~': dart.functionType(core.int, []) 484 '~': dart.functionType(core.int, [])
485 }), 485 }),
486 statics: () => ({ 486 statics: () => ({
487 _bitCount: dart.functionType(core.int, [core.int]), 487 _bitCount: dart.functionType(core.int, [core.int]),
488 _shru: dart.functionType(dart.dynamic, [core.int, core.int]), 488 _shru: dart.functionType(core.int, [core.int, core.int]),
489 _shrs: dart.functionType(dart.dynamic, [core.int, core.int]), 489 _shrs: dart.functionType(core.int, [core.int, core.int]),
490 _ors: dart.functionType(dart.dynamic, [core.int, core.int]), 490 _ors: dart.functionType(core.int, [core.int, core.int]),
491 _spread: dart.functionType(core.int, [core.int]) 491 _spread: dart.functionType(core.int, [core.int])
492 }), 492 }),
493 names: ['_bitCount', '_shru', '_shrs', '_ors', '_spread'] 493 names: ['_bitCount', '_shru', '_shrs', '_ors', '_spread']
494 }); 494 });
495 class JSDouble extends JSNumber { 495 class JSDouble extends JSNumber {
496 JSDouble() { 496 JSDouble() {
497 super.JSNumber(); 497 super.JSNumber();
498 } 498 }
499 get runtimeType() { 499 get runtimeType() {
500 return core.double; 500 return core.double;
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 exports.findInterceptorForType = findInterceptorForType; 1220 exports.findInterceptorForType = findInterceptorForType;
1221 exports.JSBool = JSBool; 1221 exports.JSBool = JSBool;
1222 exports.JSNull = JSNull; 1222 exports.JSNull = JSNull;
1223 exports.JSIndexable = JSIndexable; 1223 exports.JSIndexable = JSIndexable;
1224 exports.JSMutableIndexable = JSMutableIndexable; 1224 exports.JSMutableIndexable = JSMutableIndexable;
1225 exports.JSObject = JSObject; 1225 exports.JSObject = JSObject;
1226 exports.JavaScriptObject = JavaScriptObject; 1226 exports.JavaScriptObject = JavaScriptObject;
1227 exports.PlainJavaScriptObject = PlainJavaScriptObject; 1227 exports.PlainJavaScriptObject = PlainJavaScriptObject;
1228 exports.UnknownJavaScriptObject = UnknownJavaScriptObject; 1228 exports.UnknownJavaScriptObject = UnknownJavaScriptObject;
1229 })(_interceptors, core, _js_helper, _internal, _foreign_helper, _js_embedded_nam es); 1229 })(_interceptors, core, _js_helper, _internal, _foreign_helper, _js_embedded_nam es);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698