| 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 SsaCodeGeneratorTask generator; | 8 SsaCodeGeneratorTask generator; |
| 9 SsaBuilderTask builder; | 9 SsaBuilderTask builder; |
| 10 SsaOptimizerTask optimizer; | 10 SsaOptimizerTask optimizer; |
| (...skipping 3280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3291 /// Generate read access of an unresolved static or top level entity. | 3291 /// Generate read access of an unresolved static or top level entity. |
| 3292 void generateStaticUnresolvedGet(ast.Send node, Element element) { | 3292 void generateStaticUnresolvedGet(ast.Send node, Element element) { |
| 3293 if (element is ErroneousElement) { | 3293 if (element is ErroneousElement) { |
| 3294 // An erroneous element indicates an unresolved static getter. | 3294 // An erroneous element indicates an unresolved static getter. |
| 3295 generateThrowNoSuchMethod( | 3295 generateThrowNoSuchMethod( |
| 3296 node, | 3296 node, |
| 3297 noSuchMethodTargetSymbolString(element, 'get'), | 3297 noSuchMethodTargetSymbolString(element, 'get'), |
| 3298 argumentNodes: const Link<ast.Node>()); | 3298 argumentNodes: const Link<ast.Node>()); |
| 3299 } else { | 3299 } else { |
| 3300 // This happens when [element] has parse errors. | 3300 // This happens when [element] has parse errors. |
| 3301 assert(invariant(node, element.isErroneous)); | 3301 assert(invariant(node, element == null || element.isErroneous)); |
| 3302 // TODO(ahe): Do something like the above, that is, emit a runtime | 3302 // TODO(ahe): Do something like the above, that is, emit a runtime |
| 3303 // error. | 3303 // error. |
| 3304 stack.add(graph.addConstantNull(compiler)); | 3304 stack.add(graph.addConstantNull(compiler)); |
| 3305 } | 3305 } |
| 3306 } | 3306 } |
| 3307 | 3307 |
| 3308 /// Read a static or top level [field] of constant value. | 3308 /// Read a static or top level [field] of constant value. |
| 3309 void generateStaticConstGet( | 3309 void generateStaticConstGet( |
| 3310 ast.Send node, | 3310 ast.Send node, |
| 3311 FieldElement field, | 3311 FieldElement field, |
| (...skipping 4532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7844 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 7844 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 7845 unaliased.accept(this, builder); | 7845 unaliased.accept(this, builder); |
| 7846 } | 7846 } |
| 7847 | 7847 |
| 7848 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 7848 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 7849 JavaScriptBackend backend = builder.compiler.backend; | 7849 JavaScriptBackend backend = builder.compiler.backend; |
| 7850 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 7850 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 7851 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 7851 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 7852 } | 7852 } |
| 7853 } | 7853 } |
| OLD | NEW |