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

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

Issue 11817013: Do not apply optimizations based on an element if that element cannot be resolved. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 unimplemented('Compiler.legDirectory'); 953 unimplemented('Compiler.legDirectory');
954 } 954 }
955 955
956 // TODO(karlklose): split into findHelperFunction and findHelperClass and 956 // TODO(karlklose): split into findHelperFunction and findHelperClass and
957 // add a check that the element has the expected kind. 957 // add a check that the element has the expected kind.
958 Element findHelper(SourceString name) 958 Element findHelper(SourceString name)
959 => jsHelperLibrary.findLocal(name); 959 => jsHelperLibrary.findLocal(name);
960 Element findInterceptor(SourceString name) 960 Element findInterceptor(SourceString name)
961 => interceptorsLibrary.findLocal(name); 961 => interceptorsLibrary.findLocal(name);
962 962
963 Element findInScopeContainer(ScopeContainerElement scope, SourceString name) {
ahe 2013/01/09 15:46:27 I really don't like the term "scope container", an
ngeoffray 2013/01/10 09:41:48 Renamed to findElementIn.
964 Element element = scope.localLookup(name);
965 if (element == null) {
966 internalError('Could not find ${name.slowToString()} in $scope');
ahe 2013/01/09 15:46:27 Throw an exception instead?
ngeoffray 2013/01/10 09:41:48 Done.
967 }
968 return element;
969 }
970
963 bool get isMockCompilation => false; 971 bool get isMockCompilation => false;
964 972
965 Token processAndStripComments(Token currentToken) { 973 Token processAndStripComments(Token currentToken) {
966 Token firstToken = currentToken; 974 Token firstToken = currentToken;
967 Token prevToken; 975 Token prevToken;
968 while (currentToken.kind != EOF_TOKEN) { 976 while (currentToken.kind != EOF_TOKEN) {
969 if (identical(currentToken.kind, COMMENT_TOKEN)) { 977 if (identical(currentToken.kind, COMMENT_TOKEN)) {
970 Token firstCommentToken = currentToken; 978 Token firstCommentToken = currentToken;
971 while (identical(currentToken.kind, COMMENT_TOKEN)) { 979 while (identical(currentToken.kind, COMMENT_TOKEN)) {
972 currentToken = currentToken.next; 980 currentToken = currentToken.next;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 // TODO(johnniwinther): Use [spannable] and [message] to provide better 1080 // TODO(johnniwinther): Use [spannable] and [message] to provide better
1073 // information on assertion errors. 1081 // information on assertion errors.
1074 if (condition is Function){ 1082 if (condition is Function){
1075 condition = condition(); 1083 condition = condition();
1076 } 1084 }
1077 if (spannable == null || !condition) { 1085 if (spannable == null || !condition) {
1078 throw new SpannableAssertionFailure(spannable, message); 1086 throw new SpannableAssertionFailure(spannable, message);
1079 } 1087 }
1080 return true; 1088 return true;
1081 } 1089 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698