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

Side by Side Diff: dart/frog/leg/universe.dart

Issue 9474040: Improve exception handling: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add TODO Created 8 years, 9 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 | « dart/frog/leg/ssa/nodes.dart ('k') | dart/tests/co19/co19-leg.status » ('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 class Universe { 5 class Universe {
6 Map<Element, String> generatedCode; 6 Map<Element, String> generatedCode;
7 Map<Element, String> generatedBailoutCode; 7 Map<Element, String> generatedBailoutCode;
8 final Set<ClassElement> instantiatedClasses; 8 final Set<ClassElement> instantiatedClasses;
9 final Set<FunctionElement> staticFunctionsNeedingGetter; 9 final Set<FunctionElement> staticFunctionsNeedingGetter;
10 final Map<SourceString, Set<Selector>> invokedNames; 10 final Map<SourceString, Set<Selector>> invokedNames;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 static final Selector BINARY_OPERATOR = 60 static final Selector BINARY_OPERATOR =
61 const Selector(SelectorKind.OPERATOR, 1); 61 const Selector(SelectorKind.OPERATOR, 1);
62 static final Selector INDEX = const Selector(SelectorKind.INDEX, 1); 62 static final Selector INDEX = const Selector(SelectorKind.INDEX, 1);
63 static final Selector INDEX_SET = const Selector(SelectorKind.INDEX, 2); 63 static final Selector INDEX_SET = const Selector(SelectorKind.INDEX, 2);
64 static final Selector INDEX_AND_INDEX_SET = 64 static final Selector INDEX_AND_INDEX_SET =
65 const Selector(SelectorKind.INDEX, 2); 65 const Selector(SelectorKind.INDEX, 2);
66 static final Selector GETTER_AND_SETTER = 66 static final Selector GETTER_AND_SETTER =
67 const Selector(SelectorKind.SETTER, 1); 67 const Selector(SelectorKind.SETTER, 1);
68 static final Selector INVOCATION_0 = 68 static final Selector INVOCATION_0 =
69 const Selector(SelectorKind.INVOCATION, 0); 69 const Selector(SelectorKind.INVOCATION, 0);
70 static final Selector INVOCATION_1 =
71 const Selector(SelectorKind.INVOCATION, 1);
70 72
71 bool applies(Compiler compiler, FunctionElement element) { 73 bool applies(Compiler compiler, FunctionElement element) {
72 FunctionParameters parameters = element.computeParameters(compiler); 74 FunctionParameters parameters = element.computeParameters(compiler);
73 if (argumentCount > parameters.parameterCount) return false; 75 if (argumentCount > parameters.parameterCount) return false;
74 int requiredParameterCount = parameters.requiredParameterCount; 76 int requiredParameterCount = parameters.requiredParameterCount;
75 int optionalParameterCount = parameters.optionalParameterCount; 77 int optionalParameterCount = parameters.optionalParameterCount;
76 78
77 bool hasOptionalParameters = !parameters.optionalParameters.isEmpty(); 79 bool hasOptionalParameters = !parameters.optionalParameters.isEmpty();
78 if (namedArguments.isEmpty()) { 80 if (namedArguments.isEmpty()) {
79 if (!hasOptionalParameters) { 81 if (!hasOptionalParameters) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments; 143 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments;
142 144
143 List<SourceString> list = new List<SourceString>.from(namedArguments); 145 List<SourceString> list = new List<SourceString>.from(namedArguments);
144 list.sort((SourceString first, SourceString second) { 146 list.sort((SourceString first, SourceString second) {
145 return first.stringValue.compareTo(second.stringValue); 147 return first.stringValue.compareTo(second.stringValue);
146 }); 148 });
147 orderedNamedArguments = list; 149 orderedNamedArguments = list;
148 return orderedNamedArguments; 150 return orderedNamedArguments;
149 } 151 }
150 } 152 }
OLDNEW
« no previous file with comments | « dart/frog/leg/ssa/nodes.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698