| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 class SsaFunctionCompiler implements FunctionCompiler { | 7 class SsaFunctionCompiler implements FunctionCompiler { |
| 8 final SsaCodeGeneratorTask generator; | 8 final SsaCodeGeneratorTask generator; |
| 9 final SsaBuilderTask builder; | 9 final SsaBuilderTask builder; |
| 10 final SsaOptimizerTask optimizer; | 10 final SsaOptimizerTask optimizer; |
| (...skipping 4136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4147 if (nativeBehavior.codeTemplate.positionalArgumentCount != inputs.length) { | 4147 if (nativeBehavior.codeTemplate.positionalArgumentCount != inputs.length) { |
| 4148 reporter.reportErrorMessage( | 4148 reporter.reportErrorMessage( |
| 4149 node, MessageKind.GENERIC, | 4149 node, MessageKind.GENERIC, |
| 4150 {'text': | 4150 {'text': |
| 4151 'Mismatch between number of placeholders' | 4151 'Mismatch between number of placeholders' |
| 4152 ' and number of arguments.'}); | 4152 ' and number of arguments.'}); |
| 4153 stack.add(graph.addConstantNull(compiler)); // Result expected on stack. | 4153 stack.add(graph.addConstantNull(compiler)); // Result expected on stack. |
| 4154 return; | 4154 return; |
| 4155 } | 4155 } |
| 4156 | 4156 |
| 4157 if (native.HasCapturedPlaceholders.check(nativeBehavior.codeTemplate.ast)) { |
| 4158 reporter.reportErrorMessage(node, MessageKind.JS_PLACEHOLDER_CAPTURE); |
| 4159 } |
| 4160 |
| 4157 TypeMask ssaType = | 4161 TypeMask ssaType = |
| 4158 TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler); | 4162 TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler); |
| 4159 | 4163 |
| 4160 SourceInformation sourceInformation = | 4164 SourceInformation sourceInformation = |
| 4161 sourceInformationBuilder.buildCall(node, node.argumentsNode); | 4165 sourceInformationBuilder.buildCall(node, node.argumentsNode); |
| 4162 if (nativeBehavior.codeTemplate.isExpression) { | 4166 if (nativeBehavior.codeTemplate.isExpression) { |
| 4163 push(new HForeignCode( | 4167 push(new HForeignCode( |
| 4164 nativeBehavior.codeTemplate, ssaType, inputs, | 4168 nativeBehavior.codeTemplate, ssaType, inputs, |
| 4165 effects: nativeBehavior.sideEffects, | 4169 effects: nativeBehavior.sideEffects, |
| 4166 nativeBehavior: nativeBehavior) | 4170 nativeBehavior: nativeBehavior) |
| (...skipping 4990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9157 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 9161 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 9158 unaliased.accept(this, builder); | 9162 unaliased.accept(this, builder); |
| 9159 } | 9163 } |
| 9160 | 9164 |
| 9161 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9165 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 9162 JavaScriptBackend backend = builder.compiler.backend; | 9166 JavaScriptBackend backend = builder.compiler.backend; |
| 9163 ClassElement cls = backend.helpers.DynamicRuntimeType; | 9167 ClassElement cls = backend.helpers.DynamicRuntimeType; |
| 9164 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9168 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 9165 } | 9169 } |
| 9166 } | 9170 } |
| OLD | NEW |