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

Side by Side Diff: dart/pkg/dart2js_incremental/lib/library_updater.dart

Issue 745583003: Address comments from CL 739513002. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r41906. Created 6 years, 1 month 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 | dart/tests/try/web/incremental_compilation_update_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library dart2js_incremental.library_updater; 5 library dart2js_incremental.library_updater;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:convert' show 10 import 'dart:convert' show
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 compiler.internalError(element, '${element.runtimeType}'); 599 compiler.internalError(element, '${element.runtimeType}');
600 } 600 }
601 String name = info.name; 601 String name = info.name;
602 jsAst.Node function = info.code; 602 jsAst.Node function = info.code;
603 List<jsAst.Statement> statements = <jsAst.Statement>[]; 603 List<jsAst.Statement> statements = <jsAst.Statement>[];
604 if (element.isInstanceMember) { 604 if (element.isInstanceMember) {
605 jsAst.Node elementAccess = namer.elementAccess(element.enclosingClass); 605 jsAst.Node elementAccess = namer.elementAccess(element.enclosingClass);
606 statements.add( 606 statements.add(
607 js.statement('#.prototype.# = f', [elementAccess, name])); 607 js.statement('#.prototype.# = f', [elementAccess, name]));
608 608
609 if (backend.isAliasedSuperMember(element)) { 609 // TODO(ahe): Restore when isAliasedSuperMember is restored.
610 String superName = namer.getNameOfAliasedSuperMember(element); 610 // if (backend.isAliasedSuperMember(element)) {
611 statements.add( 611 // String superName = namer.getNameOfAliasedSuperMember(element);
612 js.statement('#.prototype.# = f', [elementAccess, superName])); 612 // statements.add(
613 } 613 // js.statement('#.prototype.# = f', [elementAccess, superName]));
614 // }
614 } else { 615 } else {
615 jsAst.Node elementAccess = namer.elementAccess(element); 616 jsAst.Node elementAccess = namer.elementAccess(element);
616 jsAst.Expression globalFunctionsAccess = 617 jsAst.Expression globalFunctionsAccess =
617 emitter.generateEmbeddedGlobalAccess(embeddedNames.GLOBAL_FUNCTIONS); 618 emitter.generateEmbeddedGlobalAccess(embeddedNames.GLOBAL_FUNCTIONS);
618 statements.add( 619 statements.add(
619 js.statement( 620 js.statement(
620 '#.# = # = f', 621 '#.# = # = f',
621 [globalFunctionsAccess, name, elementAccess])); 622 [globalFunctionsAccess, name, elementAccess]));
622 if (info.canTearOff) { 623 if (info.canTearOff) {
623 String globalName = namer.globalObjectFor(element); 624 String globalName = namer.globalObjectFor(element);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 784
784 PartialFunctionElement get after => null; 785 PartialFunctionElement get after => null;
785 786
786 void captureState() { 787 void captureState() {
787 if (wasStateCaptured) throw "captureState was called twice."; 788 if (wasStateCaptured) throw "captureState was called twice.";
788 wasStateCaptured = true; 789 wasStateCaptured = true;
789 790
790 if (element.isInstanceMember) { 791 if (element.isInstanceMember) {
791 elementAccess = namer.elementAccess(element.enclosingClass); 792 elementAccess = namer.elementAccess(element.enclosingClass);
792 name = namer.getNameOfMember(element); 793 name = namer.getNameOfMember(element);
793 if (backend.isAliasedSuperMember(element)) { 794 // TODO(ahe): Restore when isAliasedSuperMember is restored.
794 superName = namer.getNameOfAliasedSuperMember(element); 795 // if (backend.isAliasedSuperMember(element)) {
795 } 796 // superName = namer.getNameOfAliasedSuperMember(element);
797 // }
796 } else { 798 } else {
797 elementAccess = namer.elementAccess(element); 799 elementAccess = namer.elementAccess(element);
798 } 800 }
799 } 801 }
800 802
801 PartialFunctionElement apply() { 803 PartialFunctionElement apply() {
802 if (!wasStateCaptured) throw "captureState must be called before apply."; 804 if (!wasStateCaptured) throw "captureState must be called before apply.";
803 removeFromEnclosing(); 805 removeFromEnclosing();
804 reuseElement(); 806 reuseElement();
805 return null; 807 return null;
(...skipping 28 matching lines...) Expand all
834 836
835 final List<jsAst.Node> accessToStatics = <jsAst.Node>[]; 837 final List<jsAst.Node> accessToStatics = <jsAst.Node>[];
836 838
837 RemovedClassUpdate(Compiler compiler, this.element) 839 RemovedClassUpdate(Compiler compiler, this.element)
838 : super(compiler); 840 : super(compiler);
839 841
840 PartialClassElement get before => element; 842 PartialClassElement get before => element;
841 843
842 PartialClassElement get after => null; 844 PartialClassElement get after => null;
843 845
844 bool get isRemoval => true;
845
846 void captureState() { 846 void captureState() {
847 if (wasStateCaptured) throw "captureState was called twice."; 847 if (wasStateCaptured) throw "captureState was called twice.";
848 wasStateCaptured = true; 848 wasStateCaptured = true;
849 849
850 accessToStatics.add(namer.elementAccess(element)); 850 accessToStatics.add(namer.elementAccess(element));
851 851
852 element.forEachLocalMember((ElementX member) { 852 element.forEachLocalMember((ElementX member) {
853 if (!member.isInstanceMember) { 853 if (!member.isInstanceMember) {
854 accessToStatics.add(namer.elementAccess(member)); 854 accessToStatics.add(namer.elementAccess(member));
855 } 855 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 1082
1083 ClassEmitter get classEmitter => backend.emitter.oldEmitter.classEmitter; 1083 ClassEmitter get classEmitter => backend.emitter.oldEmitter.classEmitter;
1084 1084
1085 List<String> computeFields(ClassElement cls) { 1085 List<String> computeFields(ClassElement cls) {
1086 // TODO(ahe): Rewrite for new emitter. 1086 // TODO(ahe): Rewrite for new emitter.
1087 ClassBuilder builder = new ClassBuilder(cls, namer); 1087 ClassBuilder builder = new ClassBuilder(cls, namer);
1088 classEmitter.emitFields(cls, builder, ""); 1088 classEmitter.emitFields(cls, builder, "");
1089 return builder.fields; 1089 return builder.fields;
1090 } 1090 }
1091 } 1091 }
OLDNEW
« no previous file with comments | « no previous file | dart/tests/try/web/incremental_compilation_update_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698