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

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

Issue 422483002: Mix in [TreeElementMixin] only on nodes that need it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.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 "js_backend/js_backend.dart" show JavaScriptBackend; 10 import "js_backend/js_backend.dart" show JavaScriptBackend;
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 // the work of the resolver. It is the resolver's job to create 995 // the work of the resolver. It is the resolver's job to create
996 // parameters, etc. Other phases should only visit statements. 996 // parameters, etc. Other phases should only visit statements.
997 if (node.parameters != null) node.parameters.accept(this); 997 if (node.parameters != null) node.parameters.accept(this);
998 if (node.initializers != null) node.initializers.accept(this); 998 if (node.initializers != null) node.initializers.accept(this);
999 if (node.body != null) node.body.accept(this); 999 if (node.body != null) node.body.accept(this);
1000 }); 1000 });
1001 } 1001 }
1002 1002
1003 visitFunctionDeclaration(FunctionDeclaration node) { 1003 visitFunctionDeclaration(FunctionDeclaration node) {
1004 node.visitChildren(this); 1004 node.visitChildren(this);
1005 LocalFunctionElement localFunction = elements[node]; 1005 LocalFunctionElement localFunction =
1006 elements.getFunctionDefinition(node.function);
1006 declareLocal(localFunction); 1007 declareLocal(localFunction);
1007 } 1008 }
1008 1009
1009 visitTryStatement(TryStatement node) { 1010 visitTryStatement(TryStatement node) {
1010 // TODO(ngeoffray): implement finer grain state. 1011 // TODO(ngeoffray): implement finer grain state.
1011 bool oldInTryStatement = inTryStatement; 1012 bool oldInTryStatement = inTryStatement;
1012 inTryStatement = true; 1013 inTryStatement = true;
1013 node.visitChildren(this); 1014 node.visitChildren(this);
1014 inTryStatement = oldInTryStatement; 1015 inTryStatement = oldInTryStatement;
1015 } 1016 }
1016 } 1017 }
1017 1018
1018 /// A type variable as a local variable. 1019 /// A type variable as a local variable.
1019 class TypeVariableLocal implements Local { 1020 class TypeVariableLocal implements Local {
1020 final TypeVariableType typeVariable; 1021 final TypeVariableType typeVariable;
1021 final ExecutableElement executableContext; 1022 final ExecutableElement executableContext;
1022 1023
1023 TypeVariableLocal(this.typeVariable, this.executableContext); 1024 TypeVariableLocal(this.typeVariable, this.executableContext);
1024 1025
1025 String get name => typeVariable.name; 1026 String get name => typeVariable.name;
1026 1027
1027 int get hashCode => typeVariable.hashCode; 1028 int get hashCode => typeVariable.hashCode;
1028 1029
1029 bool operator ==(other) { 1030 bool operator ==(other) {
1030 if (other is! TypeVariableLocal) return false; 1031 if (other is! TypeVariableLocal) return false;
1031 return typeVariable == other.typeVariable; 1032 return typeVariable == other.typeVariable;
1032 } 1033 }
1033 } 1034 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698