| 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 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 assert(superClass != null); | 1954 assert(superClass != null); |
| 1955 assert(superClass.resolutionState == STATE_DONE); | 1955 assert(superClass.resolutionState == STATE_DONE); |
| 1956 // TODO(johnniwinther): Should we find injected constructors as well? | 1956 // TODO(johnniwinther): Should we find injected constructors as well? |
| 1957 FunctionElement target = superClass.lookupDefaultConstructor(); | 1957 FunctionElement target = superClass.lookupDefaultConstructor(); |
| 1958 if (target == null) { | 1958 if (target == null) { |
| 1959 compiler.internalError(superClass, | 1959 compiler.internalError(superClass, |
| 1960 "No default constructor available."); | 1960 "No default constructor available."); |
| 1961 } | 1961 } |
| 1962 Selector selector = new Selector.callDefaultConstructor(); | 1962 Selector selector = new Selector.callDefaultConstructor(); |
| 1963 List<HInstruction> arguments = | 1963 List<HInstruction> arguments = |
| 1964 selector.makeArgumentsList(const Link<ast.Node>(), | 1964 selector.makeArgumentsList2(const Link<ast.Node>(), |
| 1965 target.implementation, | 1965 target.implementation, |
| 1966 null, | 1966 null, |
| 1967 handleConstantForOptionalParameter); | 1967 handleConstantForOptionalParameter); |
| 1968 inlineSuperOrRedirect(target, | 1968 inlineSuperOrRedirect(target, |
| 1969 arguments, | 1969 arguments, |
| 1970 constructors, | 1970 constructors, |
| 1971 fieldValues, | 1971 fieldValues, |
| 1972 constructor); | 1972 constructor); |
| 1973 } | 1973 } |
| 1974 } | 1974 } |
| 1975 } | 1975 } |
| 1976 | 1976 |
| 1977 /** | 1977 /** |
| (...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3550 List<HInstruction> makeStaticArgumentList(Selector selector, | 3550 List<HInstruction> makeStaticArgumentList(Selector selector, |
| 3551 Link<ast.Node> arguments, | 3551 Link<ast.Node> arguments, |
| 3552 FunctionElement element) { | 3552 FunctionElement element) { |
| 3553 assert(invariant(element, element.isImplementation)); | 3553 assert(invariant(element, element.isImplementation)); |
| 3554 | 3554 |
| 3555 HInstruction compileArgument(ast.Node argument) { | 3555 HInstruction compileArgument(ast.Node argument) { |
| 3556 visit(argument); | 3556 visit(argument); |
| 3557 return pop(); | 3557 return pop(); |
| 3558 } | 3558 } |
| 3559 | 3559 |
| 3560 return selector.makeArgumentsList(arguments, | 3560 return selector.makeArgumentsList2(arguments, |
| 3561 element, | 3561 element, |
| 3562 compileArgument, | 3562 compileArgument, |
| 3563 handleConstantForOptionalParameter); | 3563 handleConstantForOptionalParameter); |
| 3564 } | 3564 } |
| 3565 | 3565 |
| 3566 void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> lis
t) { | 3566 void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> lis
t) { |
| 3567 for (; !link.isEmpty; link = link.tail) { | 3567 for (; !link.isEmpty; link = link.tail) { |
| 3568 visit(link.head); | 3568 visit(link.head); |
| 3569 list.add(pop()); | 3569 list.add(pop()); |
| 3570 } | 3570 } |
| 3571 } | 3571 } |
| 3572 | 3572 |
| 3573 visitDynamicSend(ast.Send node) { | 3573 visitDynamicSend(ast.Send node) { |
| (...skipping 3298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6872 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 6872 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 6873 unaliased.accept(this, builder); | 6873 unaliased.accept(this, builder); |
| 6874 } | 6874 } |
| 6875 | 6875 |
| 6876 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 6876 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 6877 JavaScriptBackend backend = builder.compiler.backend; | 6877 JavaScriptBackend backend = builder.compiler.backend; |
| 6878 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 6878 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 6879 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 6879 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 6880 } | 6880 } |
| 6881 } | 6881 } |
| OLD | NEW |