| 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; |
| 11 FunctionElement element = builder.work.element; | 11 FunctionElement element = builder.target; |
| 12 NativeEmitter nativeEmitter = builder.nativeEmitter; | 12 NativeEmitter nativeEmitter = builder.nativeEmitter; |
| 13 JavaScriptBackend backend = builder.backend; | 13 JavaScriptBackend backend = builder.backend; |
| 14 DiagnosticReporter reporter = compiler.reporter; | 14 DiagnosticReporter reporter = compiler.reporter; |
| 15 | 15 |
| 16 HInstruction convertDartClosure(ParameterElement parameter, | 16 HInstruction convertDartClosure(ParameterElement parameter, |
| 17 FunctionType type) { | 17 FunctionType type) { |
| 18 HInstruction local = builder.localsHandler.readLocal(parameter); | 18 HInstruction local = builder.localsHandler.readLocal(parameter); |
| 19 ConstantValue arityConstant = | 19 ConstantValue arityConstant = |
| 20 builder.constantSystem.createInt(type.computeArity()); | 20 builder.constantSystem.createInt(type.computeArity()); |
| 21 HInstruction arity = builder.graph.addConstant(arityConstant, compiler); | 21 HInstruction arity = builder.graph.addConstant(arityConstant, compiler); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 LiteralString jsCode = nativeBody.asLiteralString(); | 106 LiteralString jsCode = nativeBody.asLiteralString(); |
| 107 builder.push(new HForeignCode.statement( | 107 builder.push(new HForeignCode.statement( |
| 108 js.js.statementTemplateYielding( | 108 js.js.statementTemplateYielding( |
| 109 new js.LiteralStatement(jsCode.dartString.slowToString())), | 109 new js.LiteralStatement(jsCode.dartString.slowToString())), |
| 110 <HInstruction>[], | 110 <HInstruction>[], |
| 111 new SideEffects(), | 111 new SideEffects(), |
| 112 null, | 112 null, |
| 113 backend.dynamicType)); | 113 backend.dynamicType)); |
| 114 } | 114 } |
| 115 } | 115 } |
| OLD | NEW |