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

Unified Diff: pkg/analyzer/lib/src/summary/summarize_const_expr.dart

Issue 1612863002: Serialize long integers as unsigned 32-bit pieces. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summarize_const_expr.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
index a6713594078d6164bb496413954281e874a76136..92220689c6413dbb170f7beebebeae385c1a4837 100644
--- a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
@@ -126,10 +126,15 @@ abstract class AbstractConstExprSerializer {
}
void _pushInt(int value) {
- // TODO(scheglov) add support for arbitrary precision ints
- assert(value.abs() < (2 << 31));
- ints.add(value & 0xFFFFFFFF);
- operations.add(UnlinkedConstOperation.pushInt);
+ assert(value >= 0);
+ if (value >= (1 << 32)) {
+ _pushInt(value >> 32);
+ operations.add(UnlinkedConstOperation.shiftOr);
+ ints.add(value & 0xFFFFFFFF);
+ } else {
+ operations.add(UnlinkedConstOperation.pushInt);
+ ints.add(value);
+ }
}
void _serializeBinaryExpression(BinaryExpression expr) {
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698