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

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

Issue 3007523003: Prepare for handling super noSuchMethod (Closed)
Patch Set: Created 3 years, 4 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 | « no previous file | pkg/compiler/lib/src/kernel/element_map_impl.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 '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../constants/values.dart'; 9 import '../constants/values.dart';
10 import '../common_elements.dart'; 10 import '../common_elements.dart';
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 /// Returns the super [MemberEntity] for a super invocation, get or set of 70 /// Returns the super [MemberEntity] for a super invocation, get or set of
71 /// [name] from the member [context]. 71 /// [name] from the member [context].
72 /// 72 ///
73 /// The IR doesn't always resolve super accesses to the corresponding 73 /// The IR doesn't always resolve super accesses to the corresponding
74 /// [target]. If not, the target is computed using [name] and [setter] from 74 /// [target]. If not, the target is computed using [name] and [setter] from
75 /// the enclosing class of [context]. 75 /// the enclosing class of [context].
76 MemberEntity getSuperMember(ir.Member context, ir.Name name, ir.Member target, 76 MemberEntity getSuperMember(ir.Member context, ir.Name name, ir.Member target,
77 {bool setter: false}); 77 {bool setter: false});
78 78
79 /// Returns the `noSuchMethod` [FunctionEntity] call from a
80 /// `super.noSuchMethod` invocation within [cls].
81 FunctionEntity getSuperNoSuchMethod(ClassEntity cls);
82
79 /// Returns the [Name] corresponding to [name]. 83 /// Returns the [Name] corresponding to [name].
80 Name getName(ir.Name name); 84 Name getName(ir.Name name);
81 85
82 /// Return `true` if [node] is the `dart:_foreign_helper` library. 86 /// Return `true` if [node] is the `dart:_foreign_helper` library.
83 bool isForeignLibrary(ir.Library node); 87 bool isForeignLibrary(ir.Library node);
84 88
85 /// Computes the [native.NativeBehavior] for a call to the [JS] function. 89 /// Computes the [native.NativeBehavior] for a call to the [JS] function.
86 native.NativeBehavior getNativeBehaviorForJsCall(ir.StaticInvocation node); 90 native.NativeBehavior getNativeBehaviorForJsCall(ir.StaticInvocation node);
87 91
88 /// Computes the [native.NativeBehavior] for a call to the [JS_BUILTIN] 92 /// Computes the [native.NativeBehavior] for a call to the [JS_BUILTIN]
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 LibraryEntity getLibrary(ir.Library node); 185 LibraryEntity getLibrary(ir.Library node);
182 186
183 /// Returns the [js.Template] for the `JsBuiltin` [constant] value. 187 /// Returns the [js.Template] for the `JsBuiltin` [constant] value.
184 js.Template getJsBuiltinTemplate( 188 js.Template getJsBuiltinTemplate(
185 ConstantValue constant, CodeEmitterTask emitter); 189 ConstantValue constant, CodeEmitterTask emitter);
186 190
187 /// Return the [ConstantValue] the initial value of [field] or `null` if 191 /// Return the [ConstantValue] the initial value of [field] or `null` if
188 /// the initializer is not a constant expression. 192 /// the initializer is not a constant expression.
189 ConstantValue getFieldConstantValue(ir.Field field); 193 ConstantValue getFieldConstantValue(ir.Field field);
190 194
191 /// Returns the `noSuchMethod` [FunctionEntity] call from a
192 /// `super.noSuchMethod` invocation within [cls].
193 FunctionEntity getSuperNoSuchMethod(ClassEntity cls);
194
195 /// Returns a [Spannable] for a message pointing to the IR [node] in the 195 /// Returns a [Spannable] for a message pointing to the IR [node] in the
196 /// context of [member]. 196 /// context of [member].
197 Spannable getSpannable(MemberEntity member, ir.Node node); 197 Spannable getSpannable(MemberEntity member, ir.Node node);
198 198
199 /// Returns the constructor body entity corresponding to [constructor]. 199 /// Returns the constructor body entity corresponding to [constructor].
200 FunctionEntity getConstructorBody(ir.Constructor node); 200 FunctionEntity getConstructorBody(ir.Constructor node);
201 201
202 /// Returns the uri for the deferred import [node]. 202 /// Returns the uri for the deferred import [node].
203 // TODO(johnniwinther): Avoid this method by deriving the uri directly from 203 // TODO(johnniwinther): Avoid this method by deriving the uri directly from
204 // the node. 204 // the node.
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 uri = Uri.parse(node.location.file); 461 uri = Uri.parse(node.location.file);
462 break; 462 break;
463 } 463 }
464 node = node.parent; 464 node = node.parent;
465 } 465 }
466 if (uri != null) { 466 if (uri != null) {
467 return new SourceSpan(uri, offset, offset + 1); 467 return new SourceSpan(uri, offset, offset + 1);
468 } 468 }
469 return null; 469 return null;
470 } 470 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698