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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/namer.dart

Issue 177963002: Use List instead of Link in the type system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 5 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
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 part of js_backend; 5 part of js_backend;
6 6
7 /** 7 /**
8 * Assigns JavaScript identifiers to Dart variables, class-names and members. 8 * Assigns JavaScript identifiers to Dart variables, class-names and members.
9 */ 9 */
10 class Namer implements ClosureNamer { 10 class Namer implements ClosureNamer {
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 visit(DartType type) { 1340 visit(DartType type) {
1341 type.accept(this, null); 1341 type.accept(this, null);
1342 } 1342 }
1343 1343
1344 visitType(DartType type, _) { 1344 visitType(DartType type, _) {
1345 sb.write(type.name); 1345 sb.write(type.name);
1346 } 1346 }
1347 1347
1348 visitFunctionType(FunctionType type, _) { 1348 visitFunctionType(FunctionType type, _) {
1349 if (backend.rti.isSimpleFunctionType(type)) { 1349 if (backend.rti.isSimpleFunctionType(type)) {
1350 sb.write('args${type.parameterTypes.slowLength()}'); 1350 sb.write('args${type.parameterTypes.length}');
1351 return; 1351 return;
1352 } 1352 }
1353 visit(type.returnType); 1353 visit(type.returnType);
1354 sb.write('_'); 1354 sb.write('_');
1355 for (Link<DartType> link = type.parameterTypes; 1355 for (DartType parameter in type.parameterTypes) {
1356 !link.isEmpty;
1357 link = link.tail) {
1358 sb.write('_'); 1356 sb.write('_');
1359 visit(link.head); 1357 visit(parameter);
1360 } 1358 }
1361 bool first = false; 1359 bool first = false;
1362 for (Link<DartType> link = type.optionalParameterTypes; 1360 for (DartType parameter in type.optionalParameterTypes) {
1363 !link.isEmpty;
1364 link = link.tail) {
1365 if (!first) { 1361 if (!first) {
1366 sb.write('_'); 1362 sb.write('_');
1367 } 1363 }
1368 sb.write('_'); 1364 sb.write('_');
1369 visit(link.head); 1365 visit(parameter);
1370 first = true; 1366 first = true;
1371 } 1367 }
1372 if (!type.namedParameterTypes.isEmpty) { 1368 if (!type.namedParameterTypes.isEmpty) {
1373 first = false; 1369 first = false;
1374 for (Link<DartType> link = type.namedParameterTypes; 1370 for (DartType parameter in type.namedParameterTypes) {
1375 !link.isEmpty;
1376 link = link.tail) {
1377 if (!first) { 1371 if (!first) {
1378 sb.write('_'); 1372 sb.write('_');
1379 } 1373 }
1380 sb.write('_'); 1374 sb.write('_');
1381 visit(link.head); 1375 visit(parameter);
1382 first = true; 1376 first = true;
1383 } 1377 }
1384 } 1378 }
1385 } 1379 }
1386 } 1380 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698