| OLD | NEW |
| 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 library dart2js.ir_builder; | 5 library dart2js.ir_builder; |
| 6 | 6 |
| 7 import '../constants/constant_system.dart'; | 7 import '../constants/constant_system.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../constants/values.dart' show PrimitiveConstantValue; | 9 import '../constants/values.dart' show PrimitiveConstantValue; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 1958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 ir.Primitive buildTypeOperator(ir.Primitive receiver, | 1969 ir.Primitive buildTypeOperator(ir.Primitive receiver, |
| 1970 DartType type, | 1970 DartType type, |
| 1971 {bool isTypeTest: false, | 1971 {bool isTypeTest: false, |
| 1972 bool isNotCheck: false}) { | 1972 bool isNotCheck: false}) { |
| 1973 assert(isOpen); | 1973 assert(isOpen); |
| 1974 assert(isTypeTest != null); | 1974 assert(isTypeTest != null); |
| 1975 assert(!isNotCheck || isTypeTest); | 1975 assert(!isNotCheck || isTypeTest); |
| 1976 ir.Primitive check = _continueWithExpression( | 1976 ir.Primitive check = _continueWithExpression( |
| 1977 (k) => new ir.TypeOperator(receiver, type, k, isTypeTest: isTypeTest)); | 1977 (k) => new ir.TypeOperator(receiver, type, k, isTypeTest: isTypeTest)); |
| 1978 return isNotCheck ? buildNegation(check) : check; | 1978 return isNotCheck ? buildNegation(check) : check; |
| 1979 | |
| 1980 } | 1979 } |
| 1981 | 1980 |
| 1982 /// Create a lazy and/or expression. [leftValue] is the value of the left | 1981 /// Create a lazy and/or expression. [leftValue] is the value of the left |
| 1983 /// operand and [buildRightValue] is called to process the value of the right | 1982 /// operand and [buildRightValue] is called to process the value of the right |
| 1984 /// operand in the context of its own [IrBuilder]. | 1983 /// operand in the context of its own [IrBuilder]. |
| 1985 ir.Primitive buildLogicalOperator( | 1984 ir.Primitive buildLogicalOperator( |
| 1986 ir.Primitive leftValue, | 1985 ir.Primitive leftValue, |
| 1987 ir.Primitive buildRightValue(IrBuilder builder), | 1986 ir.Primitive buildRightValue(IrBuilder builder), |
| 1988 {bool isLazyOr: false}) { | 1987 {bool isLazyOr: false}) { |
| 1989 // e0 && e1 is translated as if e0 ? (e1 == true) : false. | 1988 // e0 && e1 is translated as if e0 ? (e1 == true) : false. |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2661 } | 2660 } |
| 2662 | 2661 |
| 2663 /// Synthetic parameter to a JavaScript factory method that takes the type | 2662 /// Synthetic parameter to a JavaScript factory method that takes the type |
| 2664 /// argument given for the type variable [variable]. | 2663 /// argument given for the type variable [variable]. |
| 2665 class TypeInformationParameter implements Local { | 2664 class TypeInformationParameter implements Local { |
| 2666 final TypeVariableElement variable; | 2665 final TypeVariableElement variable; |
| 2667 final ExecutableElement executableContext; | 2666 final ExecutableElement executableContext; |
| 2668 TypeInformationParameter(this.variable, this.executableContext); | 2667 TypeInformationParameter(this.variable, this.executableContext); |
| 2669 String get name => variable.name; | 2668 String get name => variable.name; |
| 2670 } | 2669 } |
| OLD | NEW |