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

Side by Side Diff: pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart

Issue 1170673002: Begin to compute constant expressions in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix BinaryConstantExpression.getKnownType Created 5 years, 6 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
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of js_backend; 5 part of js_backend;
6 6
7 /// [ConstantCompilerTask] for compilation of constants for the JavaScript 7 /// [ConstantCompilerTask] for compilation of constants for the JavaScript
8 /// backend. 8 /// backend.
9 /// 9 ///
10 /// Since this task needs to distinguish between frontend and backend constants 10 /// Since this task needs to distinguish between frontend and backend constants
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 ConstantExpression compileNode(Node node, TreeElements elements, 194 ConstantExpression compileNode(Node node, TreeElements elements,
195 {bool enforceConst: true}) { 195 {bool enforceConst: true}) {
196 return compileNodeWithDefinitions(node, elements, isConst: enforceConst); 196 return compileNodeWithDefinitions(node, elements, isConst: enforceConst);
197 } 197 }
198 198
199 ConstantExpression compileNodeWithDefinitions(Node node, 199 ConstantExpression compileNodeWithDefinitions(Node node,
200 TreeElements definitions, 200 TreeElements definitions,
201 {bool isConst: true}) { 201 {bool isConst: true}) {
202 ConstantExpression constant = nodeConstantMap[node]; 202 ConstantExpression constant = nodeConstantMap[node];
203 if (constant != null) { 203 if (constant != null && getConstantValue(constant) != null) {
204 return constant; 204 return constant;
205 } 205 }
206 constant = 206 constant =
207 super.compileNodeWithDefinitions(node, definitions, isConst: isConst); 207 super.compileNodeWithDefinitions(node, definitions, isConst: isConst);
208 if (constant != null) { 208 if (constant != null) {
209 nodeConstantMap[node] = constant; 209 nodeConstantMap[node] = constant;
210 } 210 }
211 return constant; 211 return constant;
212 } 212 }
213 213
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 // TODO(ahe): This doesn't belong here. Rename this class and generalize. 280 // TODO(ahe): This doesn't belong here. Rename this class and generalize.
281 var closureClassMap = 281 var closureClassMap =
282 constants.compiler.closureToClassMapper.closureMappingCache 282 constants.compiler.closureToClassMapper.closureMappingCache
283 .remove(node); 283 .remove(node);
284 if (closureClassMap != null) { 284 if (closureClassMap != null) {
285 closureClassMap.removeMyselfFrom( 285 closureClassMap.removeMyselfFrom(
286 constants.compiler.enqueuer.codegen.universe); 286 constants.compiler.enqueuer.codegen.universe);
287 } 287 }
288 } 288 }
289 } 289 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698