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

Side by Side Diff: pkg/compiler/lib/src/kernel/element_map.dart

Issue 2924803002: Avoid using FunctionSignature in builder_kernel (Closed)
Patch Set: Created 3 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/closure.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart'; 8 import '../common/names.dart';
9 import '../constants/constructors.dart'; 9 import '../constants/constructors.dart';
10 import '../constants/expressions.dart'; 10 import '../constants/expressions.dart';
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 /// Compute the kind of foreign helper function called by [node], if any. 142 /// Compute the kind of foreign helper function called by [node], if any.
143 ForeignKind getForeignKind(ir.StaticInvocation node); 143 ForeignKind getForeignKind(ir.StaticInvocation node);
144 144
145 /// Computes the [InterfaceType] referenced by a call to the 145 /// Computes the [InterfaceType] referenced by a call to the
146 /// [JS_INTERCEPTOR_CONSTANT] function, if any. 146 /// [JS_INTERCEPTOR_CONSTANT] function, if any.
147 InterfaceType getInterfaceTypeForJsInterceptorCall(ir.StaticInvocation node); 147 InterfaceType getInterfaceTypeForJsInterceptorCall(ir.StaticInvocation node);
148 148
149 /// Computes the [ConstantValue] for the constant [expression]. 149 /// Computes the [ConstantValue] for the constant [expression].
150 ConstantValue getConstantValue(ir.Expression expression, 150 ConstantValue getConstantValue(ir.Expression expression,
151 {bool requireConstant: true}); 151 {bool requireConstant: true, bool implicitNull: false});
152 152
153 /// Returns the `noSuchMethod` [FunctionEntity] call from a 153 /// Returns the `noSuchMethod` [FunctionEntity] call from a
154 /// `super.noSuchMethod` invocation within [cls]. 154 /// `super.noSuchMethod` invocation within [cls].
155 FunctionEntity getSuperNoSuchMethod(ClassEntity cls); 155 FunctionEntity getSuperNoSuchMethod(ClassEntity cls);
156 156
157 /// Returns a [Spannable] for a message pointing to the IR [node] in the 157 /// Returns a [Spannable] for a message pointing to the IR [node] in the
158 /// context of [member]. 158 /// context of [member].
159 Spannable getSpannable(MemberEntity member, ir.Node node); 159 Spannable getSpannable(MemberEntity member, ir.Node node);
160 } 160 }
161 161
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 return new Selector.getter(name); 236 return new Selector.getter(name);
237 } 237 }
238 238
239 Selector getSetterSelector(ir.Name irName) { 239 Selector getSetterSelector(ir.Name irName) {
240 Name name = new Name( 240 Name name = new Name(
241 irName.name, irName.isPrivate ? getLibrary(irName.library) : null); 241 irName.name, irName.isPrivate ? getLibrary(irName.library) : null);
242 return new Selector.setter(name); 242 return new Selector.setter(name);
243 } 243 }
244 244
245 ConstantValue getConstantValue(ir.Expression node, 245 ConstantValue getConstantValue(ir.Expression node,
246 {bool requireConstant: true}) { 246 {bool requireConstant: true, bool implicitNull: false}) {
247 ConstantExpression constant = 247 ConstantExpression constant;
248 new Constantifier(this, requireConstant: requireConstant).visit(node); 248 if (node == null) {
249 if (!implicitNull) {
250 throw new SpannableAssertionFailure(
251 CURRENT_ELEMENT_SPANNABLE, 'No expression for constant.');
252 }
253 constant = new NullConstantExpression();
254 } else {
255 constant =
256 new Constantifier(this, requireConstant: requireConstant).visit(node);
257 }
249 if (constant == null) { 258 if (constant == null) {
250 if (requireConstant) { 259 if (requireConstant) {
251 throw new UnsupportedError( 260 throw new UnsupportedError(
252 'No constant for ${DebugPrinter.prettyPrint(node)}'); 261 'No constant for ${DebugPrinter.prettyPrint(node)}');
253 } 262 }
254 return null; 263 return null;
255 } 264 }
256 return computeConstantValue(constant, requireConstant: requireConstant); 265 return computeConstantValue(constant, requireConstant: requireConstant);
257 } 266 }
258 267
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 /// Call to notify that [member] is no longer being inlined. 1020 /// Call to notify that [member] is no longer being inlined.
1012 void leaveInlinedMember(MemberEntity member); 1021 void leaveInlinedMember(MemberEntity member);
1013 1022
1014 /// Returns the [Local] for [node]. 1023 /// Returns the [Local] for [node].
1015 Local getLocal(ir.VariableDeclaration node); 1024 Local getLocal(ir.VariableDeclaration node);
1016 1025
1017 /// Returns the [JumpTarget] for the branch in [node]. 1026 /// Returns the [JumpTarget] for the branch in [node].
1018 // TODO(johnniwinther): Split this by kind of [node]? 1027 // TODO(johnniwinther): Split this by kind of [node]?
1019 JumpTarget getJumpTarget(ir.TreeNode node, {bool isContinueTarget: false}); 1028 JumpTarget getJumpTarget(ir.TreeNode node, {bool isContinueTarget: false});
1020 } 1029 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698