Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart |
| index 98b2725e87deabf4d55cc8606608f89a519cd5f7..05f5177346f772e3b112d950c63a325672877ea6 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/ssa/optimize.dart |
| @@ -606,7 +606,9 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase { |
| HInstruction visitTypeConversion(HTypeConversion node) { |
| HInstruction value = node.inputs[0]; |
| DartType type = node.typeExpression; |
| - if (type != null && !type.isRaw) return node; |
| + if (type != null && (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE)) { |
|
ngeoffray
2013/05/13 09:10:59
type.containsTypeVariable?
karlklose
2013/05/14 13:49:41
No, this also checks for literal type arguments.
ngeoffray
2013/05/15 08:45:32
I don't understand. Why isn't (!type.isRaw || type
|
| + return node; |
| + } |
| HType convertedType = node.instructionType; |
| if (convertedType.isUnknown()) return node; |
| HType combinedType = value.instructionType.intersection( |
| @@ -723,9 +725,15 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase { |
| // interceptor. |
| HInstruction value = node.inputs.last; |
| if (compiler.enableTypeAssertions) { |
| + DartType type = field.computeType(compiler); |
| + if (!type.isRaw || type.kind == TypeKind.TYPE_VARIABLE) { |
|
ngeoffray
2013/05/13 09:10:59
type.containsTypeVariable?
karlklose
2013/05/14 13:49:41
Ditto.
|
| + // We cannot generate the correct type representation here, so don't |
| + // inline this access. |
| + return node; |
| + } |
| HInstruction other = value.convertType( |
| compiler, |
| - field.computeType(compiler), |
| + type, |
| HTypeConversion.CHECKED_MODE_CHECK); |
| if (other != value) { |
| node.block.addBefore(node, other); |