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

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

Issue 2675103003: Refactor BackendHelpers to be reusageable with KernelWorldBuilder (Closed)
Patch Set: Updated cf. comments Created 3 years, 10 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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 names.add("x"); 1366 names.add("x");
1367 } 1367 }
1368 // Sort the names of the classes after abbreviating them to ensure 1368 // Sort the names of the classes after abbreviating them to ensure
1369 // the suffix is stable and predictable for the suggested names. 1369 // the suffix is stable and predictable for the suggested names.
1370 names.sort(); 1370 names.sort();
1371 return names.join(); 1371 return names.join();
1372 } 1372 }
1373 1373
1374 /// Property name used for `getInterceptor` or one of its specializations. 1374 /// Property name used for `getInterceptor` or one of its specializations.
1375 jsAst.Name nameForGetInterceptor(Iterable<ClassEntity> classes) { 1375 jsAst.Name nameForGetInterceptor(Iterable<ClassEntity> classes) {
1376 FunctionElement getInterceptor = helpers.getInterceptorMethod; 1376 MethodElement getInterceptor = helpers.getInterceptorMethod;
1377 if (classes.contains(helpers.jsInterceptorClass)) { 1377 if (classes.contains(helpers.jsInterceptorClass)) {
1378 // If the base Interceptor class is in the set of intercepted classes, we 1378 // If the base Interceptor class is in the set of intercepted classes, we
1379 // need to go through the generic getInterceptorMethod, since any subclass 1379 // need to go through the generic getInterceptorMethod, since any subclass
1380 // of the base Interceptor could match. 1380 // of the base Interceptor could match.
1381 // The unspecialized getInterceptor method can also be accessed through 1381 // The unspecialized getInterceptor method can also be accessed through
1382 // its element, so we treat this as a user-space global instead of an 1382 // its element, so we treat this as a user-space global instead of an
1383 // internal global. 1383 // internal global.
1384 return _disambiguateGlobal(getInterceptor); 1384 return _disambiguateGlobal(getInterceptor);
1385 } 1385 }
1386 String suffix = suffixForGetInterceptor(classes); 1386 String suffix = suffixForGetInterceptor(classes);
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2192 void addSuggestion(String original, String suggestion) { 2192 void addSuggestion(String original, String suggestion) {
2193 assert(!_suggestedNames.containsKey(original)); 2193 assert(!_suggestedNames.containsKey(original));
2194 _suggestedNames[original] = suggestion; 2194 _suggestedNames[original] = suggestion;
2195 } 2195 }
2196 2196
2197 bool hasSuggestion(String original) => _suggestedNames.containsKey(original); 2197 bool hasSuggestion(String original) => _suggestedNames.containsKey(original);
2198 bool isSuggestion(String candidate) { 2198 bool isSuggestion(String candidate) {
2199 return _suggestedNames.containsValue(candidate); 2199 return _suggestedNames.containsValue(candidate);
2200 } 2200 }
2201 } 2201 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_interop_analysis.dart ('k') | pkg/compiler/lib/src/js_backend/patch_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698