| 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 /** | 7 /** |
| 8 * A special element for the extra parameter taken by intercepted | 8 * A special element for the extra parameter taken by intercepted |
| 9 * methods. We need to override [Element.computeType] because our | 9 * methods. We need to override [Element.computeType] because our |
| 10 * optimizers may look at its declared type. | 10 * optimizers may look at its declared type. |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 // constructor call the constructor with `null`. | 310 // constructor call the constructor with `null`. |
| 311 HParameterValue value = | 311 HParameterValue value = |
| 312 new HParameterValue(parameter, new TypeMask.exact(cls)); | 312 new HParameterValue(parameter, new TypeMask.exact(cls)); |
| 313 builder.graph.explicitReceiverParameter = value; | 313 builder.graph.explicitReceiverParameter = value; |
| 314 builder.graph.entry.addAtEntry(value); | 314 builder.graph.entry.addAtEntry(value); |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 | 317 |
| 318 /** | 318 /** |
| 319 * Returns true if the local can be accessed directly. Boxed variables or | 319 * Returns true if the local can be accessed directly. Boxed variables or |
| 320 * captured variables that are stored in the closure-field return [false]. | 320 * captured variables that are stored in the closure-field return [:false:]. |
| 321 */ | 321 */ |
| 322 bool isAccessedDirectly(Element element) { | 322 bool isAccessedDirectly(Element element) { |
| 323 assert(element != null); | 323 assert(element != null); |
| 324 return redirectionMapping[element] == null | 324 return redirectionMapping[element] == null |
| 325 && !closureData.usedVariablesInTry.contains(element); | 325 && !closureData.usedVariablesInTry.contains(element); |
| 326 } | 326 } |
| 327 | 327 |
| 328 bool isStoredInClosureField(Element element) { | 328 bool isStoredInClosureField(Element element) { |
| 329 assert(element != null); | 329 assert(element != null); |
| 330 if (isAccessedDirectly(element)) return false; | 330 if (isAccessedDirectly(element)) return false; |
| (...skipping 6074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6405 DartType unaliased = type.unalias(builder.compiler); | 6405 DartType unaliased = type.unalias(builder.compiler); |
| 6406 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 6406 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 6407 unaliased.accept(this, builder); | 6407 unaliased.accept(this, builder); |
| 6408 } | 6408 } |
| 6409 | 6409 |
| 6410 void visitDynamicType(DynamicType type, SsaFromAstMixin builder) { | 6410 void visitDynamicType(DynamicType type, SsaFromAstMixin builder) { |
| 6411 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); | 6411 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); |
| 6412 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); | 6412 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); |
| 6413 } | 6413 } |
| 6414 } | 6414 } |
| OLD | NEW |