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

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

Issue 19754002: Rewrite how we handle synthesized constructors in the compiler. This was motivated by issue https:/… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compile_time_constants.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) 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 library closureToClassMapper; 5 library closureToClassMapper;
6 6
7 import "elements/elements.dart"; 7 import "elements/elements.dart";
8 import "dart2jslib.dart"; 8 import "dart2jslib.dart";
9 import "dart_types.dart"; 9 import "dart_types.dart";
10 import "scanner/scannerlib.dart" show Token; 10 import "scanner/scannerlib.dart" show Token;
(...skipping 24 matching lines...) Expand all
35 ClosureClassMap cached = closureMappingCache[node]; 35 ClosureClassMap cached = closureMappingCache[node];
36 if (cached != null) return cached; 36 if (cached != null) return cached;
37 37
38 ClosureTranslator translator = 38 ClosureTranslator translator =
39 new ClosureTranslator(compiler, elements, closureMappingCache, namer); 39 new ClosureTranslator(compiler, elements, closureMappingCache, namer);
40 40
41 // The translator will store the computed closure-mappings inside the 41 // The translator will store the computed closure-mappings inside the
42 // cache. One for given node and one for each nested closure. 42 // cache. One for given node and one for each nested closure.
43 if (node is FunctionExpression) { 43 if (node is FunctionExpression) {
44 translator.translateFunction(element, node); 44 translator.translateFunction(element, node);
45 } else if (element.isSynthesized) {
46 return new ClosureClassMap(null, null, null, new ThisElement(element));
45 } else { 47 } else {
46 // Must be the lazy initializer of a static. 48 // Must be the lazy initializer of a static.
47 assert(node is SendSet); 49 assert(node is SendSet);
48 translator.translateLazyInitializer(element, node); 50 translator.translateLazyInitializer(element, node);
49 } 51 }
50 assert(closureMappingCache[node] != null); 52 assert(closureMappingCache[node] != null);
51 return closureMappingCache[node]; 53 return closureMappingCache[node];
52 }); 54 });
53 } 55 }
54 56
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 } 817 }
816 818
817 visitTryStatement(TryStatement node) { 819 visitTryStatement(TryStatement node) {
818 // TODO(ngeoffray): implement finer grain state. 820 // TODO(ngeoffray): implement finer grain state.
819 bool oldInTryStatement = inTryStatement; 821 bool oldInTryStatement = inTryStatement;
820 inTryStatement = true; 822 inTryStatement = true;
821 node.visitChildren(this); 823 node.visitChildren(this);
822 inTryStatement = oldInTryStatement; 824 inTryStatement = oldInTryStatement;
823 } 825 }
824 } 826 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compile_time_constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698