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

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

Issue 2863073003: Access NativeData only through ClosedWorld (Closed)
Patch Set: Created 3 years, 7 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 part of js_backend.namer; 5 part of js_backend.namer;
6 6
7 class FrequencyBasedNamer extends Namer 7 class FrequencyBasedNamer extends Namer
8 with _MinifiedFieldNamer, _MinifiedOneShotInterceptorNamer 8 with _MinifiedFieldNamer, _MinifiedOneShotInterceptorNamer
9 implements jsAst.TokenFinalizer { 9 implements jsAst.TokenFinalizer {
10 _FieldNamingRegistry fieldRegistry; 10 _FieldNamingRegistry fieldRegistry;
(...skipping 10 matching lines...) Expand all
21 final String getterPrefix = 'g'; 21 final String getterPrefix = 'g';
22 final String setterPrefix = 's'; 22 final String setterPrefix = 's';
23 final String callPrefix = ''; // this will create function names $<n> 23 final String callPrefix = ''; // this will create function names $<n>
24 String get requiredParameterField => r'$R'; 24 String get requiredParameterField => r'$R';
25 String get defaultValuesField => r'$D'; 25 String get defaultValuesField => r'$D';
26 String get operatorSignature => r'$S'; 26 String get operatorSignature => r'$S';
27 27
28 jsAst.Name get staticsPropertyName => 28 jsAst.Name get staticsPropertyName =>
29 _staticsPropertyName ??= getFreshName(instanceScope, 'static'); 29 _staticsPropertyName ??= getFreshName(instanceScope, 'static');
30 30
31 FrequencyBasedNamer(NativeData nativeData, ClosedWorld closedWorld, 31 FrequencyBasedNamer(
32 CodegenWorldBuilder codegenWorldBuilder) 32 ClosedWorld closedWorld, CodegenWorldBuilder codegenWorldBuilder)
33 : super(nativeData, closedWorld, codegenWorldBuilder) { 33 : super(closedWorld, codegenWorldBuilder) {
34 fieldRegistry = new _FieldNamingRegistry(this); 34 fieldRegistry = new _FieldNamingRegistry(this);
35 } 35 }
36 36
37 TokenScope newScopeFor(NamingScope scope) { 37 TokenScope newScopeFor(NamingScope scope) {
38 if (scope == instanceScope) { 38 if (scope == instanceScope) {
39 Set<String> illegalNames = new Set<String>.from(jsReserved); 39 Set<String> illegalNames = new Set<String>.from(jsReserved);
40 for (String illegal in MinifyNamer._reservedNativeProperties) { 40 for (String illegal in MinifyNamer._reservedNativeProperties) {
41 illegalNames.add(illegal); 41 illegalNames.add(illegal);
42 if (MinifyNamer._hasBannedPrefix(illegal)) { 42 if (MinifyNamer._hasBannedPrefix(illegal)) {
43 illegalNames.add(illegal.substring(1)); 43 illegalNames.add(illegal.substring(1));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 String proposal; 136 String proposal;
137 do { 137 do {
138 proposal = new String.fromCharCodes(_nextName); 138 proposal = new String.fromCharCodes(_nextName);
139 _incrementName(); 139 _incrementName();
140 } while (MinifyNamer._hasBannedPrefix(proposal) || 140 } while (MinifyNamer._hasBannedPrefix(proposal) ||
141 illegalNames.contains(proposal)); 141 illegalNames.contains(proposal));
142 142
143 return proposal; 143 return proposal;
144 } 144 }
145 } 145 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_serialization.dart ('k') | pkg/compiler/lib/src/js_backend/minify_namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698