| OLD | NEW |
| 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 // TODO(floitsch): we want more information than just the method name. For | 9 final Set<FunctionElement> staticFunctionsNeedingGetter; |
| 10 // example the number of arguments, etc. | |
| 11 final Map<SourceString, Set<Selector>> invokedNames; | 10 final Map<SourceString, Set<Selector>> invokedNames; |
| 12 final Set<SourceString> invokedGetters; | 11 final Set<SourceString> invokedGetters; |
| 13 final Set<SourceString> invokedSetters; | 12 final Set<SourceString> invokedSetters; |
| 14 final Map<String, LibraryElement> libraries; | 13 final Map<String, LibraryElement> libraries; |
| 15 | 14 |
| 16 Universe() : generatedCode = new Map<Element, String>(), | 15 Universe() : generatedCode = new Map<Element, String>(), |
| 17 generatedBailoutCode = new Map<Element, String>(), | 16 generatedBailoutCode = new Map<Element, String>(), |
| 18 libraries = new Map<String, LibraryElement>(), | 17 libraries = new Map<String, LibraryElement>(), |
| 19 instantiatedClasses = new Set<ClassElement>(), | 18 instantiatedClasses = new Set<ClassElement>(), |
| 19 staticFunctionsNeedingGetter = new Set<FunctionElement>(), |
| 20 invokedNames = new Map<SourceString, Set<Invocation>>(), | 20 invokedNames = new Map<SourceString, Set<Invocation>>(), |
| 21 invokedGetters = new Set<SourceString>(), | 21 invokedGetters = new Set<SourceString>(), |
| 22 invokedSetters = new Set<SourceString>(); | 22 invokedSetters = new Set<SourceString>(); |
| 23 | 23 |
| 24 void addGeneratedCode(WorkItem work, String code) { | 24 void addGeneratedCode(WorkItem work, String code) { |
| 25 if (work.isBailoutVersion()) { | 25 if (work.isBailoutVersion()) { |
| 26 generatedBailoutCode[work.element] = code; | 26 generatedBailoutCode[work.element] = code; |
| 27 } else { | 27 } else { |
| 28 generatedCode[work.element] = code; | 28 generatedCode[work.element] = code; |
| 29 } | 29 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments; | 141 if (!orderedNamedArguments.isEmpty()) return orderedNamedArguments; |
| 142 | 142 |
| 143 List<SourceString> list = new List<SourceString>.from(namedArguments); | 143 List<SourceString> list = new List<SourceString>.from(namedArguments); |
| 144 list.sort((SourceString first, SourceString second) { | 144 list.sort((SourceString first, SourceString second) { |
| 145 return first.stringValue.compareTo(second.stringValue); | 145 return first.stringValue.compareTo(second.stringValue); |
| 146 }); | 146 }); |
| 147 orderedNamedArguments = list; | 147 orderedNamedArguments = list; |
| 148 return orderedNamedArguments; | 148 return orderedNamedArguments; |
| 149 } | 149 } |
| 150 } | 150 } |
| OLD | NEW |