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

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

Issue 1927963002: Support compilation of Hello World (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes Created 4 years, 7 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) 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } 238 }
239 239
240 void forgetElement(Element element) { 240 void forgetElement(Element element) {
241 super.forgetElement(element); 241 super.forgetElement(element);
242 const ForgetConstantElementVisitor().visit(element, this); 242 const ForgetConstantElementVisitor().visit(element, this);
243 if (element is AstElement && element.hasNode) { 243 if (element is AstElement && element.hasNode) {
244 element.node.accept(new ForgetConstantNodeVisitor(this)); 244 element.node.accept(new ForgetConstantNodeVisitor(this));
245 } 245 }
246 } 246 }
247 247
248 @override
248 ConstantValue getConstantValue(ConstantExpression expression) { 249 ConstantValue getConstantValue(ConstantExpression expression) {
250 assert(invariant(CURRENT_ELEMENT_SPANNABLE, expression != null,
251 message: "ConstantExpression is null in getConstantValue."));
252 evaluate(expression);
249 ConstantValue value = super.getConstantValue(expression); 253 ConstantValue value = super.getConstantValue(expression);
250 if (value == null && 254 if (value == null &&
251 expression != null && 255 expression != null &&
252 expression.kind == ConstantExpressionKind.ERRONEOUS) { 256 expression.kind == ConstantExpressionKind.ERRONEOUS) {
253 // TODO(johnniwinther): When the Dart constant system sees a constant 257 // TODO(johnniwinther): When the Dart constant system sees a constant
254 // expression as erroneous but the JavaScript constant system finds it ok 258 // expression as erroneous but the JavaScript constant system finds it ok
255 // we have store a constant value for the erroneous constant expression. 259 // we have store a constant value for the erroneous constant expression.
256 // Ensure the computed constant expressions are always the same; that only 260 // Ensure the computed constant expressions are always the same; that only
257 // the constant values may be different. 261 // the constant values may be different.
258 value = new NullConstantValue(); 262 value = new NullConstantValue();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 // TODO(ahe): This doesn't belong here. Rename this class and generalize. 299 // TODO(ahe): This doesn't belong here. Rename this class and generalize.
296 var closureClassMap = constants 300 var closureClassMap = constants
297 .compiler.closureToClassMapper.closureMappingCache 301 .compiler.closureToClassMapper.closureMappingCache
298 .remove(node); 302 .remove(node);
299 if (closureClassMap != null) { 303 if (closureClassMap != null) {
300 closureClassMap 304 closureClassMap
301 .removeMyselfFrom(constants.compiler.enqueuer.codegen.universe); 305 .removeMyselfFrom(constants.compiler.enqueuer.codegen.universe);
302 } 306 }
303 } 307 }
304 } 308 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/constant_system_javascript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698