| 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 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 if (!foundSuperOrRedirect) { | 1903 if (!foundSuperOrRedirect) { |
| 1904 // No super initializer found. Try to find the default constructor if | 1904 // No super initializer found. Try to find the default constructor if |
| 1905 // the class is not Object. | 1905 // the class is not Object. |
| 1906 ClassElement enclosingClass = constructor.enclosingClass; | 1906 ClassElement enclosingClass = constructor.enclosingClass; |
| 1907 ClassElement superClass = enclosingClass.superclass; | 1907 ClassElement superClass = enclosingClass.superclass; |
| 1908 if (!enclosingClass.isObject) { | 1908 if (!enclosingClass.isObject) { |
| 1909 assert(superClass != null); | 1909 assert(superClass != null); |
| 1910 assert(superClass.resolutionState == STATE_DONE); | 1910 assert(superClass.resolutionState == STATE_DONE); |
| 1911 Selector selector = |
| 1912 new Selector.callDefaultConstructor(enclosingClass.library); |
| 1911 // TODO(johnniwinther): Should we find injected constructors as well? | 1913 // TODO(johnniwinther): Should we find injected constructors as well? |
| 1912 FunctionElement target = superClass.lookupDefaultConstructor(); | 1914 FunctionElement target = superClass.lookupConstructor(selector); |
| 1913 if (target == null) { | 1915 if (target == null) { |
| 1914 compiler.internalError(superClass, | 1916 compiler.internalError(superClass, |
| 1915 "No default constructor available."); | 1917 "No default constructor available."); |
| 1916 } | 1918 } |
| 1917 Selector selector = | |
| 1918 new Selector.callDefaultConstructor(enclosingClass.library); | |
| 1919 List<HInstruction> arguments = | 1919 List<HInstruction> arguments = |
| 1920 selector.makeArgumentsList2(const Link<ast.Node>(), | 1920 selector.makeArgumentsList2(const Link<ast.Node>(), |
| 1921 target.implementation, | 1921 target.implementation, |
| 1922 null, | 1922 null, |
| 1923 handleConstantForOptionalParameter); | 1923 handleConstantForOptionalParameter); |
| 1924 inlineSuperOrRedirect(target, | 1924 inlineSuperOrRedirect(target, |
| 1925 arguments, | 1925 arguments, |
| 1926 constructors, | 1926 constructors, |
| 1927 fieldValues, | 1927 fieldValues, |
| 1928 constructor); | 1928 constructor); |
| (...skipping 4742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6671 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 6671 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 6672 unaliased.accept(this, builder); | 6672 unaliased.accept(this, builder); |
| 6673 } | 6673 } |
| 6674 | 6674 |
| 6675 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 6675 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 6676 JavaScriptBackend backend = builder.compiler.backend; | 6676 JavaScriptBackend backend = builder.compiler.backend; |
| 6677 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 6677 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 6678 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 6678 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 6679 } | 6679 } |
| 6680 } | 6680 } |
| OLD | NEW |