Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 /// Computes the [ConstantValue] for the constant [expression]. | 148 /// Computes the [ConstantValue] for the constant [expression]. |
| 149 ConstantValue getConstantValue(ir.Expression expression); | 149 ConstantValue getConstantValue(ir.Expression expression); |
| 150 | 150 |
| 151 /// Returns the `noSuchMethod` [FunctionEntity] call from a | 151 /// Returns the `noSuchMethod` [FunctionEntity] call from a |
| 152 /// `super.noSuchMethod` invocation within [cls]. | 152 /// `super.noSuchMethod` invocation within [cls]. |
| 153 FunctionEntity getSuperNoSuchMethod(ClassEntity cls); | 153 FunctionEntity getSuperNoSuchMethod(ClassEntity cls); |
| 154 | 154 |
| 155 /// Returns a [Spannable] for a message pointing to the IR [node] in the | 155 /// Returns a [Spannable] for a message pointing to the IR [node] in the |
| 156 /// context of [member]. | 156 /// context of [member]. |
| 157 Spannable getSpannable(MemberEntity member, ir.Node node); | 157 Spannable getSpannable(MemberEntity member, ir.Node node); |
| 158 | |
| 159 // TODO(johnniwinther): Move these to a `KernelToLocalsMap`, maybe even make | |
| 160 // the return the `KernelToLocalsMap` to use from now on. | |
| 161 /// Call to notify that [member] is currently being inlined. | |
| 162 void enterInlinedMember(MemberEntity member); | |
|
Siggi Cherem (dart-lang)
2017/06/01 22:08:47
mmm. Maybe you have more in mind behind this, but
Siggi Cherem (dart-lang)
2017/06/01 22:15:39
ha - just saw the next CL, seems like we are in ag
| |
| 163 | |
| 164 /// Call to notify that [member] is no longer being inlined. | |
| 165 void leaveInlinedMember(MemberEntity member); | |
| 158 } | 166 } |
| 159 | 167 |
| 160 /// Kinds of foreign functions. | 168 /// Kinds of foreign functions. |
| 161 enum ForeignKind { | 169 enum ForeignKind { |
| 162 JS, | 170 JS, |
| 163 JS_BUILTIN, | 171 JS_BUILTIN, |
| 164 JS_EMBEDDED_GLOBAL, | 172 JS_EMBEDDED_GLOBAL, |
| 165 JS_INTERCEPTOR_CONSTANT, | 173 JS_INTERCEPTOR_CONSTANT, |
| 166 NONE, | 174 NONE, |
| 167 } | 175 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 502 // `Object.superNoSuchMethod`. | 510 // `Object.superNoSuchMethod`. |
| 503 break; | 511 break; |
| 504 } | 512 } |
| 505 } | 513 } |
| 506 FunctionEntity function = elementEnvironment.lookupClassMember( | 514 FunctionEntity function = elementEnvironment.lookupClassMember( |
| 507 commonElements.objectClass, Identifiers.noSuchMethod_); | 515 commonElements.objectClass, Identifiers.noSuchMethod_); |
| 508 assert(invariant(cls, function != null, | 516 assert(invariant(cls, function != null, |
| 509 message: "No super noSuchMethod found for class $cls.")); | 517 message: "No super noSuchMethod found for class $cls.")); |
| 510 return function; | 518 return function; |
| 511 } | 519 } |
| 520 | |
| 521 @override | |
| 522 void enterInlinedMember(MemberEntity member) {} | |
| 523 | |
| 524 @override | |
| 525 void leaveInlinedMember(MemberEntity member) {} | |
| 512 } | 526 } |
| 513 | 527 |
| 514 /// Visitor that converts string literals and concatenations of string literals | 528 /// Visitor that converts string literals and concatenations of string literals |
| 515 /// into the string value. | 529 /// into the string value. |
| 516 class Stringifier extends ir.ExpressionVisitor<String> { | 530 class Stringifier extends ir.ExpressionVisitor<String> { |
| 517 @override | 531 @override |
| 518 String visitStringLiteral(ir.StringLiteral node) => node.value; | 532 String visitStringLiteral(ir.StringLiteral node) => node.value; |
| 519 | 533 |
| 520 @override | 534 @override |
| 521 String visitStringConcatenation(ir.StringConcatenation node) { | 535 String visitStringConcatenation(ir.StringConcatenation node) { |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 913 TypeMask typeOfIteratorCurrent(ir.ForInStatement forInStatement); | 927 TypeMask typeOfIteratorCurrent(ir.ForInStatement forInStatement); |
| 914 | 928 |
| 915 /// Returns the inferred type of `moveNext` in [forInStatement]. | 929 /// Returns the inferred type of `moveNext` in [forInStatement]. |
| 916 TypeMask typeOfIteratorMoveNext(ir.ForInStatement forInStatement); | 930 TypeMask typeOfIteratorMoveNext(ir.ForInStatement forInStatement); |
| 917 | 931 |
| 918 /// Returns `true` if [forInStatement] is inferred to be a JavaScript | 932 /// Returns `true` if [forInStatement] is inferred to be a JavaScript |
| 919 /// indexable iterator. | 933 /// indexable iterator. |
| 920 bool isJsIndexableIterator( | 934 bool isJsIndexableIterator( |
| 921 ir.ForInStatement forInStatement, ClosedWorld closedWorld); | 935 ir.ForInStatement forInStatement, ClosedWorld closedWorld); |
| 922 | 936 |
| 937 /// Returns `true` if [mask] is inferred to have a JavaScript `length` | |
| 938 /// property. | |
| 939 bool isFixedLength(TypeMask mask, ClosedWorld closedWorld); | |
| 940 | |
| 923 /// Returns the inferred index type of [forInStatement]. | 941 /// Returns the inferred index type of [forInStatement]. |
| 924 TypeMask inferredIndexType(ir.ForInStatement forInStatement); | 942 TypeMask inferredIndexType(ir.ForInStatement forInStatement); |
| 925 | 943 |
| 926 /// Returns the inferred type of [member]. | 944 /// Returns the inferred type of [member]. |
| 927 TypeMask getInferredTypeOf(MemberEntity member); | 945 TypeMask getInferredTypeOf(MemberEntity member); |
| 928 | 946 |
| 929 /// Returns the inferred type of a dynamic [selector] access on a receiver of | 947 /// Returns the inferred type of a dynamic [selector] access on a receiver of |
| 930 /// type [mask]. | 948 /// type [mask]. |
| 931 TypeMask selectorTypeOf(Selector selector, TypeMask mask); | 949 TypeMask selectorTypeOf(Selector selector, TypeMask mask); |
| 932 | 950 |
| 933 /// Returns the returned type annotation in the [nativeBehavior]. | 951 /// Returns the returned type annotation in the [nativeBehavior]. |
| 934 TypeMask typeFromNativeBehavior( | 952 TypeMask typeFromNativeBehavior( |
| 935 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld); | 953 native.NativeBehavior nativeBehavior, ClosedWorld closedWorld); |
| 936 } | 954 } |
| OLD | NEW |