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

Side by Side Diff: lib/compiler/implementation/dart_backend/backend.dart

Issue 10795064: dart2dart: Introduce Renamer that is used by renaming unparser (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 class BailoutException { 5 class BailoutException {
6 final String reason; 6 final String reason;
7 7
8 const BailoutException(this.reason); 8 const BailoutException(this.reason);
9 } 9 }
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 void bailout(String reason) { 55 void bailout(String reason) {
56 throw new BailoutException(reason); 56 throw new BailoutException(reason);
57 } 57 }
58 58
59 /** 59 /**
60 * Tells whether we should output given element. Corelib classes like 60 * Tells whether we should output given element. Corelib classes like
61 * Object should not be in the resulting code. 61 * Object should not be in the resulting code.
62 */ 62 */
63 bool shouldOutput(Element element) { 63 bool shouldOutput(Element element) {
64 return element.kind !== ElementKind.VOID 64 return element.kind !== ElementKind.VOID
65 && element is! AbstractFieldElement
Anton Muhin 2012/07/23 11:23:10 why?
Roman 2012/07/23 15:34:15 I don't remember! I checked again without this con
65 && element.getLibrary() !== compiler.coreLibrary; 66 && element.getLibrary() !== compiler.coreLibrary;
66 } 67 }
67 68
68 try { 69 try {
69 Emitter emitter = new Emitter(compiler); 70 Emitter emitter = new Emitter(compiler);
70 resolvedElements.forEach((element, treeElements) { 71 resolvedElements.forEach((element, treeElements) {
71 if (!shouldOutput(element)) return; 72 if (!shouldOutput(element)) return;
72 if (element.isMember()) { 73 if (element.isMember()) {
73 var enclosingClass = element.enclosingElement; 74 var enclosingClass = element.enclosingElement;
74 assert(enclosingClass.isClass()); 75 assert(enclosingClass.isClass());
(...skipping 15 matching lines...) Expand all
90 compiler.assembledCode = ''' 91 compiler.assembledCode = '''
91 main() { 92 main() {
92 final bailout_reason = "${e.reason}"; 93 final bailout_reason = "${e.reason}";
93 } 94 }
94 '''; 95 ''';
95 } 96 }
96 } 97 }
97 98
98 log(String message) => compiler.log('[DartBackend] $message'); 99 log(String message) => compiler.log('[DartBackend] $message');
99 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698