| 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 import '../compiler.dart' show Compiler; | 5 import '../compiler.dart' show Compiler; |
| 6 import '../constants/values.dart'; | 6 import '../constants/values.dart'; |
| 7 import '../elements/elements.dart'; | 7 import '../elements/elements.dart'; |
| 8 import '../js_backend/js_backend.dart'; | 8 import '../js_backend/js_backend.dart'; |
| 9 import '../types/types.dart'; | 9 import '../types/types.dart'; |
| 10 import '../universe/selector.dart' show Selector; | 10 import '../universe/selector.dart' show Selector; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 .isNotEmpty; | 412 .isNotEmpty; |
| 413 } | 413 } |
| 414 | 414 |
| 415 void visitInstruction(HInstruction instruction) { | 415 void visitInstruction(HInstruction instruction) { |
| 416 // A code motion invariant instruction is dealt before visiting it. | 416 // A code motion invariant instruction is dealt before visiting it. |
| 417 assert(!instruction.isCodeMotionInvariant()); | 417 assert(!instruction.isCodeMotionInvariant()); |
| 418 analyzeInputs(instruction, 0); | 418 analyzeInputs(instruction, 0); |
| 419 } | 419 } |
| 420 | 420 |
| 421 void visitInvokeSuper(HInvokeSuper instruction) { | 421 void visitInvokeSuper(HInvokeSuper instruction) { |
| 422 Element superMethod = instruction.element; | 422 MemberElement superMethod = instruction.element; |
| 423 Selector selector = instruction.selector; | 423 Selector selector = instruction.selector; |
| 424 // If aliased super members cannot be used, we will generate code like | 424 // If aliased super members cannot be used, we will generate code like |
| 425 // | 425 // |
| 426 // C.prototype.method.call(instance) | 426 // C.prototype.method.call(instance) |
| 427 // | 427 // |
| 428 // where instance is the [this] object for the method. In such a case, the | 428 // where instance is the [this] object for the method. In such a case, the |
| 429 // get of prototype might be evaluated before instance is created if we | 429 // get of prototype might be evaluated before instance is created if we |
| 430 // generate instance at use site, which in turn might update the prototype | 430 // generate instance at use site, which in turn might update the prototype |
| 431 // after first access if we use lazy initialization. | 431 // after first access if we use lazy initialization. |
| 432 // In this case, we therefore don't allow the receiver (the first argument) | 432 // In this case, we therefore don't allow the receiver (the first argument) |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 } | 788 } |
| 789 | 789 |
| 790 // If [thenInput] is defined in the first predecessor, then it is only used | 790 // If [thenInput] is defined in the first predecessor, then it is only used |
| 791 // by [phi] and can be generated at use site. | 791 // by [phi] and can be generated at use site. |
| 792 if (identical(thenInput.block, end.predecessors[0])) { | 792 if (identical(thenInput.block, end.predecessors[0])) { |
| 793 assert(thenInput.usedBy.length == 1); | 793 assert(thenInput.usedBy.length == 1); |
| 794 markAsGenerateAtUseSite(thenInput); | 794 markAsGenerateAtUseSite(thenInput); |
| 795 } | 795 } |
| 796 } | 796 } |
| 797 } | 797 } |
| OLD | NEW |