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 * Replaces some instructions with specialized versions to make codegen easier. | 8 * Replaces some instructions with specialized versions to make codegen easier. |
9 * Caches codegen information on nodes. | 9 * Caches codegen information on nodes. |
10 */ | 10 */ |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // | 104 // |
105 // This often reduces the number of references to 'a' to one, allowing 'a' | 105 // This often reduces the number of references to 'a' to one, allowing 'a' |
106 // to be generated at use to avoid a temporary, e.g. | 106 // to be generated at use to avoid a temporary, e.g. |
107 // | 107 // |
108 // t1 = b.get$thing(); | 108 // t1 = b.get$thing(); |
109 // t1.foo$1(t1, x) | 109 // t1.foo$1(t1, x) |
110 // ---> | 110 // ---> |
111 // b.get$thing().foo$1(0, x) | 111 // b.get$thing().foo$1(0, x) |
112 // | 112 // |
113 Selector selector = node.selector; | 113 Selector selector = node.selector; |
114 TypeMask mask = node.mask; | |
115 if (backend.isInterceptedSelector(selector) && | 114 if (backend.isInterceptedSelector(selector) && |
116 !backend.isInterceptedMixinSelector(selector, mask)) { | 115 !backend.isInterceptedMixinSelector(selector)) { |
117 HInstruction interceptor = node.inputs[0]; | 116 HInstruction interceptor = node.inputs[0]; |
118 HInstruction receiverArgument = node.inputs[1]; | 117 HInstruction receiverArgument = node.inputs[1]; |
119 | 118 |
120 if (interceptor.nonCheck() == receiverArgument.nonCheck()) { | 119 if (interceptor.nonCheck() == receiverArgument.nonCheck()) { |
121 // TODO(15933): Make automatically generated property extraction | 120 // TODO(15933): Make automatically generated property extraction |
122 // closures work with the dummy receiver optimization. | 121 // closures work with the dummy receiver optimization. |
123 if (!selector.isGetter) { | 122 if (!selector.isGetter) { |
124 ConstantValue constant = new SyntheticConstantValue( | 123 ConstantValue constant = new SyntheticConstantValue( |
125 SyntheticConstantKind.DUMMY_INTERCEPTOR, | 124 SyntheticConstantKind.DUMMY_INTERCEPTOR, |
126 receiverArgument.instructionType); | 125 receiverArgument.instructionType); |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 } | 758 } |
760 | 759 |
761 // If [thenInput] is defined in the first predecessor, then it is only used | 760 // If [thenInput] is defined in the first predecessor, then it is only used |
762 // by [phi] and can be generated at use site. | 761 // by [phi] and can be generated at use site. |
763 if (identical(thenInput.block, end.predecessors[0])) { | 762 if (identical(thenInput.block, end.predecessors[0])) { |
764 assert(thenInput.usedBy.length == 1); | 763 assert(thenInput.usedBy.length == 1); |
765 markAsGenerateAtUseSite(thenInput); | 764 markAsGenerateAtUseSite(thenInput); |
766 } | 765 } |
767 } | 766 } |
768 } | 767 } |
OLD | NEW |