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

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

Issue 1648783002: Repalce shiftOr with pushLongInt, tweak makeSymbol. (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 f6dea26583bf704a8ccfcb335aed436b62cdd1db..4787700123cfdec62cc340613eecb38a7ee8045a 100644
--- a/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_const_expr.dart
@@ -57,7 +57,6 @@ abstract class AbstractConstExprSerializer {
_serializeString(expr);
} else if (expr is SymbolLiteral) {
strings.add(expr.components.map((token) => token.lexeme).join('.'));
- operations.add(UnlinkedConstOperation.pushString);
operations.add(UnlinkedConstOperation.makeSymbol);
} else if (expr is NullLiteral) {
operations.add(UnlinkedConstOperation.pushNull);
@@ -144,9 +143,18 @@ abstract class AbstractConstExprSerializer {
void _pushInt(int value) {
assert(value >= 0);
if (value >= (1 << 32)) {
- _pushInt(value >> 32);
- operations.add(UnlinkedConstOperation.shiftOr);
- ints.add(value & 0xFFFFFFFF);
+ int numOfComponents = 0;
+ ints.add(numOfComponents);
+ void pushComponents(int value) {
+ if (value >= (1 << 32)) {
+ pushComponents(value >> 32);
+ }
+ numOfComponents++;
+ ints.add(value & 0xFFFFFFFF);
+ }
+ pushComponents(value);
+ ints[ints.length - 1 - numOfComponents] = numOfComponents;
+ operations.add(UnlinkedConstOperation.pushLongInt);
} else {
operations.add(UnlinkedConstOperation.pushInt);
ints.add(value);
« 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