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 | 6 |
7 final JavaScriptBackend backend; | 7 final JavaScriptBackend backend; |
8 | 8 |
9 SsaCodeGeneratorTask(JavaScriptBackend backend) | 9 SsaCodeGeneratorTask(JavaScriptBackend backend) |
10 : this.backend = backend, | 10 : this.backend = backend, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // the declaration. | 78 // the declaration. |
79 FunctionElement function = work.element; | 79 FunctionElement function = work.element; |
80 function.computeSignature(compiler).forEachParameter((element) { | 80 function.computeSignature(compiler).forEachParameter((element) { |
81 compiler.enqueuer.codegen.addToWorkList(element, work.resolutionTree); | 81 compiler.enqueuer.codegen.addToWorkList(element, work.resolutionTree); |
82 }); | 82 }); |
83 List<js.Parameter> parameters = <js.Parameter>[]; | 83 List<js.Parameter> parameters = <js.Parameter>[]; |
84 parameterNames.forEach((element, name) { | 84 parameterNames.forEach((element, name) { |
85 parameters.add(new js.Parameter(name)); | 85 parameters.add(new js.Parameter(name)); |
86 }); | 86 }); |
87 addTypeParameters(work.element, parameters, parameterNames); | 87 addTypeParameters(work.element, parameters, parameterNames); |
88 String parametersString = Strings.join(parameterNames.getValues(), ", "); | 88 String parametersString = Strings.join(parameterNames.values, ", "); |
89 SsaOptimizedCodeGenerator codegen = new SsaOptimizedCodeGenerator( | 89 SsaOptimizedCodeGenerator codegen = new SsaOptimizedCodeGenerator( |
90 backend, work, parameters, parameterNames); | 90 backend, work, parameters, parameterNames); |
91 codegen.visitGraph(graph); | 91 codegen.visitGraph(graph); |
92 | 92 |
93 FunctionElement element = work.element; | 93 FunctionElement element = work.element; |
94 js.Block body; | 94 js.Block body; |
95 ClassElement enclosingClass = element.getEnclosingClass(); | 95 ClassElement enclosingClass = element.getEnclosingClass(); |
96 if (element.isInstanceMember() | 96 if (element.isInstanceMember() |
97 && enclosingClass.isNative() | 97 && enclosingClass.isNative() |
98 && native.isOverriddenMethod( | 98 && native.isOverriddenMethod( |
(...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2990 if (leftType.canBeNull() && rightType.canBeNull()) { | 2990 if (leftType.canBeNull() && rightType.canBeNull()) { |
2991 if (left.isConstantNull() || right.isConstantNull() || | 2991 if (left.isConstantNull() || right.isConstantNull() || |
2992 (leftType.isPrimitive() && leftType == rightType)) { | 2992 (leftType.isPrimitive() && leftType == rightType)) { |
2993 return '=='; | 2993 return '=='; |
2994 } | 2994 } |
2995 return null; | 2995 return null; |
2996 } else { | 2996 } else { |
2997 return '==='; | 2997 return '==='; |
2998 } | 2998 } |
2999 } | 2999 } |
OLD | NEW |