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( | |
4159 node, MessageKind.GENERIC, | |
4160 {'text': | |
4161 'JS code must not use `#` inside functions'}); | |
Siggi Cherem (dart-lang)
2015/11/12 21:21:29
maybe include your suggestion as well?
sra1
2015/11/12 22:23:26
I tried. Providing examples is confusing because t
| |
4162 } | |
4163 | |
4157 TypeMask ssaType = | 4164 TypeMask ssaType = |
4158 TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler); | 4165 TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler); |
4159 | 4166 |
4160 SourceInformation sourceInformation = | 4167 SourceInformation sourceInformation = |
4161 sourceInformationBuilder.buildCall(node, node.argumentsNode); | 4168 sourceInformationBuilder.buildCall(node, node.argumentsNode); |
4162 if (nativeBehavior.codeTemplate.isExpression) { | 4169 if (nativeBehavior.codeTemplate.isExpression) { |
4163 push(new HForeignCode( | 4170 push(new HForeignCode( |
4164 nativeBehavior.codeTemplate, ssaType, inputs, | 4171 nativeBehavior.codeTemplate, ssaType, inputs, |
4165 effects: nativeBehavior.sideEffects, | 4172 effects: nativeBehavior.sideEffects, |
4166 nativeBehavior: nativeBehavior) | 4173 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'; | 9164 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
9158 unaliased.accept(this, builder); | 9165 unaliased.accept(this, builder); |
9159 } | 9166 } |
9160 | 9167 |
9161 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9168 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
9162 JavaScriptBackend backend = builder.compiler.backend; | 9169 JavaScriptBackend backend = builder.compiler.backend; |
9163 ClassElement cls = backend.helpers.DynamicRuntimeType; | 9170 ClassElement cls = backend.helpers.DynamicRuntimeType; |
9164 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9171 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
9165 } | 9172 } |
9166 } | 9173 } |
OLD | NEW |