Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 * This phase simplifies interceptors in multiple ways: | 8 * This phase simplifies interceptors in multiple ways: |
| 9 * | 9 * |
| 10 * 1) If the interceptor is for an object whose type is known, it | 10 * 1) If the interceptor is for an object whose type is known, it |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 | 140 |
| 141 if (constantInterceptor == null) return null; | 141 if (constantInterceptor == null) return null; |
| 142 | 142 |
| 143 // If we just happen to be in an instance method of the constant | 143 // If we just happen to be in an instance method of the constant |
| 144 // interceptor, `this` is a shorter alias. | 144 // interceptor, `this` is a shorter alias. |
| 145 if (constantInterceptor == work.element.enclosingClass && | 145 if (constantInterceptor == work.element.enclosingClass && |
| 146 graph.thisInstruction != null) { | 146 graph.thisInstruction != null) { |
| 147 return graph.thisInstruction; | 147 return graph.thisInstruction; |
| 148 } | 148 } |
| 149 | 149 |
| 150 Constant constant = new InterceptorConstant(constantInterceptor.thisType); | 150 ConstantValue constant = new InterceptorConstantValue(constantInterceptor.th isType); |
|
sigurdm
2014/10/01 07:46:48
Long line
Johnni Winther
2014/10/01 08:21:24
Done.
| |
| 151 return graph.addConstant(constant, compiler); | 151 return graph.addConstant(constant, compiler); |
| 152 } | 152 } |
| 153 | 153 |
| 154 HInstruction findDominator(Iterable<HInstruction> instructions) { | 154 HInstruction findDominator(Iterable<HInstruction> instructions) { |
| 155 HInstruction result; | 155 HInstruction result; |
| 156 L1: for (HInstruction candidate in instructions) { | 156 L1: for (HInstruction candidate in instructions) { |
| 157 for (HInstruction current in instructions) { | 157 for (HInstruction current in instructions) { |
| 158 if (current != candidate && !candidate.dominates(current)) continue L1; | 158 if (current != candidate && !candidate.dominates(current)) continue L1; |
| 159 } | 159 } |
| 160 result = candidate; | 160 result = candidate; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 instruction = new HInvokeDynamicMethod( | 295 instruction = new HInvokeDynamicMethod( |
| 296 selector, inputs, node.instructionType, true); | 296 selector, inputs, node.instructionType, true); |
| 297 } | 297 } |
| 298 | 298 |
| 299 HBasicBlock block = node.block; | 299 HBasicBlock block = node.block; |
| 300 block.addAfter(node, instruction); | 300 block.addAfter(node, instruction); |
| 301 block.rewrite(node, instruction); | 301 block.rewrite(node, instruction); |
| 302 return true; | 302 return true; |
| 303 } | 303 } |
| 304 } | 304 } |
| OLD | NEW |