| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 part of native; | 5 part of native; |
| 6 | 6 |
| 7 final RegExp nativeRedirectionRegExp = new RegExp(r'^[a-zA-Z][a-zA-Z_$0-9]*$'); | 7 final RegExp nativeRedirectionRegExp = new RegExp(r'^[a-zA-Z][a-zA-Z_$0-9]*$'); |
| 8 | 8 |
| 9 void handleSsaNative(SsaBuilder builder, Expression nativeBody) { | 9 void handleSsaNative(SsaBuilder builder, Expression nativeBody) { |
| 10 Compiler compiler = builder.compiler; | 10 Compiler compiler = builder.compiler; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 FunctionSignature parameters = element.functionSignature; | 53 FunctionSignature parameters = element.functionSignature; |
| 54 if (!hasBody) { | 54 if (!hasBody) { |
| 55 List<String> arguments = <String>[]; | 55 List<String> arguments = <String>[]; |
| 56 List<HInstruction> inputs = <HInstruction>[]; | 56 List<HInstruction> inputs = <HInstruction>[]; |
| 57 String receiver = ''; | 57 String receiver = ''; |
| 58 if (element.isInstanceMember) { | 58 if (element.isInstanceMember) { |
| 59 receiver = '#.'; | 59 receiver = '#.'; |
| 60 inputs.add(builder.localsHandler.readThis()); | 60 inputs.add(builder.localsHandler.readThis()); |
| 61 } | 61 } |
| 62 parameters.forEachParameter((ParameterElement parameter) { | 62 parameters.forEachParameter((ParameterElement parameter) { |
| 63 DartType type = parameter.type.unalias(compiler); | 63 DartType type = parameter.type.unalias(compiler.resolution); |
| 64 HInstruction input = builder.localsHandler.readLocal(parameter); | 64 HInstruction input = builder.localsHandler.readLocal(parameter); |
| 65 if (type is FunctionType) { | 65 if (type is FunctionType) { |
| 66 // The parameter type is a function type either directly or through | 66 // The parameter type is a function type either directly or through |
| 67 // typedef(s). | 67 // typedef(s). |
| 68 input = convertDartClosure(parameter, type); | 68 input = convertDartClosure(parameter, type); |
| 69 } | 69 } |
| 70 inputs.add(input); | 70 inputs.add(input); |
| 71 arguments.add('#'); | 71 arguments.add('#'); |
| 72 }); | 72 }); |
| 73 | 73 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 LiteralString jsCode = nativeBody.asLiteralString(); | 105 LiteralString jsCode = nativeBody.asLiteralString(); |
| 106 builder.push(new HForeignCode.statement( | 106 builder.push(new HForeignCode.statement( |
| 107 js.js.statementTemplateYielding( | 107 js.js.statementTemplateYielding( |
| 108 new js.LiteralStatement(jsCode.dartString.slowToString())), | 108 new js.LiteralStatement(jsCode.dartString.slowToString())), |
| 109 <HInstruction>[], | 109 <HInstruction>[], |
| 110 new SideEffects(), | 110 new SideEffects(), |
| 111 null, | 111 null, |
| 112 backend.dynamicType)); | 112 backend.dynamicType)); |
| 113 } | 113 } |
| 114 } | 114 } |
| OLD | NEW |