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

Side by Side Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 2829683007: Extract DartTypeVisitor and subclasses from resolution_types. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 js_backend.namer; 5 library js_backend.namer;
6 6
7 import 'dart:collection' show HashMap; 7 import 'dart:collection' show HashMap;
8 8
9 import 'package:js_runtime/shared/embedded_names.dart' show JsGetName; 9 import 'package:js_runtime/shared/embedded_names.dart' show JsGetName;
10 10
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 return hash; 2103 return hash;
2104 } 2104 }
2105 2105
2106 static int _finish(int hash) { 2106 static int _finish(int hash) {
2107 hash = _MASK & (hash + (((_MASK >> 3) & hash) << 3)); 2107 hash = _MASK & (hash + (((_MASK >> 3) & hash) << 3));
2108 hash = hash & (hash >> 11); 2108 hash = hash & (hash >> 11);
2109 return _MASK & (hash + (((_MASK >> 15) & hash) << 15)); 2109 return _MASK & (hash + (((_MASK >> 15) & hash) << 15));
2110 } 2110 }
2111 } 2111 }
2112 2112
2113 class FunctionTypeNamer extends BaseDartTypeVisitor { 2113 class FunctionTypeNamer extends BaseResolutionDartTypeVisitor {
2114 final RuntimeTypesEncoder rtiEncoder; 2114 final RuntimeTypesEncoder rtiEncoder;
2115 StringBuffer sb; 2115 StringBuffer sb;
2116 2116
2117 FunctionTypeNamer(this.rtiEncoder); 2117 FunctionTypeNamer(this.rtiEncoder);
2118 2118
2119 String computeName(ResolutionDartType type) { 2119 String computeName(ResolutionDartType type) {
2120 sb = new StringBuffer(); 2120 sb = new StringBuffer();
2121 visit(type); 2121 visit(type);
2122 return sb.toString(); 2122 return sb.toString();
2123 } 2123 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2183 void addSuggestion(String original, String suggestion) { 2183 void addSuggestion(String original, String suggestion) {
2184 assert(!_suggestedNames.containsKey(original)); 2184 assert(!_suggestedNames.containsKey(original));
2185 _suggestedNames[original] = suggestion; 2185 _suggestedNames[original] = suggestion;
2186 } 2186 }
2187 2187
2188 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); 2188 bool hasSuggestion(String original) => _suggestedNames.containsKey(original);
2189 bool isSuggestion(String candidate) { 2189 bool isSuggestion(String candidate) {
2190 return _suggestedNames.containsValue(candidate); 2190 return _suggestedNames.containsValue(candidate);
2191 } 2191 }
2192 } 2192 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/types.dart ('k') | pkg/compiler/lib/src/js_backend/runtime_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698