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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 891673003: dart2js: Refactoring, documentation, and a few bugfixes in Namer class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 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
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 js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
10 10
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 bool isInterceptorClass(ClassElement element) { 540 bool isInterceptorClass(ClassElement element) {
541 if (element == null) return false; 541 if (element == null) return false;
542 if (Elements.isNativeOrExtendsNative(element)) return true; 542 if (Elements.isNativeOrExtendsNative(element)) return true;
543 if (interceptedClasses.contains(element)) return true; 543 if (interceptedClasses.contains(element)) return true;
544 if (classesMixedIntoInterceptedClasses.contains(element)) return true; 544 if (classesMixedIntoInterceptedClasses.contains(element)) return true;
545 return false; 545 return false;
546 } 546 }
547 547
548 String registerOneShotInterceptor(Selector selector) { 548 String registerOneShotInterceptor(Selector selector) {
549 Set<ClassElement> classes = getInterceptedClassesOn(selector.name); 549 Set<ClassElement> classes = getInterceptedClassesOn(selector.name);
550 String name = namer.getOneShotInterceptorName(selector, classes); 550 String name = namer.nameForGetOneShotInterceptor(selector, classes);
551 if (!oneShotInterceptors.containsKey(name)) { 551 if (!oneShotInterceptors.containsKey(name)) {
552 registerSpecializedGetInterceptor(classes); 552 registerSpecializedGetInterceptor(classes);
553 oneShotInterceptors[name] = selector; 553 oneShotInterceptors[name] = selector;
554 } 554 }
555 return name; 555 return name;
556 } 556 }
557 557
558 /** 558 /**
559 * Record that [method] is called from a subclass via `super`. 559 * Record that [method] is called from a subclass via `super`.
560 */ 560 */
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 } 739 }
740 enqueueClass(enqueuer, cls, registry); 740 enqueueClass(enqueuer, cls, registry);
741 } 741 }
742 742
743 Set<ClassElement> get interceptedClasses { 743 Set<ClassElement> get interceptedClasses {
744 assert(compiler.enqueuer.resolution.queueIsClosed); 744 assert(compiler.enqueuer.resolution.queueIsClosed);
745 return _interceptedClasses; 745 return _interceptedClasses;
746 } 746 }
747 747
748 void registerSpecializedGetInterceptor(Set<ClassElement> classes) { 748 void registerSpecializedGetInterceptor(Set<ClassElement> classes) {
749 String name = namer.getInterceptorName(getInterceptorMethod, classes); 749 String name = namer.nameForGetInterceptor(classes);
750 if (classes.contains(jsInterceptorClass)) { 750 if (classes.contains(jsInterceptorClass)) {
751 // We can't use a specialized [getInterceptorMethod], so we make 751 // We can't use a specialized [getInterceptorMethod], so we make
752 // sure we emit the one with all checks. 752 // sure we emit the one with all checks.
753 specializedGetInterceptors[name] = interceptedClasses; 753 specializedGetInterceptors[name] = interceptedClasses;
754 } else { 754 } else {
755 specializedGetInterceptors[name] = classes; 755 specializedGetInterceptors[name] = classes;
756 } 756 }
757 } 757 }
758 758
759 void registerCompileTimeConstant(ConstantValue constant, Registry registry) { 759 void registerCompileTimeConstant(ConstantValue constant, Registry registry) {
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
2705 } 2705 }
2706 } 2706 }
2707 2707
2708 /// Records that [constant] is used by the element behind [registry]. 2708 /// Records that [constant] is used by the element behind [registry].
2709 class Dependency { 2709 class Dependency {
2710 final ConstantValue constant; 2710 final ConstantValue constant;
2711 final Element annotatedElement; 2711 final Element annotatedElement;
2712 2712
2713 const Dependency(this.constant, this.annotatedElement); 2713 const Dependency(this.constant, this.annotatedElement);
2714 } 2714 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698