OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../common.dart'; | 8 import '../common.dart'; |
9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 closeFunction(); | 221 closeFunction(); |
222 } | 222 } |
223 | 223 |
224 /// Pops the most recent instruction from the stack and 'boolifies' it. | 224 /// Pops the most recent instruction from the stack and 'boolifies' it. |
225 /// | 225 /// |
226 /// Boolification is checking if the value is '=== true'. | 226 /// Boolification is checking if the value is '=== true'. |
227 @override | 227 @override |
228 HInstruction popBoolified() { | 228 HInstruction popBoolified() { |
229 HInstruction value = pop(); | 229 HInstruction value = pop(); |
230 if (typeBuilder.checkOrTrustTypes) { | 230 if (typeBuilder.checkOrTrustTypes) { |
231 return typeBuilder.potentiallyCheckOrTrustType( | 231 ResolutionInterfaceType type = compiler.commonElements.boolType; |
232 value, compiler.commonElements.boolType, | 232 return typeBuilder.potentiallyCheckOrTrustType(value, type, |
233 kind: HTypeConversion.BOOLEAN_CONVERSION_CHECK); | 233 kind: HTypeConversion.BOOLEAN_CONVERSION_CHECK); |
234 } | 234 } |
235 HInstruction result = new HBoolify(value, commonMasks.boolType); | 235 HInstruction result = new HBoolify(value, commonMasks.boolType); |
236 add(result); | 236 add(result); |
237 return result; | 237 return result; |
238 } | 238 } |
239 | 239 |
240 void _addClassTypeVariablesIfNeeded(ir.Member constructor) { | 240 void _addClassTypeVariablesIfNeeded(ir.Member constructor) { |
241 var enclosing = constructor.enclosingClass; | 241 var enclosing = constructor.enclosingClass; |
242 if (backend.classNeedsRti(astAdapter.getElement(enclosing))) { | 242 if (backend.classNeedsRti(astAdapter.getElement(enclosing))) { |
(...skipping 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3090 enterBlock.setBlockFlow( | 3090 enterBlock.setBlockFlow( |
3091 new HTryBlockInformation( | 3091 new HTryBlockInformation( |
3092 kernelBuilder.wrapStatementGraph(bodyGraph), | 3092 kernelBuilder.wrapStatementGraph(bodyGraph), |
3093 exception, | 3093 exception, |
3094 kernelBuilder.wrapStatementGraph(catchGraph), | 3094 kernelBuilder.wrapStatementGraph(catchGraph), |
3095 kernelBuilder.wrapStatementGraph(finallyGraph)), | 3095 kernelBuilder.wrapStatementGraph(finallyGraph)), |
3096 exitBlock); | 3096 exitBlock); |
3097 kernelBuilder.inTryStatement = previouslyInTryStatement; | 3097 kernelBuilder.inTryStatement = previouslyInTryStatement; |
3098 } | 3098 } |
3099 } | 3099 } |
OLD | NEW |