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

Side by Side Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2861733002: Handle const Symbol(...) in kernel_impact (Closed)
Patch Set: Created 3 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
« no previous file with comments | « pkg/compiler/lib/src/native/behavior.dart ('k') | pkg/compiler/lib/src/ssa/kernel_impact.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:js_runtime/shared/embedded_names.dart'; 5 import 'package:js_runtime/shared/embedded_names.dart';
6 import 'package:kernel/ast.dart' as ir; 6 import 'package:kernel/ast.dart' as ir;
7 7
8 import '../closure.dart'; 8 import '../closure.dart';
9 import '../common.dart'; 9 import '../common.dart';
10 import '../compiler.dart'; 10 import '../compiler.dart';
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 for (LocalFunctionElement localFunction in kernel.localFunctions.keys) { 79 for (LocalFunctionElement localFunction in kernel.localFunctions.keys) {
80 _nodeToElement[kernel.localFunctions[localFunction]] = localFunction; 80 _nodeToElement[kernel.localFunctions[localFunction]] = localFunction;
81 } 81 }
82 for (TypeVariableElement typeVariable in kernel.typeParameters.keys) { 82 for (TypeVariableElement typeVariable in kernel.typeParameters.keys) {
83 _nodeToElement[kernel.typeParameters[typeVariable]] = typeVariable; 83 _nodeToElement[kernel.typeParameters[typeVariable]] = typeVariable;
84 } 84 }
85 _typeConverter = new DartTypeConverter(this); 85 _typeConverter = new DartTypeConverter(this);
86 } 86 }
87 87
88 @override
89 ConstantValue computeConstantValue(ConstantExpression constant) {
90 return _compiler.constants.getConstantValue(constant);
91 }
92
88 /// Called to find the corresponding Kernel element for a particular Element 93 /// Called to find the corresponding Kernel element for a particular Element
89 /// before traversing over it with a Kernel visitor. 94 /// before traversing over it with a Kernel visitor.
90 ir.Node getInitialKernelNode(Element originTarget) { 95 ir.Node getInitialKernelNode(Element originTarget) {
91 ir.Node target; 96 ir.Node target;
92 if (originTarget.isPatch) { 97 if (originTarget.isPatch) {
93 originTarget = originTarget.origin; 98 originTarget = originTarget.origin;
94 } 99 }
95 if (originTarget is FunctionElement) { 100 if (originTarget is FunctionElement) {
96 if (originTarget is ConstructorBodyElement) { 101 if (originTarget is ConstructorBodyElement) {
97 ConstructorBodyElement body = originTarget; 102 ConstructorBodyElement body = originTarget;
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 JumpTarget continueTarget = 832 JumpTarget continueTarget =
828 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); 833 astAdapter.getJumpTarget(switchCase, isContinueTarget: true);
829 assert(continueTarget is KernelJumpTarget); 834 assert(continueTarget is KernelJumpTarget);
830 targetIndexMap[continueTarget] = switchIndex; 835 targetIndexMap[continueTarget] = switchIndex;
831 assert(builder.jumpTargets[continueTarget] == null); 836 assert(builder.jumpTargets[continueTarget] == null);
832 builder.jumpTargets[continueTarget] = this; 837 builder.jumpTargets[continueTarget] = this;
833 switchIndex++; 838 switchIndex++;
834 } 839 }
835 } 840 }
836 } 841 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/behavior.dart ('k') | pkg/compiler/lib/src/ssa/kernel_impact.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698