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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1919143002: Store constant variable initializers in elements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.ir_builder_task; 5 library dart2js.ir_builder_task;
6 6
7 import 'package:js_runtime/shared/embedded_names.dart' 7 import 'package:js_runtime/shared/embedded_names.dart'
8 show JsBuiltin, JsGetName; 8 show JsBuiltin, JsGetName;
9 9
10 import '../closure.dart' as closure; 10 import '../closure.dart' as closure;
(...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after
1674 ir.Primitive visitLiteralString(ast.LiteralString node) { 1674 ir.Primitive visitLiteralString(ast.LiteralString node) {
1675 assert(irBuilder.isOpen); 1675 assert(irBuilder.isOpen);
1676 return irBuilder.buildDartStringConstant(node.dartString); 1676 return irBuilder.buildDartStringConstant(node.dartString);
1677 } 1677 }
1678 1678
1679 ConstantValue getConstantForNode(ast.Node node) { 1679 ConstantValue getConstantForNode(ast.Node node) {
1680 return irBuilder.state.constants.getConstantValueForNode(node, elements); 1680 return irBuilder.state.constants.getConstantValueForNode(node, elements);
1681 } 1681 }
1682 1682
1683 ConstantValue getConstantForVariable(VariableElement element) { 1683 ConstantValue getConstantForVariable(VariableElement element) {
1684 return irBuilder.state.constants.getConstantValueForVariable(element); 1684 return irBuilder.state.constants.getConstantValue(element.constant);
1685 } 1685 }
1686 1686
1687 ir.Primitive buildConstantExpression( 1687 ir.Primitive buildConstantExpression(
1688 ConstantExpression expression, SourceInformation sourceInformation) { 1688 ConstantExpression expression, SourceInformation sourceInformation) {
1689 return irBuilder.buildConstant( 1689 return irBuilder.buildConstant(
1690 irBuilder.state.constants.getConstantValue(expression), 1690 irBuilder.state.constants.getConstantValue(expression),
1691 sourceInformation: sourceInformation); 1691 sourceInformation: sourceInformation);
1692 } 1692 }
1693 1693
1694 /// Returns the allocation site-specific type for a given allocation. 1694 /// Returns the allocation site-specific type for a given allocation.
(...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after
4014 _backend.jsInteropAnalysis.hasAnonymousAnnotation(element.contextClass); 4014 _backend.jsInteropAnalysis.hasAnonymousAnnotation(element.contextClass);
4015 4015
4016 String getJsInteropTargetPath(FunctionElement element) { 4016 String getJsInteropTargetPath(FunctionElement element) {
4017 return '${_backend.namer.fixedBackendPath(element)}.' 4017 return '${_backend.namer.fixedBackendPath(element)}.'
4018 '${_backend.nativeData.getFixedBackendName(element)}'; 4018 '${_backend.nativeData.getFixedBackendName(element)}';
4019 } 4019 }
4020 4020
4021 DartType get jsJavascriptObjectType => 4021 DartType get jsJavascriptObjectType =>
4022 _backend.helpers.jsJavaScriptObjectClass.thisType; 4022 _backend.helpers.jsJavaScriptObjectClass.thisType;
4023 } 4023 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compile_time_constants.dart ('k') | pkg/compiler/lib/src/cps_ir/inline.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698