Remove Kernel's DispatchCategory

It complicates the intermediate language, none of the back ends are
using it, and it's not something that we want transformation writers
and code generators to deal with.

Change-Id: Ic79f7935dd8619bd233346bb25947e864f38a104
Reviewed-on: https://dart-review.googlesource.com/50440
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
This commit is contained in:
Kevin Millikin
2018-04-11 07:43:41 +00:00
committed by commit-bot@chromium.org
parent 678691334f
commit 74cf86cbbb
37 changed files with 124 additions and 464 deletions
@@ -1588,10 +1588,7 @@ class ShadowPropertyAssign extends ShadowComplexAssignmentWithReceiver {
Object _handleWriteContravariance(
ShadowTypeInferrer inferrer, DartType receiverType) {
var writeMember = inferrer.findPropertySetMember(receiverType, write);
inferrer.handlePropertySetContravariance(
receiver, writeMember, write is PropertySet ? write : null, write);
return writeMember;
return inferrer.findPropertySetMember(receiverType, write);
}
@override
@@ -39,7 +39,6 @@ class ValidatingInstrumentation implements Instrumentation {
'target',
],
'checks': const [
'callKind',
'covariance',
'checkGetterReturn',
'checkReturn',
@@ -12,7 +12,6 @@ import 'package:kernel/ast.dart'
ConditionalExpression,
ConstructorInvocation,
DartType,
DispatchCategory,
DynamicType,
Expression,
Field,
@@ -59,8 +58,7 @@ import '../../base/instrumentation.dart'
Instrumentation,
InstrumentationValueForMember,
InstrumentationValueForType,
InstrumentationValueForTypeArgs,
InstrumentationValueLiteral;
InstrumentationValueForTypeArgs;
import '../fasta_codes.dart';
@@ -853,8 +851,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
return expressionToReplace;
}
/// Determines the dispatch category of a [PropertyGet] and adds an "as" check
/// if necessary due to contravariance.
/// Add an "as" check if necessary due to contravariance.
///
/// Returns the "as" check if it was added; otherwise returns the original
/// expression.
@@ -865,17 +862,10 @@ abstract class TypeInferrerImpl extends TypeInferrer {
Expression expression,
DartType inferredType,
int fileOffset) {
DispatchCategory callKind;
if (receiver is ThisExpression || receiver == null) {
callKind = DispatchCategory.viaThis;
} else if (interfaceMember == null) {
callKind = DispatchCategory.dynamicDispatch;
} else {
callKind = DispatchCategory.interface;
}
desugaredGet?.dispatchCategory = callKind;
bool checkReturn = false;
if (callKind == DispatchCategory.interface) {
if (receiver != null &&
interfaceMember != null &&
receiver is! ThisExpression) {
if (interfaceMember is Procedure) {
checkReturn = interfaceMember.isGenericContravariant;
} else if (interfaceMember is Field) {
@@ -891,57 +881,13 @@ abstract class TypeInferrerImpl extends TypeInferrer {
..fileOffset = fileOffset;
parent.replaceChild(expressionToReplace, replacedExpression);
}
if (instrumentation != null) {
int offset = expression.fileOffset;
switch (callKind) {
case DispatchCategory.dynamicDispatch:
instrumentation.record(uri, offset, 'callKind',
new InstrumentationValueLiteral('dynamic'));
break;
case DispatchCategory.viaThis:
instrumentation.record(
uri, offset, 'callKind', new InstrumentationValueLiteral('this'));
break;
default:
break;
}
if (checkReturn) {
instrumentation.record(uri, offset, 'checkReturn',
new InstrumentationValueForType(inferredType));
}
if (instrumentation != null && checkReturn) {
instrumentation.record(uri, expression.fileOffset, 'checkReturn',
new InstrumentationValueForType(inferredType));
}
return replacedExpression;
}
/// Determines the dispatch category of a [PropertySet].
void handlePropertySetContravariance(Expression receiver,
Object interfaceMember, PropertySet desugaredSet, Expression expression) {
DispatchCategory callKind;
if (receiver is ThisExpression || receiver == null) {
callKind = DispatchCategory.viaThis;
} else if (interfaceMember == null) {
callKind = DispatchCategory.dynamicDispatch;
} else {
callKind = DispatchCategory.interface;
}
desugaredSet?.dispatchCategory = callKind;
if (instrumentation != null) {
int offset = expression.fileOffset;
switch (callKind) {
case DispatchCategory.dynamicDispatch:
instrumentation.record(uri, offset, 'callKind',
new InstrumentationValueLiteral('dynamic'));
break;
case DispatchCategory.viaThis:
instrumentation.record(
uri, offset, 'callKind', new InstrumentationValueLiteral('this'));
break;
default:
break;
}
}
}
/// Modifies a type as appropriate when inferring a declared variable's type.
DartType inferDeclarationType(DartType initializerType) {
if (initializerType is BottomType ||
@@ -1461,62 +1407,28 @@ abstract class TypeInferrerImpl extends TypeInferrer {
MethodInvocation desugaredInvocation,
Arguments arguments,
Expression expression) {
DispatchCategory callKind;
var checkKind = MethodContravarianceCheckKind.none;
if (interfaceMember is Field ||
interfaceMember is Procedure &&
interfaceMember.kind == ProcedureKind.Getter) {
var getType = getCalleeType(interfaceMember, receiverType);
if (getType is DynamicType) {
callKind = DispatchCategory.dynamicDispatch;
} else {
callKind = DispatchCategory.closure;
if (receiver is! ThisExpression && receiver != null) {
if (interfaceMember is Field &&
interfaceMember.isGenericContravariant) {
checkKind = MethodContravarianceCheckKind.checkGetterReturn;
} else if (interfaceMember is Procedure &&
interfaceMember.isGenericContravariant) {
checkKind = MethodContravarianceCheckKind.checkGetterReturn;
}
return MethodContravarianceCheckKind.none;
}
if (receiver != null && receiver is! ThisExpression) {
if ((interfaceMember is Field &&
interfaceMember.isGenericContravariant) ||
(interfaceMember is Procedure &&
interfaceMember.isGenericContravariant)) {
return MethodContravarianceCheckKind.checkGetterReturn;
}
}
} else if (receiver is ThisExpression || receiver == null) {
callKind = DispatchCategory.viaThis;
} else if (identical(interfaceMember, 'call')) {
callKind = DispatchCategory.closure;
} else if (interfaceMember == null) {
callKind = DispatchCategory.dynamicDispatch;
} else {
callKind = DispatchCategory.interface;
if (interfaceMember is Procedure &&
interfaceMember.isGenericContravariant) {
checkKind = MethodContravarianceCheckKind.checkMethodReturn;
}
} else if (receiver != null &&
receiver is! ThisExpression &&
interfaceMember is Procedure &&
interfaceMember.isGenericContravariant) {
return MethodContravarianceCheckKind.checkMethodReturn;
}
desugaredInvocation?.dispatchCategory = callKind;
if (instrumentation != null) {
int offset = arguments.fileOffset == -1
? expression.fileOffset
: arguments.fileOffset;
switch (callKind) {
case DispatchCategory.closure:
instrumentation.record(uri, offset, 'callKind',
new InstrumentationValueLiteral('closure'));
break;
case DispatchCategory.dynamicDispatch:
instrumentation.record(uri, offset, 'callKind',
new InstrumentationValueLiteral('dynamic'));
break;
case DispatchCategory.viaThis:
instrumentation.record(
uri, offset, 'callKind', new InstrumentationValueLiteral('this'));
break;
default:
break;
}
}
return checkKind;
return MethodContravarianceCheckKind.none;
}
/// If the given [type] is a [TypeParameterType], resolve it to its bound.
@@ -13,16 +13,16 @@ class C {
dynamic get h => null;
void test() {
// Call via this
f /*@callKind=this*/ ();
this.f /*@callKind=this*/ ();
f();
this.f();
// Get via this, then closure invocation
g /*@callKind=closure*/ ();
this.g /*@callKind=closure*/ ();
g();
this.g();
// Get via this, then dynamic invocation
h /*@callKind=dynamic*/ ();
this.h /*@callKind=dynamic*/ ();
h();
this.h();
}
}
@@ -31,19 +31,19 @@ void test(C c, F f, dynamic d) {
c.f();
// Closure invocation
f /*@callKind=closure*/ ();
f();
// Dynamic call
d /*@callKind=dynamic*/ ();
d();
// Dynamic call
d.f /*@callKind=dynamic*/ ();
d.f();
// Get via interface, then closure invocation
c.g /*@callKind=closure*/ ();
c.g();
// Get via interface, then dynamic invocation
c.h /*@callKind=dynamic*/ ();
c.h();
}
main() {}
@@ -10,10 +10,10 @@ class C {
dynamic y;
void test() {
// Get via this
var v1 = /*@callKind=this*/ x;
var v2 = this. /*@callKind=this*/ x;
var v3 = /*@callKind=this*/ y;
var v4 = this. /*@callKind=this*/ y;
var v1 = x;
var v2 = this.x;
var v3 = y;
var v4 = this.y;
}
}
@@ -23,7 +23,7 @@ void test(C c, dynamic d) {
var v2 = c.y;
// Dynamic get
var v3 = d. /*@callKind=dynamic*/ x;
var v3 = d.x;
}
main() {}
@@ -10,10 +10,10 @@ class C {
dynamic y;
void test() {
// Set via this
/*@callKind=this*/ x = null;
this. /*@callKind=this*/ x = null;
/*@callKind=this*/ y = null;
this. /*@callKind=this*/ y = null;
x = null;
this.x = null;
y = null;
this.y = null;
}
}
@@ -23,7 +23,7 @@ void test(C c, dynamic d) {
c.y = null;
// Dynamic set
d. /*@callKind=dynamic*/ x = null;
d.x = null;
}
main() {}
@@ -10,7 +10,7 @@ typedef void F<T>(T x);
class C<T> {
F<T> /*@genericContravariant=true*/ y;
void f() {
var x = this. /*@callKind=this*/ y;
var x = this.y;
}
}
@@ -10,19 +10,19 @@ typedef void F<T>(T x);
class C<T> {
F<T> /*@genericContravariant=true*/ f1() {}
List<F<T>> /*@genericContravariant=true*/ f2() {
return [this.f1 /*@callKind=this*/ ()];
return [this.f1()];
}
}
void g1(C<num> c) {
var x = c.f1 /*@checkReturn=(num) -> void*/ ();
print('hello');
x /*@callKind=closure*/ (1.5);
x(1.5);
}
void g2(C<num> c) {
F<int> x = c.f1 /*@checkReturn=(num) -> void*/ ();
x /*@callKind=closure*/ (1);
x(1);
}
void g3(C<num> c) {
@@ -10,19 +10,19 @@ typedef void F<T>(T x);
class C<T> {
F<T> /*@genericContravariant=true*/ f1() {}
List<F<T>> /*@genericContravariant=true*/ f2() {
return [this?.f1 /*@callKind=this*/ ()];
return [this?.f1()];
}
}
void g1(C<num> c) {
var x = c?.f1 /*@checkReturn=(num) -> void*/ ();
print('hello');
x /*@callKind=closure*/ (1.5);
x(1.5);
}
void g2(C<num> c) {
F<int> x = c?.f1 /*@checkReturn=(num) -> void*/ ();
x /*@callKind=closure*/ (1);
x(1);
}
void g3(C<num> c) {
@@ -11,7 +11,7 @@ typedef F<T> G<T>();
class C<T> {
F<T> /*@genericContravariant=true*/ _x;
C(this._x);
F<T> /*@genericContravariant=true*/ f() => /*@callKind=this*/ _x;
F<T> /*@genericContravariant=true*/ f() => _x;
}
G<num> g(C<num> c) {
@@ -10,12 +10,12 @@ typedef void F<T>(T x);
class C<T> {
F<T> /*@genericContravariant=true*/ y;
void f(T /*@covariance=genericInterface, genericImpl*/ value) {
this.y /*@callKind=closure*/ (value);
this.y(value);
}
}
void g(C<num> c) {
c.y /*@checkGetterReturn=(num) -> void*/ /*@callKind=closure*/ (1.5);
c.y /*@checkGetterReturn=(num) -> void*/ (1.5);
}
void main() {}
@@ -10,19 +10,19 @@ typedef void F<T>(T x);
class C<T> {
F<T> get /*@genericContravariant=true*/ f1 => null;
List<F<T>> get /*@genericContravariant=true*/ f2 {
return [this. /*@callKind=this*/ f1];
return [this.f1];
}
}
void g1(C<num> c) {
var x = c. /*@checkReturn=(num) -> void*/ f1;
print('hello');
x /*@callKind=closure*/ (1.5);
x(1.5);
}
void g2(C<num> c) {
F<int> x = c. /*@checkReturn=(num) -> void*/ f1;
x /*@callKind=closure*/ (1);
x(1);
}
void g3(C<num> c) {
@@ -10,19 +10,19 @@ typedef void F<T>(T x);
class C<T> {
F<T> get /*@genericContravariant=true*/ f1 => null;
List<F<T>> get /*@genericContravariant=true*/ f2 {
return [this?. /*@callKind=this*/ f1];
return [this?.f1];
}
}
void g1(C<num> c) {
var x = c?. /*@checkReturn=(num) -> void*/ f1;
print('hello');
x /*@callKind=closure*/ (1.5);
x(1.5);
}
void g2(C<num> c) {
F<int> x = c?. /*@checkReturn=(num) -> void*/ f1;
x /*@callKind=closure*/ (1);
x(1);
}
void g3(C<num> c) {
@@ -8,7 +8,7 @@ library test;
class C<T> {
void f< /*@covariance=genericInterface, genericImpl*/ U extends T>(U x) {}
void g1< /*@covariance=genericInterface, genericImpl*/ U extends T>() {
this.f<U> /*@callKind=this*/ (1.5);
this.f<U>(1.5);
}
}
@@ -8,10 +8,10 @@ class C<T extends core::Object> extends core::Object {
;
method f<generic-covariant-impl generic-covariant-interface U extends self::C::T>(self::C::f::U x) → void {}
method g1<generic-covariant-impl generic-covariant-interface U extends self::C::T>() → void {
this.{self::C::f}<self::C::g1::U>(let final dynamic #t1 = 1.5 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:35: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
this.{self::C::f}<self::C::g1::U>(let final dynamic #t1 = 1.5 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:15: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
Try changing the type of the left hand side, or casting the right hand side to 'test::C::g1::U'.
this.f<U> /*@callKind=this*/ (1.5);
^");
this.f<U>(1.5);
^");
}
}
static method g2(self::C<core::Object> c) → void {
@@ -8,10 +8,10 @@ class C<T extends core::Object> extends core::Object {
;
method f<generic-covariant-impl generic-covariant-interface U extends self::C::T>(self::C::f::U x) → void {}
method g1<generic-covariant-impl generic-covariant-interface U extends self::C::T>() → void {
this.{self::C::f}<self::C::g1::U>(let final core::double #t1 = 1.5 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:35: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
this.{self::C::f}<self::C::g1::U>(let final core::double #t1 = 1.5 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:15: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
Try changing the type of the left hand side, or casting the right hand side to 'test::C::g1::U'.
this.f<U> /*@callKind=this*/ (1.5);
^");
this.f<U>(1.5);
^");
}
}
static method g2(self::C<core::Object> c) → void {
@@ -20,7 +20,7 @@ F<num> g1(C<num> c) {
void g2(C<int> c, Object x) {
F<Object> f = g1(c) as F<Object>;
f /*@callKind=closure*/ (x);
f(x);
}
G<List<num>, num> g3(C<num> c) {
@@ -29,7 +29,7 @@ G<List<num>, num> g3(C<num> c) {
void test() {
var x = g1(new C<int>());
x /*@callKind=closure*/ (1.5);
x(1.5);
g3(new C<int>());
}
@@ -11,8 +11,8 @@ class C<T> {
T /*@covariance=genericInterface, genericImpl*/ x;
void set y(T /*@covariance=genericInterface, genericImpl*/ value) {}
void f(T /*@covariance=genericInterface, genericImpl*/ value) {
this. /*@callKind=this*/ x = value;
this. /*@callKind=this*/ y = value;
this.x = value;
this.y = value;
}
}
@@ -15,11 +15,11 @@ class D extends C<num> {
}
void g1(dynamic d) {
d.f1 /*@callKind=dynamic*/ (1.5);
d.f1(1.5);
}
void g2(dynamic d) {
d.f2 /*@callKind=dynamic*/ (1.5);
d.f2(1.5);
}
void test() {
@@ -10,11 +10,11 @@ class C<T> {
}
void g1(dynamic d) {
d.f<num> /*@callKind=dynamic*/ (1.5);
d.f<num>(1.5);
}
void g2(dynamic d) {
d.f /*@callKind=dynamic*/ (1.5);
d.f(1.5);
}
void test() {
@@ -11,7 +11,7 @@ class C {
}
void g(C c) {
c.f /*@callKind=dynamic*/ (1.5);
c.f(1.5);
}
void h(int i) {}
@@ -8,16 +8,16 @@ library test;
class B {
Object _x;
void f([num x = 10]) {
/*@callKind=this*/ _x = x;
_x = x;
}
void g({num x = 20}) {
/*@callKind=this*/ _x = x;
_x = x;
}
void check(Object expectedValue) {
if (/*@callKind=this*/ _x != expectedValue) {
throw 'Expected _x == $expectedValue; got ${/*@callKind=this*/_x}';
if (_x != expectedValue) {
throw 'Expected _x == $expectedValue; got ${_x}';
}
}
}
@@ -10,11 +10,11 @@ typedef F<T>(T x);
class C<T> {
void f(T /*@covariance=genericInterface, genericImpl*/ x) {}
void g1(T /*@covariance=genericInterface, genericImpl*/ x) {
this.f /*@callKind=this*/ (x);
this.f(x);
}
void g2(T /*@covariance=genericInterface, genericImpl*/ x) {
f /*@callKind=this*/ (x);
f(x);
}
void g3(C<T> /*@covariance=genericInterface, genericImpl*/ c,
@@ -22,7 +22,7 @@ class C<T> {
c.f(x);
}
F<T> /*@genericContravariant=true*/ g4() => this. /*@callKind=this*/ f;
F<T> /*@genericContravariant=true*/ g4() => this.f;
}
class
@@ -43,7 +43,7 @@ class /*@forwardingStub=abstract void g1(covariance=(genericImpl) num x)*/
test() {
var x = new D().g4() as F<Object>;
x /*@callKind=closure*/ ('hi');
x('hi');
new E().g1(1.5);
}
@@ -7,7 +7,7 @@ library test;
void expectTypeError(void callback()) {
try {
callback /*@callKind=closure*/ ();
callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
@@ -21,17 +21,17 @@ void expect(Object value, Object expected) {
class C<T> {
C(this.plusResult);
final num Function(T) /*@genericContravariant=true*/ plusResult;
num Function(T) operator /*@genericContravariant=true*/ +(
int i) => /*@callKind=this*/ plusResult;
num Function(T) operator /*@genericContravariant=true*/ +(int i) =>
plusResult;
}
class D {
D(this.getValue);
final C<num> getValue;
C<num> get value => /*@callKind=this*/ getValue;
C<num> get value => getValue;
int Function(int) setValue;
void set value(int Function(int) value) {
/*@callKind=this*/ setValue = value;
setValue = value;
}
}
@@ -48,7 +48,7 @@ void main() {
// (num)->num
D d = new D(new C(numToInt));
d.value /*@checkReturn=(num) -> num*/ += 1;
expect(d.setValue /*@callKind=closure*/ (0), 1);
expect(d.setValue(0), 1);
d = new D(new C(numToNum));
expectTypeError(() {
d.value /*@checkReturn=(num) -> num*/ += 1;
@@ -19,8 +19,8 @@ class C {
for (topLevelSetter in []) {}
for (staticField in []) {}
for (staticSetter in []) {}
for (/*@callKind=this*/ instanceField in []) {}
for (/*@callKind=this*/ instanceSetter in []) {}
for (instanceField in []) {}
for (instanceSetter in []) {}
for (localVar in []) {}
}
}
@@ -7,7 +7,7 @@ library test;
void expectTypeError(void callback()) {
try {
callback /*@callKind=closure*/ ();
callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
@@ -9,7 +9,7 @@ typedef void F<T>(T t);
void expectTypeError(void callback()) {
try {
callback /*@callKind=closure*/ ();
callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
@@ -36,7 +36,7 @@ abstract class I<T> {
}
abstract class M<T> {
T get x => f /*@callKind=this*/ ();
T get x => f();
void set x(Object value) {
throw 'Should not be reached';
}
@@ -64,7 +64,7 @@ void test(I<Object> iObj, I<int> iInt) {
});
// iInt.x is expected to return type (int) -> void, and it does.
var x = iInt. /*@checkReturn=(int) -> void*/ x;
x /*@callKind=closure*/ (1);
x(1);
}
void main() {
@@ -7,7 +7,7 @@ library test;
void expectTypeError(void callback()) {
try {
callback /*@callKind=closure*/ ();
callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
@@ -7,7 +7,7 @@ library test;
void expectTypeError(void callback()) {
try {
callback /*@callKind=closure*/ ();
callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
-6
View File
@@ -515,7 +515,6 @@ type SpecializedVariableSet extends Expression {
type PropertyGet extends Expression {
Byte tag = 22;
FileOffset fileOffset;
Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
Name name;
MemberReference interfaceTarget; // May be NullReference.
@@ -524,7 +523,6 @@ type PropertyGet extends Expression {
type PropertySet extends Expression {
Byte tag = 23;
FileOffset fileOffset;
Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
Name name;
Expression value;
@@ -549,7 +547,6 @@ type SuperPropertySet extends Expression {
type DirectPropertyGet extends Expression {
Byte tag = 15; // Note: tag is out of order
FileOffset fileOffset;
Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
MemberReference target;
}
@@ -557,7 +554,6 @@ type DirectPropertyGet extends Expression {
type DirectPropertySet extends Expression {
Byte tag = 16; // Note: tag is out of order
FileOffset fileOffset;
Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
MemberReference target;
Expression value;
@@ -593,7 +589,6 @@ type NamedExpression {
type MethodInvocation extends Expression {
Byte tag = 28;
FileOffset fileOffset;
Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
Name name;
Arguments arguments;
@@ -611,7 +606,6 @@ type SuperMethodInvocation extends Expression {
type DirectMethodInvocation extends Expression {
Byte tag = 17; // Note: tag is out of order
FileOffset fileOffset;
Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
MemberReference target;
Arguments arguments;
-176
View File
@@ -2185,7 +2185,6 @@ class PropertyGet extends Expression {
Expression receiver;
@coq
Name name;
int flags = 0;
@nocoq
Reference interfaceTargetReference;
@@ -2196,19 +2195,6 @@ class PropertyGet extends Expression {
PropertyGet.byReference(
this.receiver, this.name, this.interfaceTargetReference) {
receiver?.parent = this;
this.dispatchCategory = DispatchCategory.dynamicDispatch;
}
// Must match serialized bit positions
static const int ShiftDispatchCategory = 0;
static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
DispatchCategory get dispatchCategory => DispatchCategory
.values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
void set dispatchCategory(DispatchCategory value) {
flags = (flags & ~FlagDispatchCategory) |
(value.index << ShiftDispatchCategory);
}
Member get interfaceTarget => interfaceTargetReference?.asMember;
@@ -2261,7 +2247,6 @@ class PropertySet extends Expression {
Expression receiver;
Name name;
Expression value;
int flags = 0;
Reference interfaceTargetReference;
@@ -2274,19 +2259,6 @@ class PropertySet extends Expression {
this.receiver, this.name, this.value, this.interfaceTargetReference) {
receiver?.parent = this;
value?.parent = this;
this.dispatchCategory = DispatchCategory.dynamicDispatch;
}
// Must match serialized bit positions.
static const int ShiftDispatchCategory = 0;
static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
DispatchCategory get dispatchCategory => DispatchCategory
.values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
void set dispatchCategory(DispatchCategory value) {
flags = (flags & ~FlagDispatchCategory) |
(value.index << ShiftDispatchCategory);
}
Member get interfaceTarget => interfaceTargetReference?.asMember;
@@ -2322,26 +2294,12 @@ class PropertySet extends Expression {
class DirectPropertyGet extends Expression {
Expression receiver;
Reference targetReference;
int flags = 0;
DirectPropertyGet(Expression receiver, Member target)
: this.byReference(receiver, getMemberReference(target));
DirectPropertyGet.byReference(this.receiver, this.targetReference) {
receiver?.parent = this;
this.dispatchCategory = DispatchCategory.dynamicDispatch;
}
// Must match serialized bit positions
static const int ShiftDispatchCategory = 0;
static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
DispatchCategory get dispatchCategory => DispatchCategory
.values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
void set dispatchCategory(DispatchCategory value) {
flags = (flags & ~FlagDispatchCategory) |
(value.index << ShiftDispatchCategory);
}
Member get target => targetReference?.asMember;
@@ -2381,7 +2339,6 @@ class DirectPropertySet extends Expression {
Expression receiver;
Reference targetReference;
Expression value;
int flags = 0;
DirectPropertySet(Expression receiver, Member target, Expression value)
: this.byReference(receiver, getMemberReference(target), value);
@@ -2392,18 +2349,6 @@ class DirectPropertySet extends Expression {
value?.parent = this;
}
// Must match serialized bit positions
static const int ShiftDispatchCategory = 0;
static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
DispatchCategory get dispatchCategory => DispatchCategory
.values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
void set dispatchCategory(DispatchCategory value) {
flags = (flags & ~FlagDispatchCategory) |
(value.index << ShiftDispatchCategory);
}
Member get target => targetReference?.asMember;
void set target(Member target) {
@@ -2438,7 +2383,6 @@ class DirectMethodInvocation extends InvocationExpression {
Expression receiver;
Reference targetReference;
Arguments arguments;
int flags = 0;
DirectMethodInvocation(
Expression receiver, Procedure target, Arguments arguments)
@@ -2448,19 +2392,6 @@ class DirectMethodInvocation extends InvocationExpression {
this.receiver, this.targetReference, this.arguments) {
receiver?.parent = this;
arguments?.parent = this;
this.dispatchCategory = DispatchCategory.dynamicDispatch;
}
// Must match serialized bit positions
static const int ShiftDispatchCategory = 0;
static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
DispatchCategory get dispatchCategory => DispatchCategory
.values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
void set dispatchCategory(DispatchCategory value) {
flags = (flags & ~FlagDispatchCategory) |
(value.index << ShiftDispatchCategory);
}
Procedure get target => targetReference?.asProcedure;
@@ -2516,8 +2447,6 @@ class SuperPropertyGet extends Expression {
Reference interfaceTargetReference;
DispatchCategory get dispatchCategory => DispatchCategory.viaThis;
SuperPropertyGet(Name name, [Member interfaceTarget])
: this.byReference(name, getMemberReference(interfaceTarget));
@@ -2740,7 +2669,6 @@ class MethodInvocation extends InvocationExpression {
Expression receiver;
Name name;
Arguments arguments;
int flags = 0;
Reference interfaceTargetReference;
@@ -2753,19 +2681,6 @@ class MethodInvocation extends InvocationExpression {
this.receiver, this.name, this.arguments, this.interfaceTargetReference) {
receiver?.parent = this;
arguments?.parent = this;
this.dispatchCategory = DispatchCategory.dynamicDispatch;
}
// Must match serialized bit positions
static const int ShiftDispatchCategory = 0;
static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
DispatchCategory get dispatchCategory => DispatchCategory
.values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
void set dispatchCategory(DispatchCategory value) {
flags = (flags & ~FlagDispatchCategory) |
(value.index << ShiftDispatchCategory);
}
Member get interfaceTarget => interfaceTargetReference?.asMember;
@@ -2841,7 +2756,6 @@ class MethodInvocation extends InvocationExpression {
class SuperMethodInvocation extends InvocationExpression {
Name name;
Arguments arguments;
DispatchCategory get dispatchCategory => DispatchCategory.viaThis;
Reference interfaceTargetReference;
@@ -4404,96 +4318,6 @@ class YieldStatement extends Statement {
}
}
/// Categorization of a call site indicating its effect on type guarantees.
enum DispatchCategory {
/// This call site binds to its callee through a specific interface.
///
/// The front end guarantees that the target of the call exists, has the
/// correct arity, and accepts all of the supplied named parameters. Further,
/// it guarantees that the number of type parameters supplied matches the
/// number of type parameters expected by the target of the call.
///
/// Due to parameter covariance, it is not necessarily guaranteed that the
/// actual values of parameters will match the declared types of those
/// parameters in the method actually being called. A runtime type check is
/// required for any parameter meeting one of the following conditions:
///
/// - The parameter in the interface target is tagged with
/// `isGenericCovariantInterface`, and the corresponding parameter in the
/// method actually being called is tagged with `isGenericCovariantImpl`.
///
/// - The parameter in the method actually being called is tagged with
/// `isCovariant`.
///
/// Note: type parameters of generic methods require similar checks; the
/// flags `isGenericCovariantInterface` and `isGenericCovariantImpl` are found
/// in [TypeParameter], and the implementation must check that the actual
/// type is a subtype of the type parameter bound declared in the actual
/// method being called. For type parameter checks, there is no `isCovariant`
/// tag.
///
/// Note: if the interface target or the method actually being called is a
/// field, then the tags `isGenericCovariantInterface`,
/// `isGenericCovariantImpl`, and `isCovariant` are found in [Field].
interface,
/// This call site binds to its callee via a call on `this`.
///
/// Similar to [interface], however the target of the call is a method on
/// `this` or `super`, therefore all of the class's type parameters are known
/// to match exactly.
///
/// Due to parameter covariance, it is not necessarily guaranteed that the
/// actual values of parameters will match the declared types of those
/// parameters in the method actually being called. A runtime type check is
/// required for any parameter meeting one of the following condition:
///
/// - The parameter in the method actually being called is tagged with
/// `isCovariant`.
///
/// Note: type parameters of generic methods do not require a check when the
/// call is via `this`.
///
/// Note: if the interface target or the method actually being called is a
/// field, then the tag `isCovariant` is found in [Field].
viaThis,
/// This call site is an invocation of a function object (formed either by a
/// tear off or a function literal).
///
/// Similar to [interface], however the interface target of the call is not
/// known.
///
/// Due to parameter covariance, it is not necessarily guaranteed that the
/// actual values of parameters will match the declared types of those
/// parameters in the method actually being called. A runtime type check is
/// required for any parameter meeting one of the following conditions:
///
/// - The parameter in the method actually being called is tagged with
/// `isGenericCovariantImpl`.
///
/// - The parameter in the method actually being called is tagged with
/// `isCovariant`.
///
/// Note: type parameters of generic methods require similar checks; the
/// flag `isGenericCovariantImpl` is found in [TypeParameter], and the
/// implementation must check that the actual type is a subtype of the type
/// parameter bound declared in the actual method being called. For type
/// parameter checks, there is no `isCovariant` tag.
///
/// Note: if the interface target or the method actually being called is a
/// field, then the tags `isGenericCovariantImpl` and `isCovariant` are found
/// in [Field].
closure,
/// The call site is dynamic.
///
/// The front end makes no guarantees that the target of the call will accept
/// the actual runtime types of the parameters, nor that the target of the
/// call even exists. Everything must be checked at runtime.
dynamicDispatch,
}
/// Declaration of a local variable.
///
/// This may occur as a statement, but is also used in several non-statement
+6 -18
View File
@@ -1212,18 +1212,14 @@ class BinaryBuilder {
..fileOffset = offset;
case Tag.PropertyGet:
int offset = readOffset();
int flags = readByte();
return new PropertyGet.byReference(
readExpression(), readName(), readMemberReference(allowNull: true))
..fileOffset = offset
..flags = flags;
..fileOffset = offset;
case Tag.PropertySet:
int offset = readOffset();
int flags = readByte();
return new PropertySet.byReference(readExpression(), readName(),
readExpression(), readMemberReference(allowNull: true))
..fileOffset = offset
..flags = flags;
..fileOffset = offset;
case Tag.SuperPropertyGet:
int offset = readOffset();
addTransformerFlag(TransformerFlag.superCalls);
@@ -1238,18 +1234,14 @@ class BinaryBuilder {
..fileOffset = offset;
case Tag.DirectPropertyGet:
int offset = readOffset();
int flags = readByte();
return new DirectPropertyGet.byReference(
readExpression(), readMemberReference())
..fileOffset = offset
..flags = flags;
..fileOffset = offset;
case Tag.DirectPropertySet:
int offset = readOffset();
int flags = readByte();
return new DirectPropertySet.byReference(
readExpression(), readMemberReference(), readExpression())
..fileOffset = offset
..flags = flags;
..fileOffset = offset;
case Tag.StaticGet:
int offset = readOffset();
return new StaticGet.byReference(readMemberReference())
@@ -1261,11 +1253,9 @@ class BinaryBuilder {
..fileOffset = offset;
case Tag.MethodInvocation:
int offset = readOffset();
int flags = readByte();
return new MethodInvocation.byReference(readExpression(), readName(),
readArguments(), readMemberReference(allowNull: true))
..fileOffset = offset
..flags = flags;
..fileOffset = offset;
case Tag.SuperMethodInvocation:
int offset = readOffset();
addTransformerFlag(TransformerFlag.superCalls);
@@ -1274,11 +1264,9 @@ class BinaryBuilder {
..fileOffset = offset;
case Tag.DirectMethodInvocation:
int offset = readOffset();
int flags = readByte();
return new DirectMethodInvocation.byReference(
readExpression(), readMemberReference(), readArguments())
..fileOffset = offset
..flags = flags;
..fileOffset = offset;
case Tag.StaticInvocation:
int offset = readOffset();
return new StaticInvocation.byReference(
-6
View File
@@ -1002,7 +1002,6 @@ class BinaryPrinter implements Visitor<void>, BinarySink {
void visitPropertyGet(PropertyGet node) {
writeByte(Tag.PropertyGet);
writeOffset(node.fileOffset);
writeByte(node.flags);
writeNode(node.receiver);
writeName(node.name);
writeReference(node.interfaceTargetReference);
@@ -1012,7 +1011,6 @@ class BinaryPrinter implements Visitor<void>, BinarySink {
void visitPropertySet(PropertySet node) {
writeByte(Tag.PropertySet);
writeOffset(node.fileOffset);
writeByte(node.flags);
writeNode(node.receiver);
writeName(node.name);
writeNode(node.value);
@@ -1040,7 +1038,6 @@ class BinaryPrinter implements Visitor<void>, BinarySink {
void visitDirectPropertyGet(DirectPropertyGet node) {
writeByte(Tag.DirectPropertyGet);
writeOffset(node.fileOffset);
writeByte(node.flags);
writeNode(node.receiver);
writeReference(node.targetReference);
}
@@ -1049,7 +1046,6 @@ class BinaryPrinter implements Visitor<void>, BinarySink {
void visitDirectPropertySet(DirectPropertySet node) {
writeByte(Tag.DirectPropertySet);
writeOffset(node.fileOffset);
writeByte(node.flags);
writeNode(node.receiver);
writeReference(node.targetReference);
writeNode(node.value);
@@ -1074,7 +1070,6 @@ class BinaryPrinter implements Visitor<void>, BinarySink {
void visitMethodInvocation(MethodInvocation node) {
writeByte(Tag.MethodInvocation);
writeOffset(node.fileOffset);
writeByte(node.flags);
writeNode(node.receiver);
writeName(node.name);
writeNode(node.arguments);
@@ -1094,7 +1089,6 @@ class BinaryPrinter implements Visitor<void>, BinarySink {
void visitDirectMethodInvocation(DirectMethodInvocation node) {
writeByte(Tag.DirectMethodInvocation);
writeOffset(node.fileOffset);
writeByte(node.flags);
writeNode(node.receiver);
writeReference(node.targetReference);
writeNode(node.arguments);
+6 -12
View File
@@ -98,26 +98,22 @@ class CloneVisitor implements TreeVisitor {
visitPropertyGet(PropertyGet node) {
return new PropertyGet.byReference(
clone(node.receiver), node.name, node.interfaceTargetReference)
..flags = node.flags;
clone(node.receiver), node.name, node.interfaceTargetReference);
}
visitPropertySet(PropertySet node) {
return new PropertySet.byReference(clone(node.receiver), node.name,
clone(node.value), node.interfaceTargetReference)
..flags = node.flags;
clone(node.value), node.interfaceTargetReference);
}
visitDirectPropertyGet(DirectPropertyGet node) {
return new DirectPropertyGet.byReference(
clone(node.receiver), node.targetReference)
..flags = node.flags;
clone(node.receiver), node.targetReference);
}
visitDirectPropertySet(DirectPropertySet node) {
return new DirectPropertySet.byReference(
clone(node.receiver), node.targetReference, clone(node.value))
..flags = node.flags;
clone(node.receiver), node.targetReference, clone(node.value));
}
visitSuperPropertyGet(SuperPropertyGet node) {
@@ -140,14 +136,12 @@ class CloneVisitor implements TreeVisitor {
visitMethodInvocation(MethodInvocation node) {
return new MethodInvocation.byReference(clone(node.receiver), node.name,
clone(node.arguments), node.interfaceTargetReference)
..flags = node.flags;
clone(node.arguments), node.interfaceTargetReference);
}
visitDirectMethodInvocation(DirectMethodInvocation node) {
return new DirectMethodInvocation.byReference(
clone(node.receiver), node.targetReference, clone(node.arguments))
..flags = node.flags;
clone(node.receiver), node.targetReference, clone(node.arguments));
}
visitSuperMethodInvocation(SuperMethodInvocation node) {
@@ -168,7 +168,7 @@ class DynamicSelectorsCollector extends RecursiveVisitor<Null> {
super.visitMethodInvocation(node);
Selector selector;
if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
if (node.interfaceTarget == null) {
dynamicSelectors.add(new Selector.doInvoke(node.name));
} else {
if (node.receiver is! ThisExpression) {
@@ -182,13 +182,9 @@ class DynamicSelectorsCollector extends RecursiveVisitor<Null> {
super.visitDirectMethodInvocation(node);
Selector selector;
if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
dynamicSelectors.add(selector = new Selector.doInvoke(node.target.name));
} else {
if (node.receiver is! ThisExpression) {
nonThisSelectors
.add(selector ??= new Selector.doInvoke(node.target.name));
}
if (node.receiver is! ThisExpression) {
nonThisSelectors
.add(selector ??= new Selector.doInvoke(node.target.name));
}
}
@@ -197,7 +193,7 @@ class DynamicSelectorsCollector extends RecursiveVisitor<Null> {
super.visitPropertyGet(node);
Selector selector;
if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
if (node.interfaceTarget == null) {
dynamicSelectors.add(selector = new Selector.doGet(node.name));
} else {
if (node.receiver is! ThisExpression) {
@@ -215,17 +211,13 @@ class DynamicSelectorsCollector extends RecursiveVisitor<Null> {
visitDirectPropertyGet(DirectPropertyGet node) {
super.visitDirectPropertyGet(node);
if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
dynamicSelectors.add(new Selector.doGet(node.target.name));
} else {
if (node.receiver is! ThisExpression) {
nonThisSelectors.add(new Selector.doGet(node.target.name));
}
if (node.receiver is! ThisExpression) {
nonThisSelectors.add(new Selector.doGet(node.target.name));
}
final target = node.target;
if (target is Procedure && target.kind == ProcedureKind.Method) {
tearOffSelectors.add(new Selector.doInvoke(target.name));
}
final target = node.target;
if (target is Procedure && target.kind == ProcedureKind.Method) {
tearOffSelectors.add(new Selector.doInvoke(target.name));
}
}
@@ -234,7 +226,7 @@ class DynamicSelectorsCollector extends RecursiveVisitor<Null> {
super.visitPropertySet(node);
Selector selector;
if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
if (node.interfaceTarget == null) {
dynamicSelectors.add(selector = new Selector.doSet(node.name));
} else {
if (node.receiver is! ThisExpression) {
@@ -248,12 +240,8 @@ class DynamicSelectorsCollector extends RecursiveVisitor<Null> {
super.visitDirectPropertySet(node);
Selector selector;
if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
dynamicSelectors.add(selector = new Selector.doSet(node.target.name));
} else {
if (node.receiver is! ThisExpression) {
nonThisSelectors.add(selector ??= new Selector.doSet(node.target.name));
}
if (node.receiver is! ThisExpression) {
nonThisSelectors.add(selector ??= new Selector.doSet(node.target.name));
}
}
}
@@ -1361,7 +1361,6 @@ void StreamingScopeBuilder::VisitExpression() {
}
case kPropertyGet:
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipName(); // read name.
// read interface_target_reference.
@@ -1369,7 +1368,6 @@ void StreamingScopeBuilder::VisitExpression() {
return;
case kPropertySet:
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags
VisitExpression(); // read receiver.
builder_->SkipName(); // read name.
VisitExpression(); // read value.
@@ -1378,13 +1376,11 @@ void StreamingScopeBuilder::VisitExpression() {
return;
case kDirectPropertyGet:
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipCanonicalNameReference(); // read target_reference.
return;
case kDirectPropertySet:
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipCanonicalNameReference(); // read target_reference.
VisitExpression(); // read value·
@@ -1413,7 +1409,6 @@ void StreamingScopeBuilder::VisitExpression() {
return;
case kMethodInvocation:
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipName(); // read name.
VisitArguments(); // read arguments.
@@ -1422,7 +1417,6 @@ void StreamingScopeBuilder::VisitExpression() {
return;
case kDirectMethodInvocation:
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipCanonicalNameReference(); // read target_reference.
VisitArguments(); // read arguments.
@@ -3027,7 +3021,6 @@ void StreamingConstantEvaluator::EvaluateGetStringLength(
void StreamingConstantEvaluator::EvaluatePropertyGet() {
const TokenPosition position = builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
intptr_t expression_offset = builder_->ReaderOffset();
builder_->SkipExpression(); // read receiver.
StringIndex name = builder_->ReadNameAsStringIndex(); // read name.
@@ -3044,7 +3037,6 @@ void StreamingConstantEvaluator::EvaluatePropertyGet() {
void StreamingConstantEvaluator::EvaluateDirectPropertyGet() {
TokenPosition position = builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
intptr_t expression_offset = builder_->ReaderOffset();
builder_->SkipExpression(); // read receiver.
NameIndex kernel_name =
@@ -3125,7 +3117,6 @@ void StreamingConstantEvaluator::EvaluateStaticGet() {
void StreamingConstantEvaluator::EvaluateMethodInvocation() {
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
// This method call wasn't cached, so receiver et al. isn't cached either.
const Instance& receiver =
EvaluateExpression(builder_->ReaderOffset(), false); // read receiver.
@@ -3152,7 +3143,6 @@ void StreamingConstantEvaluator::EvaluateMethodInvocation() {
void StreamingConstantEvaluator::EvaluateDirectMethodInvocation() {
builder_->ReadPosition(); // read position.
builder_->ReadFlags(); // read flags.
const Instance& receiver =
EvaluateExpression(builder_->ReaderOffset(), false); // read receiver.
@@ -5665,14 +5655,12 @@ void StreamingFlowGraphBuilder::SkipExpression() {
return;
case kPropertyGet:
ReadPosition(); // read position.
SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipName(); // read name.
SkipCanonicalNameReference(); // read interface_target_reference.
return;
case kPropertySet:
ReadPosition(); // read position.
SkipFlags(); // read flags
SkipExpression(); // read receiver.
SkipName(); // read name.
SkipExpression(); // read value.
@@ -5691,13 +5679,11 @@ void StreamingFlowGraphBuilder::SkipExpression() {
return;
case kDirectPropertyGet:
ReadPosition(); // read position.
SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipCanonicalNameReference(); // read target_reference.
return;
case kDirectPropertySet:
ReadPosition(); // read position.
SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipCanonicalNameReference(); // read target_reference.
SkipExpression(); // read value·
@@ -5713,7 +5699,6 @@ void StreamingFlowGraphBuilder::SkipExpression() {
return;
case kMethodInvocation:
ReadPosition(); // read position.
SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipName(); // read name.
SkipArguments(); // read arguments.
@@ -5727,7 +5712,6 @@ void StreamingFlowGraphBuilder::SkipExpression() {
return;
case kDirectMethodInvocation:
ReadPosition(); // read position.
SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipCanonicalNameReference(); // read target_reference.
SkipArguments(); // read arguments.
@@ -6762,8 +6746,6 @@ Fragment StreamingFlowGraphBuilder::BuildPropertyGet(TokenPosition* p) {
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
ReadFlags(); // read flags
Fragment instructions = BuildExpression(); // read receiver.
LocalVariable* receiver = NULL;
@@ -6823,8 +6805,6 @@ Fragment StreamingFlowGraphBuilder::BuildPropertySet(TokenPosition* p) {
const TokenPosition position = ReadPosition(); // read position.
if (p != NULL) *p = position;
ReadFlags(); // skip flags
instructions += BuildExpression(); // read receiver.
LocalVariable* receiver = NULL;
@@ -7098,8 +7078,6 @@ Fragment StreamingFlowGraphBuilder::BuildDirectPropertyGet(TokenPosition* p) {
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
ReadFlags(); // read flags.
const Tag receiver_tag = PeekTag(); // peek tag for receiver.
Fragment instructions = BuildExpression(); // read receiver.
const NameIndex kernel_name =
@@ -7149,8 +7127,6 @@ Fragment StreamingFlowGraphBuilder::BuildDirectPropertySet(TokenPosition* p) {
const TokenPosition position = ReadPosition(); // read position.
if (p != NULL) *p = position;
ReadFlags(); // skip flags.
Fragment instructions(NullConstant());
LocalVariable* value = MakeTemporary();
@@ -7282,8 +7258,6 @@ Fragment StreamingFlowGraphBuilder::BuildMethodInvocation(TokenPosition* p) {
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
ReadFlags(); // skip flags.
const Tag receiver_tag = PeekTag(); // peek tag for receiver.
if (IsNumberLiteral(receiver_tag) &&
(!optimizing() || constant_evaluator_.IsCached(offset))) {
@@ -7458,8 +7432,6 @@ Fragment StreamingFlowGraphBuilder::BuildDirectMethodInvocation(
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
ReadFlags(); // skip flags.
Tag receiver_tag = PeekTag(); // peek tag for receiver.
Fragment instructions;
@@ -1093,8 +1093,6 @@ class StreamingFlowGraphBuilder {
void ReadUntilFunctionNode(ParsedFunction* set_forwarding_stub = NULL);
intptr_t ReadListLength();
enum DispatchCategory { Interface, ViaThis, Closure, DynamicDispatch };
void ReportUnexpectedTag(const char* variant, Tag tag);
private: