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

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

Issue 636903002: Compute an incremental patch to JavaScript code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use Namer.elementAccess (to address Johnni's comment) Created 6 years, 2 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 dart2js; 5 part of dart2js;
6 6
7 typedef ItemCompilationContext ItemCompilationContextCreator(); 7 typedef ItemCompilationContext ItemCompilationContextCreator();
8 8
9 class EnqueueTask extends CompilerTask { 9 class EnqueueTask extends CompilerTask {
10 final ResolutionEnqueuer resolution; 10 final ResolutionEnqueuer resolution;
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 * 850 *
851 * For code generation, we rely on the precomputed set of elements that takes 851 * For code generation, we rely on the precomputed set of elements that takes
852 * subtyping constraints into account. 852 * subtyping constraints into account.
853 */ 853 */
854 bool shouldIncludeElementDueToMirrors(Element element, 854 bool shouldIncludeElementDueToMirrors(Element element,
855 {bool includedEnclosing}) { 855 {bool includedEnclosing}) {
856 return compiler.backend.isAccessibleByReflection(element); 856 return compiler.backend.isAccessibleByReflection(element);
857 } 857 }
858 858
859 bool internalAddToWorkList(Element element) { 859 bool internalAddToWorkList(Element element) {
860 if (compiler.hasIncrementalSupport) {
861 newlyEnqueuedElements.add(element);
862 }
863 // Don't generate code for foreign elements. 860 // Don't generate code for foreign elements.
864 if (element.isForeign(compiler.backend)) return false; 861 if (element.isForeign(compiler.backend)) return false;
865 862
866 // Codegen inlines field initializers. It only needs to generate 863 // Codegen inlines field initializers. It only needs to generate
867 // code for checked setters. 864 // code for checked setters.
868 if (element.isField && element.isInstanceMember) { 865 if (element.isField && element.isInstanceMember) {
869 if (!compiler.enableTypeAssertions 866 if (!compiler.enableTypeAssertions
870 || element.enclosingElement.isClosure) { 867 || element.enclosingElement.isClosure) {
871 return false; 868 return false;
872 } 869 }
873 } 870 }
874 871
872 if (compiler.hasIncrementalSupport && !isProcessed(element)) {
873 newlyEnqueuedElements.add(element);
874 }
875
875 if (queueIsClosed) { 876 if (queueIsClosed) {
876 throw new SpannableAssertionFailure(element, 877 throw new SpannableAssertionFailure(element,
877 "Codegen work list is closed. Trying to add $element"); 878 "Codegen work list is closed. Trying to add $element");
878 } 879 }
879 CodegenWorkItem workItem = new CodegenWorkItem( 880 CodegenWorkItem workItem = new CodegenWorkItem(
880 element, itemCompilationContextCreator()); 881 element, itemCompilationContextCreator());
881 queue.add(workItem); 882 queue.add(workItem);
882 return true; 883 return true;
883 } 884 }
884 885
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 void processWorkItem(void f(WorkItem work), WorkItem work) { 919 void processWorkItem(void f(WorkItem work), WorkItem work) {
919 f(work); 920 f(work);
920 } 921 }
921 } 922 }
922 923
923 void removeFromSet(Map<String, Set<Element>> map, Element element) { 924 void removeFromSet(Map<String, Set<Element>> map, Element element) {
924 Set<Element> set = map[element.name]; 925 Set<Element> set = map[element.name];
925 if (set == null) return; 926 if (set == null) return;
926 set.remove(element); 927 set.remove(element);
927 } 928 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698