| 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 import '../common_elements.dart' show CommonElements; | 5 import '../common_elements.dart' show CommonElements; |
| 6 import '../constants/constant_system.dart'; | 6 import '../constants/constant_system.dart'; |
| 7 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
| 8 import '../elements/entities.dart'; | 8 import '../elements/entities.dart'; |
| 9 import '../js_backend/interceptor_data.dart'; | 9 import '../js_backend/interceptor_data.dart'; |
| 10 import '../types/types.dart'; | 10 import '../types/types.dart'; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 instruction.block.remove(instruction); | 64 instruction.block.remove(instruction); |
| 65 } | 65 } |
| 66 instruction = next; | 66 instruction = next; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool visitInstruction(HInstruction instruction) => false; | 70 bool visitInstruction(HInstruction instruction) => false; |
| 71 | 71 |
| 72 bool visitInvoke(HInvoke invoke) { | 72 bool visitInvoke(HInvoke invoke) { |
| 73 if (!invoke.isInterceptedCall) return false; | 73 if (!invoke.isInterceptedCall) return false; |
| 74 var interceptor = invoke.inputs[0]; | 74 dynamic interceptor = invoke.inputs[0]; |
| 75 if (interceptor is! HInterceptor) return false; | 75 if (interceptor is! HInterceptor) return false; |
| 76 | 76 |
| 77 // TODO(sra): Move this per-call code to visitInterceptor. | 77 // TODO(sra): Move this per-call code to visitInterceptor. |
| 78 // | 78 // |
| 79 // The interceptor is visited first, so we get here only when the | 79 // The interceptor is visited first, so we get here only when the |
| 80 // interceptor was not rewritten to a single shared replacement. I'm not | 80 // interceptor was not rewritten to a single shared replacement. I'm not |
| 81 // sure we should substitute a constant interceptor on a per-call basis if | 81 // sure we should substitute a constant interceptor on a per-call basis if |
| 82 // the interceptor is already available in a local variable, but it is | 82 // the interceptor is already available in a local variable, but it is |
| 83 // possible that all uses can be rewritten to use different constants. | 83 // possible that all uses can be rewritten to use different constants. |
| 84 | 84 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 instruction = new HInvokeDynamicMethod( | 421 instruction = new HInvokeDynamicMethod( |
| 422 selector, mask, inputs, node.instructionType, true); | 422 selector, mask, inputs, node.instructionType, true); |
| 423 } | 423 } |
| 424 | 424 |
| 425 HBasicBlock block = node.block; | 425 HBasicBlock block = node.block; |
| 426 block.addAfter(node, instruction); | 426 block.addAfter(node, instruction); |
| 427 block.rewrite(node, instruction); | 427 block.rewrite(node, instruction); |
| 428 return true; | 428 return true; |
| 429 } | 429 } |
| 430 } | 430 } |
| OLD | NEW |