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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 1559233002: WIP: Compute constant expressions in resolution. (Closed) Base URL: https://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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart_backend; 5 part of dart_backend;
6 6
7 // TODO(ahe): This class is simply wrong. This backend should use 7 // TODO(ahe): This class is simply wrong. This backend should use
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, 8 // elements when it can, not AST nodes. Perhaps a [Map<Element,
9 // TreeElements>] is what is needed. 9 // TreeElements>] is what is needed.
10 class ElementAst { 10 class ElementAst {
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 } 515 }
516 516
517 @override 517 @override
518 ConstantExpression compileConstant(VariableElement element) { 518 ConstantExpression compileConstant(VariableElement element) {
519 return measure(() { 519 return measure(() {
520 return constantCompiler.compileConstant(element); 520 return constantCompiler.compileConstant(element);
521 }); 521 });
522 } 522 }
523 523
524 @override 524 @override
525 void evaluate(ConstantExpression constant) { 525 void evaluate(Spannable spannable, ConstantExpression constant) {
526 return measure(() { 526 return measure(() {
527 return constantCompiler.evaluate(constant); 527 return constantCompiler.evaluate(spannable, constant);
528 }); 528 });
529 } 529 }
530 530
531 void compileVariable(VariableElement element) { 531 void compileVariable(VariableElement element) {
532 measure(() { 532 measure(() {
533 constantCompiler.compileVariable(element); 533 constantCompiler.compileVariable(element);
534 }); 534 });
535 } 535 }
536 536
537 @override 537 @override
(...skipping 18 matching lines...) Expand all
556 } 556 }
557 557
558 // TODO(johnniwinther): Remove this when values are computed from the 558 // TODO(johnniwinther): Remove this when values are computed from the
559 // expressions. 559 // expressions.
560 @override 560 @override
561 void copyConstantValues(DartConstantTask task) { 561 void copyConstantValues(DartConstantTask task) {
562 constantCompiler.constantValueMap.addAll( 562 constantCompiler.constantValueMap.addAll(
563 task.constantCompiler.constantValueMap); 563 task.constantCompiler.constantValueMap);
564 } 564 }
565 } 565 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698