Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart |
| =================================================================== |
| --- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 18140) |
| +++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy) |
| @@ -279,6 +279,12 @@ |
| HInstruction input = node.inputs[1]; |
| HType type = types[input]; |
| var interceptor = node.inputs[0]; |
| + |
| + if (interceptor.isConstant() && selector.isCall()) { |
| + DartType type = types[interceptor].computeType(compiler); |
| + node.element = type.element.lookupSelector(selector); |
| + } |
| + |
| if (interceptor is !HThis && !type.canBePrimitive()) { |
| // If the type can be null, and the intercepted method can be in |
| // the object class, keep the interceptor. |
| @@ -331,6 +337,10 @@ |
| } |
| } |
| if (target != null) { |
| + // There is a strong dependency between codegen and this |
|
kasperl
2013/02/06 07:24:03
Is this a TODO? It's unclear from the comment whet
ngeoffray
2013/02/06 08:11:55
It's kind of a problem. The feature is that we're
|
| + // optimization that the dynamic invoke does not need an |
| + // interceptor. Once we start inlining, the dependency should |
| + // go away. |
| HInvokeDynamicMethod result = new HInvokeDynamicMethod( |
| node.selector, node.inputs.getRange(1, node.inputs.length - 1)); |
| result.element = target; |
| @@ -812,6 +822,7 @@ |
| void visitInvokeDynamicMethod(HInvokeDynamicMethod node) { |
| Element element = node.element; |
| + if (node.isInterceptorCall) return; |
| if (element != backend.jsArrayRemoveLast) return; |
| if (boundsChecked.contains(node)) return; |
| insertBoundsCheck( |