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

Unified Diff: runtime/lib/integers.dart

Issue 22640019: Fix for running with --throw_on_javascript_int_overflow: recognize pattern (a << b) & mask and test… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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: runtime/lib/integers.dart
===================================================================
--- runtime/lib/integers.dart (revision 26093)
+++ runtime/lib/integers.dart (working copy)
@@ -172,7 +172,10 @@
result *= base;
}
exponent >>= 1;
- base *= base;
+ // Skip unnecessary operation (can overflow to Mint or Bigint).
+ if (exponent != 0) {
+ base *= base;
+ }
}
return result;
}
@@ -213,6 +216,8 @@
}
return buffer.toString();
}
+
+ _leftShiftWithMask32(count, mask) native "Integer_leftShiftWithMask32";
}
class _Smi extends _IntegerImplementation implements int {

Powered by Google App Engine
This is Rietveld 408576698