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

Side by Side Diff: pkg/analyzer/test/src/summary/summary_common.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, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.src.summary.summary_common; 5 library analyzer.test.src.summary.summary_common;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 1876 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 _assertUnlinkedConst(variable.constExpr, operators: [ 1887 _assertUnlinkedConst(variable.constExpr, operators: [
1888 UnlinkedConstOperation.pushString, 1888 UnlinkedConstOperation.pushString,
1889 UnlinkedConstOperation.length 1889 UnlinkedConstOperation.length
1890 ], strings: [ 1890 ], strings: [
1891 'abc' 1891 'abc'
1892 ]); 1892 ]);
1893 } 1893 }
1894 1894
1895 test_constExpr_makeSymbol() { 1895 test_constExpr_makeSymbol() {
1896 UnlinkedVariable variable = serializeVariableText('const v = #a.bb.ccc;'); 1896 UnlinkedVariable variable = serializeVariableText('const v = #a.bb.ccc;');
1897 _assertUnlinkedConst(variable.constExpr, operators: [ 1897 _assertUnlinkedConst(variable.constExpr,
1898 UnlinkedConstOperation.pushString, 1898 operators: [UnlinkedConstOperation.makeSymbol], strings: ['a.bb.ccc']);
1899 UnlinkedConstOperation.makeSymbol
1900 ], strings: [
1901 'a.bb.ccc'
1902 ]);
1903 } 1899 }
1904 1900
1905 test_constExpr_makeTypedList() { 1901 test_constExpr_makeTypedList() {
1906 UnlinkedVariable variable = 1902 UnlinkedVariable variable =
1907 serializeVariableText('const v = const <int>[11, 22, 33];'); 1903 serializeVariableText('const v = const <int>[11, 22, 33];');
1908 _assertUnlinkedConst(variable.constExpr, operators: [ 1904 _assertUnlinkedConst(variable.constExpr, operators: [
1909 UnlinkedConstOperation.pushInt, 1905 UnlinkedConstOperation.pushInt,
1910 UnlinkedConstOperation.pushInt, 1906 UnlinkedConstOperation.pushInt,
1911 UnlinkedConstOperation.pushInt, 1907 UnlinkedConstOperation.pushInt,
1912 UnlinkedConstOperation.makeTypedList 1908 UnlinkedConstOperation.makeTypedList
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 test_constExpr_pushInt_negative() { 2098 test_constExpr_pushInt_negative() {
2103 UnlinkedVariable variable = serializeVariableText('const v = -5;'); 2099 UnlinkedVariable variable = serializeVariableText('const v = -5;');
2104 _assertUnlinkedConst(variable.constExpr, operators: [ 2100 _assertUnlinkedConst(variable.constExpr, operators: [
2105 UnlinkedConstOperation.pushInt, 2101 UnlinkedConstOperation.pushInt,
2106 UnlinkedConstOperation.negate 2102 UnlinkedConstOperation.negate
2107 ], ints: [ 2103 ], ints: [
2108 5 2104 5
2109 ]); 2105 ]);
2110 } 2106 }
2111 2107
2112 test_constExpr_pushInt_shiftOr_long() { 2108 test_constExpr_pushLongInt() {
2113 UnlinkedVariable variable = 2109 UnlinkedVariable variable =
2114 serializeVariableText('const v = 0xA123456789ABCDEF012345678;'); 2110 serializeVariableText('const v = 0xA123456789ABCDEF012345678;');
2115 _assertUnlinkedConst(variable.constExpr, operators: [ 2111 _assertUnlinkedConst(variable.constExpr,
2116 UnlinkedConstOperation.pushInt, 2112 operators: [UnlinkedConstOperation.pushLongInt],
2117 UnlinkedConstOperation.shiftOr, 2113 ints: [4, 0xA, 0x12345678, 0x9ABCDEF0, 0x12345678]);
2118 UnlinkedConstOperation.shiftOr,
2119 UnlinkedConstOperation.shiftOr
2120 ], ints: [
2121 0xA,
2122 0x12345678,
2123 0x9ABCDEF0,
2124 0x12345678
2125 ]);
2126 } 2114 }
2127 2115
2128 test_constExpr_pushInt_shiftOr_min() { 2116 test_constExpr_pushLongInt_min2() {
2129 UnlinkedVariable variable = serializeVariableText('const v = 0x100000000;'); 2117 UnlinkedVariable variable = serializeVariableText('const v = 0x100000000;');
2130 _assertUnlinkedConst(variable.constExpr, operators: [ 2118 _assertUnlinkedConst(variable.constExpr,
2131 UnlinkedConstOperation.pushInt, 2119 operators: [UnlinkedConstOperation.pushLongInt], ints: [2, 1, 0,]);
2132 UnlinkedConstOperation.shiftOr,
2133 ], ints: [
2134 1,
2135 0,
2136 ]);
2137 } 2120 }
2138 2121
2139 test_constExpr_pushInt_shiftOr_min2() { 2122 test_constExpr_pushLongInt_min3() {
2140 UnlinkedVariable variable = 2123 UnlinkedVariable variable =
2141 serializeVariableText('const v = 0x10000000000000000;'); 2124 serializeVariableText('const v = 0x10000000000000000;');
2142 _assertUnlinkedConst(variable.constExpr, operators: [ 2125 _assertUnlinkedConst(variable.constExpr,
2143 UnlinkedConstOperation.pushInt, 2126 operators: [UnlinkedConstOperation.pushLongInt], ints: [3, 1, 0, 0,]);
2144 UnlinkedConstOperation.shiftOr,
2145 UnlinkedConstOperation.shiftOr,
2146 ], ints: [
2147 1,
2148 0,
2149 0,
2150 ]);
2151 } 2127 }
2152 2128
2153 test_constExpr_pushNull() { 2129 test_constExpr_pushNull() {
2154 UnlinkedVariable variable = serializeVariableText('const v = null;'); 2130 UnlinkedVariable variable = serializeVariableText('const v = null;');
2155 _assertUnlinkedConst(variable.constExpr, 2131 _assertUnlinkedConst(variable.constExpr,
2156 operators: [UnlinkedConstOperation.pushNull]); 2132 operators: [UnlinkedConstOperation.pushNull]);
2157 } 2133 }
2158 2134
2159 test_constExpr_pushReference_class() { 2135 test_constExpr_pushReference_class() {
2160 UnlinkedVariable variable = serializeVariableText(''' 2136 UnlinkedVariable variable = serializeVariableText('''
(...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after
4993 final String absoluteUri; 4969 final String absoluteUri;
4994 final String relativeUri; 4970 final String relativeUri;
4995 final int numTypeParameters; 4971 final int numTypeParameters;
4996 4972
4997 _PrefixExpectation(this.kind, this.name, 4973 _PrefixExpectation(this.kind, this.name,
4998 {this.inLibraryDefiningUnit: false, 4974 {this.inLibraryDefiningUnit: false,
4999 this.absoluteUri, 4975 this.absoluteUri,
5000 this.relativeUri, 4976 this.relativeUri,
5001 this.numTypeParameters: 0}); 4977 this.numTypeParameters: 0});
5002 } 4978 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_const_expr.dart ('k') | pkg/analyzer/tool/summary/idl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698