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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: lib/runtime/dart/_interceptors.js
diff --git a/lib/runtime/dart/_interceptors.js b/lib/runtime/dart/_interceptors.js
index 2d3a82c0125acc8b88b3ca1fb22e687c8af5d725..889dd1cce511d187ab9843415de68b6653eb67a7 100644
--- a/lib/runtime/dart/_interceptors.js
+++ b/lib/runtime/dart/_interceptors.js
@@ -445,11 +445,11 @@ var _js_embedded_names = dart.import(_js_embedded_names);
return JSInt._bitCount(JSInt._spread(nonneg));
}
static _bitCount(i) {
- i = dart.as(dart.dsend(JSInt._shru(i, 0), '-', dart.dsend(JSInt._shru(i, 1), '&', 1431655765)), core.int);
- i = (dart.notNull(i) & 858993459)['+'](dart.as(dart.dsend(JSInt._shru(i, 2), '&', 858993459), core.num));
- i = 252645135 & dart.notNull(dart.notNull(i) + dart.notNull(dart.as(JSInt._shru(i, 4), core.num)));
- i = dart.notNull(i) + dart.notNull(dart.as(JSInt._shru(i, 8), core.int));
- i = dart.notNull(i) + dart.notNull(dart.as(JSInt._shru(i, 16), core.int));
+ i = dart.notNull(JSInt._shru(i, 0)) - (dart.notNull(JSInt._shru(i, 1)) & 1431655765);
+ i = (dart.notNull(i) & 858993459) + (dart.notNull(JSInt._shru(i, 2)) & 858993459);
+ i = 252645135 & dart.notNull(i) + dart.notNull(JSInt._shru(i, 4));
+ i = dart.notNull(i) + dart.notNull(JSInt._shru(i, 8));
+ i = dart.notNull(i) + dart.notNull(JSInt._shru(i, 16));
return dart.notNull(i) & 63;
}
static _shru(value, shift) {
@@ -462,11 +462,11 @@ var _js_embedded_names = dart.import(_js_embedded_names);
return a | b;
}
static _spread(i) {
- i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 1), core.int)), core.int);
- i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 2), core.int)), core.int);
- i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 4), core.int)), core.int);
- i = dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 8), core.int)), core.int);
- i = dart.as(JSInt._shru(dart.as(JSInt._ors(i, dart.as(JSInt._shrs(i, 16), core.int)), core.int), 0), core.int);
+ i = JSInt._ors(i, JSInt._shrs(i, 1));
+ i = JSInt._ors(i, JSInt._shrs(i, 2));
+ i = JSInt._ors(i, JSInt._shrs(i, 4));
+ i = JSInt._ors(i, JSInt._shrs(i, 8));
+ i = JSInt._shru(JSInt._ors(i, JSInt._shrs(i, 16)), 0);
return i;
}
get runtimeType() {
@@ -485,9 +485,9 @@ var _js_embedded_names = dart.import(_js_embedded_names);
}),
statics: () => ({
_bitCount: dart.functionType(core.int, [core.int]),
- _shru: dart.functionType(dart.dynamic, [core.int, core.int]),
- _shrs: dart.functionType(dart.dynamic, [core.int, core.int]),
- _ors: dart.functionType(dart.dynamic, [core.int, core.int]),
+ _shru: dart.functionType(core.int, [core.int, core.int]),
+ _shrs: dart.functionType(core.int, [core.int, core.int]),
+ _ors: dart.functionType(core.int, [core.int, core.int]),
_spread: dart.functionType(core.int, [core.int])
}),
names: ['_bitCount', '_shru', '_shrs', '_ors', '_spread']

Powered by Google App Engine
This is Rietveld 408576698