| 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 class SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); | 6 SsaCodeGeneratorTask(Compiler compiler) : super(compiler); |
| 7 String get name() => 'SSA code generator'; | 7 String get name() => 'SSA code generator'; |
| 8 | 8 |
| 9 | 9 |
| 10 String generateMethod(WorkItem work, HGraph graph) { | 10 String generateMethod(WorkItem work, HGraph graph) { |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 int argumentCount = node.inputs.length - 1; | 1000 int argumentCount = node.inputs.length - 1; |
| 1001 | 1001 |
| 1002 // TODO(ahe): The constructor name was statically resolved in | 1002 // TODO(ahe): The constructor name was statically resolved in |
| 1003 // SsaBuilder.buildFactory. Is there a cleaner way to do this? | 1003 // SsaBuilder.buildFactory. Is there a cleaner way to do this? |
| 1004 node.name.printOn(buffer); | 1004 node.name.printOn(buffer); |
| 1005 visitArguments(node.inputs); | 1005 visitArguments(node.inputs); |
| 1006 } else { | 1006 } else { |
| 1007 buffer.add(compiler.namer.instanceMethodInvocationName( | 1007 buffer.add(compiler.namer.instanceMethodInvocationName( |
| 1008 currentLibrary, node.name, node.selector)); | 1008 currentLibrary, node.name, node.selector)); |
| 1009 visitArguments(node.inputs); | 1009 visitArguments(node.inputs); |
| 1010 compiler.registerDynamicInvocation(node.name, node.selector); | 1010 if (node.element !== null) { |
| 1011 // If we know we're calling a specific method, register that |
| 1012 // method only. |
| 1013 compiler.registerDynamicInvocationOn( |
| 1014 node.name, node.selector, node.element); |
| 1015 } else { |
| 1016 compiler.registerDynamicInvocation(node.name, node.selector); |
| 1017 } |
| 1011 } | 1018 } |
| 1012 endExpression(JSPrecedence.CALL_PRECEDENCE); | 1019 endExpression(JSPrecedence.CALL_PRECEDENCE); |
| 1013 } | 1020 } |
| 1014 | 1021 |
| 1015 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { | 1022 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { |
| 1016 beginExpression(JSPrecedence.CALL_PRECEDENCE); | 1023 beginExpression(JSPrecedence.CALL_PRECEDENCE); |
| 1017 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); | 1024 use(node.receiver, JSPrecedence.MEMBER_PRECEDENCE); |
| 1018 buffer.add('.'); | 1025 buffer.add('.'); |
| 1019 buffer.add(compiler.namer.setterName(currentLibrary, node.name)); | 1026 buffer.add(compiler.namer.setterName(currentLibrary, node.name)); |
| 1020 visitArguments(node.inputs); | 1027 visitArguments(node.inputs); |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 startBailoutSwitch(); | 1920 startBailoutSwitch(); |
| 1914 } | 1921 } |
| 1915 } | 1922 } |
| 1916 | 1923 |
| 1917 void endElse(HIf node) { | 1924 void endElse(HIf node) { |
| 1918 if (node.elseBlock.hasGuards()) { | 1925 if (node.elseBlock.hasGuards()) { |
| 1919 endBailoutSwitch(); | 1926 endBailoutSwitch(); |
| 1920 } | 1927 } |
| 1921 } | 1928 } |
| 1922 } | 1929 } |
| OLD | NEW |