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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart

Issue 1160763002: dart2js cps: 'is'-check directly against type variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase + status Created 5 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // IrNodes are kept in a separate library to have precise control over their 5 // IrNodes are kept in a separate library to have precise control over their
6 // dependencies on other parts of the system. 6 // dependencies on other parts of the system.
7 library dart2js.ir_nodes; 7 library dart2js.ir_nodes;
8 8
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../constants/values.dart' as values show ConstantValue; 10 import '../constants/values.dart' as values show ConstantValue;
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 accept(Visitor visitor) => visitor.visitInvokeConstructor(this); 397 accept(Visitor visitor) => visitor.visitInvokeConstructor(this);
398 } 398 }
399 399
400 /// "as" casts and "is" checks. 400 /// "as" casts and "is" checks.
401 // We might want to turn "is"-checks into a [Primitive] as it can never diverge. 401 // We might want to turn "is"-checks into a [Primitive] as it can never diverge.
402 // But then we need to special-case for is-checks with an erroneous .type as 402 // But then we need to special-case for is-checks with an erroneous .type as
403 // these will throw. 403 // these will throw.
404 class TypeOperator extends Expression { 404 class TypeOperator extends Expression {
405 Reference<Primitive> value; 405 Reference<Primitive> value;
406 final DartType type; 406 final DartType type;
407 /// Type arguments to [type]. Since [type] may reference type variables in the 407
408 /// enclosing class, these are not constant. 408 /// If [type] is a [GenericType], this holds the internal representation of
409 /// the type arguments to [type]. Since these may reference type variables
410 /// from the enclosing class, they are not constant.
411 ///
412 /// If [type] is a [TypeVariableType], this is a singleton list with
413 /// the internal representation of the type held in that type variable.
414 ///
415 /// Otherwise the list is empty.
409 final List<Reference<Primitive>> typeArguments; 416 final List<Reference<Primitive>> typeArguments;
410 final Reference<Continuation> continuation; 417 final Reference<Continuation> continuation;
411 // TODO(johnniwinther): Use `Operator` class to encapsule the operator type. 418 // TODO(johnniwinther): Use `Operator` class to encapsule the operator type.
412 final bool isTypeTest; 419 final bool isTypeTest;
413 420
414 TypeOperator(Primitive value, 421 TypeOperator(Primitive value,
415 this.type, 422 this.type,
416 List<Primitive> typeArguments, 423 List<Primitive> typeArguments,
417 Continuation cont, 424 Continuation cont,
418 {bool this.isTypeTest}) 425 {bool this.isTypeTest})
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 processNonTailThrow(node); 1421 processNonTailThrow(node);
1415 processReference(node.value); 1422 processReference(node.value);
1416 } 1423 }
1417 1424
1418 processCreateInvocationMirror(CreateInvocationMirror node) {} 1425 processCreateInvocationMirror(CreateInvocationMirror node) {}
1419 visitCreateInvocationMirror(CreateInvocationMirror node) { 1426 visitCreateInvocationMirror(CreateInvocationMirror node) {
1420 processCreateInvocationMirror(node); 1427 processCreateInvocationMirror(node);
1421 node.arguments.forEach(processReference); 1428 node.arguments.forEach(processReference);
1422 } 1429 }
1423 } 1430 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698