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 SsaCodeGeneratorTask extends CompilerTask { | 7 class SsaCodeGeneratorTask extends CompilerTask { |
8 | 8 |
9 final JavaScriptBackend backend; | 9 final JavaScriptBackend backend; |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 FunctionSignature params = functionElement.computeSignature(compiler); | 152 FunctionSignature params = functionElement.computeSignature(compiler); |
153 TreeElements elements = | 153 TreeElements elements = |
154 compiler.enqueuer.resolution.getCachedElements(element); | 154 compiler.enqueuer.resolution.getCachedElements(element); |
155 params.orderedForEachParameter((Element element) { | 155 params.orderedForEachParameter((Element element) { |
156 if (elements.isParameterChecked(element)) { | 156 if (elements.isParameterChecked(element)) { |
157 Element checkResultElement = | 157 Element checkResultElement = |
158 closureData.parametersWithSentinel[element]; | 158 closureData.parametersWithSentinel[element]; |
159 addBackendParameter(checkResultElement, parameters, parameterNames); | 159 addBackendParameter(checkResultElement, parameters, parameterNames); |
160 } | 160 } |
161 }); | 161 }); |
162 // Put the box parameter. | |
ahe
2012/11/06 15:14:22
What does this comment mean?
| |
163 ClosureScope scopeData = closureData.capturingScopes[node]; | |
164 if (scopeData != null) { | |
165 addBackendParameter(scopeData.boxElement, parameters, parameterNames); | |
166 } | |
162 } | 167 } |
163 } | 168 } |
164 | 169 |
165 CodeBuffer generateBailoutMethod(WorkItem work, HGraph graph) { | 170 CodeBuffer generateBailoutMethod(WorkItem work, HGraph graph) { |
166 return measure(() { | 171 return measure(() { |
167 compiler.tracer.traceGraph("codegen-bailout", graph); | 172 compiler.tracer.traceGraph("codegen-bailout", graph); |
168 | 173 |
169 Map<Element, String> parameterNames = getParameterNames(work); | 174 Map<Element, String> parameterNames = getParameterNames(work); |
170 List<js.Parameter> parameters = <js.Parameter>[]; | 175 List<js.Parameter> parameters = <js.Parameter>[]; |
171 parameterNames.forEach((element, name) { | 176 parameterNames.forEach((element, name) { |
(...skipping 2859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3031 if (leftType.canBeNull() && rightType.canBeNull()) { | 3036 if (leftType.canBeNull() && rightType.canBeNull()) { |
3032 if (left.isConstantNull() || right.isConstantNull() || | 3037 if (left.isConstantNull() || right.isConstantNull() || |
3033 (leftType.isPrimitive() && leftType == rightType)) { | 3038 (leftType.isPrimitive() && leftType == rightType)) { |
3034 return '=='; | 3039 return '=='; |
3035 } | 3040 } |
3036 return null; | 3041 return null; |
3037 } else { | 3042 } else { |
3038 return '==='; | 3043 return '==='; |
3039 } | 3044 } |
3040 } | 3045 } |
OLD | NEW |