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

Unified Diff: runtime/lib/typed_data_patch.dart

Issue 2983633002: Avoid Bigint literals in Dart core library (Closed)
Patch Set: Created 3 years, 5 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
« runtime/lib/bigint.dart ('K') | « runtime/lib/bigint.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/typed_data_patch.dart
diff --git a/runtime/lib/typed_data_patch.dart b/runtime/lib/typed_data_patch.dart
index c3df4d4711a1b6e8ce36ab05b45faadec13f78f3..8486611a30febc0f2d9d88e018116d52affc30ae 100644
--- a/runtime/lib/typed_data_patch.dart
+++ b/runtime/lib/typed_data_patch.dart
@@ -3044,17 +3044,19 @@ int _toUint32(int value) {
return value & 0xFFFFFFFF;
}
+const _uint64Mask = (1 << 64) - 1;
regis 2017/07/17 16:45:31 ditto
alexmarkov 2017/07/17 20:21:28 Done.
+
int _toInt64(int value) {
// Avoid bigint mask when possible.
return (ClassID.getID(value) == ClassID.cidBigint)
- ? _toInt(value, 0xFFFFFFFFFFFFFFFF)
+ ? _toInt(value, _uint64Mask)
: value;
}
int _toUint64(int value) {
// Avoid bigint mask when possible.
return (ClassID.getID(value) == ClassID.cidBigint)
- ? _toInt(value, 0xFFFFFFFFFFFFFFFF)
+ ? _toInt(value, _uint64Mask)
: value;
}
« runtime/lib/bigint.dart ('K') | « runtime/lib/bigint.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698