Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 12828005: The intercepted classes set contains interceptor classes, not the classes they intercept. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/interceptor7_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 constantInterceptor = backend.jsBoolClass; 694 constantInterceptor = backend.jsBoolClass;
695 } else if (type.isString()) { 695 } else if (type.isString()) {
696 constantInterceptor = backend.jsStringClass; 696 constantInterceptor = backend.jsStringClass;
697 } else if (type.isArray()) { 697 } else if (type.isArray()) {
698 constantInterceptor = backend.jsArrayClass; 698 constantInterceptor = backend.jsArrayClass;
699 } else if (type.isNull()) { 699 } else if (type.isNull()) {
700 constantInterceptor = backend.jsNullClass; 700 constantInterceptor = backend.jsNullClass;
701 } else if (type.isNumber()) { 701 } else if (type.isNumber()) {
702 // If the method being intercepted is not defined in [int] or 702 // If the method being intercepted is not defined in [int] or
703 // [double] we can safely use the number interceptor. 703 // [double] we can safely use the number interceptor.
704 if (!intercepted.contains(compiler.intClass) 704 if (!intercepted.contains(backend.jsIntClass)
705 && !intercepted.contains(compiler.doubleClass)) { 705 && !intercepted.contains(backend.jsDoubleClass)) {
706 constantInterceptor = backend.jsNumberClass; 706 constantInterceptor = backend.jsNumberClass;
707 } 707 }
708 } 708 }
709 709
710 if (constantInterceptor == null) return null; 710 if (constantInterceptor == null) return null;
711 if (constantInterceptor == work.element.getEnclosingClass()) { 711 if (constantInterceptor == work.element.getEnclosingClass()) {
712 return graph.thisInstruction; 712 return graph.thisInstruction;
713 } 713 }
714 714
715 Constant constant = new InterceptorConstant( 715 Constant constant = new InterceptorConstant(
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 HBasicBlock block = user.block; 1532 HBasicBlock block = user.block;
1533 block.addAfter(user, interceptor); 1533 block.addAfter(user, interceptor);
1534 block.rewrite(user, interceptor); 1534 block.rewrite(user, interceptor);
1535 block.remove(user); 1535 block.remove(user);
1536 1536
1537 // The interceptor will be removed in the dead code elimination 1537 // The interceptor will be removed in the dead code elimination
1538 // phase. Note that removing it here would not work because of how 1538 // phase. Note that removing it here would not work because of how
1539 // the [visitBasicBlock] is implemented. 1539 // the [visitBasicBlock] is implemented.
1540 } 1540 }
1541 } 1541 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/interceptor7_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698