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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 !backend.isInterceptedMixinSelector(invoke.selector)) { | 281 !backend.isInterceptedMixinSelector(invoke.selector)) { |
282 HInstruction receiverArgument = invoke.inputs[1]; | 282 HInstruction receiverArgument = invoke.inputs[1]; |
283 // TODO(15720): The test here should be | 283 // TODO(15720): The test here should be |
284 // | 284 // |
285 // invoke.receiver.nonCheck() == receiverArgument.nonCheck() | 285 // invoke.receiver.nonCheck() == receiverArgument.nonCheck() |
286 // | 286 // |
287 if (invoke.receiver == receiverArgument) { // recognize a.foo(a,...) | 287 if (invoke.receiver == receiverArgument) { // recognize a.foo(a,...) |
288 // TODO(15933): Make automatically generated property extraction | 288 // TODO(15933): Make automatically generated property extraction |
289 // closures work with the dummy receiver optimization. | 289 // closures work with the dummy receiver optimization. |
290 if (!invoke.selector.isGetter()) { | 290 if (!invoke.selector.isGetter()) { |
291 Constant constant = new DummyReceiverConstant( | 291 Constant constant = new DummyConstant( |
292 receiverArgument.instructionType); | 292 receiverArgument.instructionType); |
293 HConstant dummy = graph.addConstant(constant, compiler); | 293 HConstant dummy = graph.addConstant(constant, compiler); |
294 receiverArgument.usedBy.remove(invoke); | 294 receiverArgument.usedBy.remove(invoke); |
295 invoke.inputs[1] = dummy; | 295 invoke.inputs[1] = dummy; |
296 dummy.usedBy.add(invoke); | 296 dummy.usedBy.add(invoke); |
297 } | 297 } |
298 } | 298 } |
299 } | 299 } |
300 } | 300 } |
301 } | 301 } |
(...skipping 26 matching lines...) Expand all Loading... |
328 instruction = new HInvokeDynamicMethod( | 328 instruction = new HInvokeDynamicMethod( |
329 selector, inputs, node.instructionType, true); | 329 selector, inputs, node.instructionType, true); |
330 } | 330 } |
331 | 331 |
332 HBasicBlock block = node.block; | 332 HBasicBlock block = node.block; |
333 block.addAfter(node, instruction); | 333 block.addAfter(node, instruction); |
334 block.rewrite(node, instruction); | 334 block.rewrite(node, instruction); |
335 return true; | 335 return true; |
336 } | 336 } |
337 } | 337 } |
OLD | NEW |