| 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 '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 8 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| 9 import '../common/names.dart'; | 9 import '../common/names.dart'; |
| 10 import '../common/tasks.dart' show CompilerTask; | 10 import '../common/tasks.dart' show CompilerTask; |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 localsHandler.updateLocal(parameter, argument); | 301 localsHandler.updateLocal(parameter, argument); |
| 302 }); | 302 }); |
| 303 | 303 |
| 304 // TODO(het): set the locals handler state as if we were inlining the | 304 // TODO(het): set the locals handler state as if we were inlining the |
| 305 // constructor. | 305 // constructor. |
| 306 _buildInitializers(constructor, fieldValues); | 306 _buildInitializers(constructor, fieldValues); |
| 307 } | 307 } |
| 308 | 308 |
| 309 HTypeConversion buildFunctionTypeConversion( | 309 HTypeConversion buildFunctionTypeConversion( |
| 310 HInstruction original, DartType type, int kind) { | 310 HInstruction original, DartType type, int kind) { |
| 311 String name = | 311 HInstruction reifiedType = buildFunctionType(type); |
| 312 kind == HTypeConversion.CAST_TYPE_CHECK ? '_asCheck' : '_assertCheck'; | 312 return new HTypeConversion.viaMethodOnType( |
| 313 | 313 type, kind, original.instructionType, reifiedType, original); |
| 314 List<HInstruction> arguments = <HInstruction>[ | |
| 315 buildFunctionType(type), | |
| 316 original | |
| 317 ]; | |
| 318 _pushDynamicInvocation(null, null, arguments, | |
| 319 selector: new Selector.call( | |
| 320 new Name(name, astAdapter.jsHelperLibrary), CallStructure.ONE_ARG)); | |
| 321 | |
| 322 return new HTypeConversion(type, kind, original.instructionType, pop()); | |
| 323 } | 314 } |
| 324 | 315 |
| 325 /// Builds a SSA graph for [procedure]. | 316 /// Builds a SSA graph for [procedure]. |
| 326 void buildProcedure(ir.Procedure procedure) { | 317 void buildProcedure(ir.Procedure procedure) { |
| 327 openFunction(); | 318 openFunction(); |
| 328 procedure.function.body.accept(this); | 319 procedure.function.body.accept(this); |
| 329 closeFunction(); | 320 closeFunction(); |
| 330 } | 321 } |
| 331 | 322 |
| 332 void openFunction() { | 323 void openFunction() { |
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 push(new HNot(popBoolified(), backend.boolType)); | 1016 push(new HNot(popBoolified(), backend.boolType)); |
| 1026 } | 1017 } |
| 1027 | 1018 |
| 1028 @override | 1019 @override |
| 1029 void visitStringConcatenation(ir.StringConcatenation stringConcat) { | 1020 void visitStringConcatenation(ir.StringConcatenation stringConcat) { |
| 1030 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); | 1021 KernelStringBuilder stringBuilder = new KernelStringBuilder(this); |
| 1031 stringConcat.accept(stringBuilder); | 1022 stringConcat.accept(stringBuilder); |
| 1032 stack.add(stringBuilder.result); | 1023 stack.add(stringBuilder.result); |
| 1033 } | 1024 } |
| 1034 } | 1025 } |
| OLD | NEW |