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 3408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3419 generateInstanceGetterWithCompiledReceiver( | 3419 generateInstanceGetterWithCompiledReceiver( |
3420 node, elements.getSelector(node), elements.getTypeMask(node), receiver); | 3420 node, elements.getSelector(node), elements.getTypeMask(node), receiver); |
3421 } | 3421 } |
3422 | 3422 |
3423 /// Generate a closurization of the static or top level [function]. | 3423 /// Generate a closurization of the static or top level [function]. |
3424 void generateStaticFunctionGet(ast.Send node, MethodElement function) { | 3424 void generateStaticFunctionGet(ast.Send node, MethodElement function) { |
3425 generateIsDeferredLoadedCheckOfSend(node); | 3425 generateIsDeferredLoadedCheckOfSend(node); |
3426 // TODO(5346): Try to avoid the need for calling [declaration] before | 3426 // TODO(5346): Try to avoid the need for calling [declaration] before |
3427 // creating an [HStatic]. | 3427 // creating an [HStatic]. |
3428 push(new HStatic(function.declaration, backend.nonNullType)); | 3428 push(new HStatic(function.declaration, backend.nonNullType)); |
3429 // TODO(ahe): This should be registered in codegen. | |
3430 registry.registerGetOfStaticFunction(function.declaration); | |
3431 } | 3429 } |
3432 | 3430 |
3433 /// Read a local variable, function or parameter. | 3431 /// Read a local variable, function or parameter. |
3434 void handleLocalGet(LocalElement local) { | 3432 void handleLocalGet(LocalElement local) { |
3435 stack.add(localsHandler.readLocal(local)); | 3433 stack.add(localsHandler.readLocal(local)); |
3436 } | 3434 } |
3437 | 3435 |
3438 @override | 3436 @override |
3439 void visitDynamicPropertyGet( | 3437 void visitDynamicPropertyGet( |
3440 ast.Send node, | 3438 ast.Send node, |
(...skipping 5245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8686 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 8684 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
8687 unaliased.accept(this, builder); | 8685 unaliased.accept(this, builder); |
8688 } | 8686 } |
8689 | 8687 |
8690 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 8688 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
8691 JavaScriptBackend backend = builder.compiler.backend; | 8689 JavaScriptBackend backend = builder.compiler.backend; |
8692 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 8690 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
8693 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 8691 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
8694 } | 8692 } |
8695 } | 8693 } |
OLD | NEW |