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

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

Issue 103863004: Revert "Generate tear-off closures dynamically." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 return nameString; 362 return nameString;
363 } else { 363 } else {
364 // Make sure to return a private name that starts with _ so it 364 // Make sure to return a private name that starts with _ so it
365 // cannot clash with any public names. 365 // cannot clash with any public names.
366 String libraryName = getNameOfLibrary(library); 366 String libraryName = getNameOfLibrary(library);
367 return '_$libraryName\$$nameString'; 367 return '_$libraryName\$$nameString';
368 } 368 }
369 } 369 }
370 370
371 String instanceMethodName(FunctionElement element) { 371 String instanceMethodName(FunctionElement element) {
372 // TODO(ahe): Could this be: return invocationName(new
373 // Selector.fromElement(element))?
374 String elementName = element.name; 372 String elementName = element.name;
375 String name = operatorNameToIdentifier(elementName); 373 String name = operatorNameToIdentifier(elementName);
376 if (name != elementName) return getMappedOperatorName(name); 374 if (name != elementName) return getMappedOperatorName(name);
377 375
378 LibraryElement library = element.getLibrary(); 376 LibraryElement library = element.getLibrary();
379 if (element.isGenerativeConstructorBody()) { 377 if (element.isGenerativeConstructorBody()) {
380 name = Elements.reconstructConstructorNameSourceString(element); 378 name = Elements.reconstructConstructorNameSourceString(element);
381 } 379 }
382 FunctionSignature signature = element.computeSignature(compiler); 380 FunctionSignature signature = element.computeSignature(compiler);
383 String methodName = 381 String methodName =
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 874
877 String isolateAccess(Element element) { 875 String isolateAccess(Element element) {
878 return "${globalObjectFor(element)}.${getNameX(element)}"; 876 return "${globalObjectFor(element)}.${getNameX(element)}";
879 } 877 }
880 878
881 String isolateLazyInitializerAccess(Element element) { 879 String isolateLazyInitializerAccess(Element element) {
882 return "${globalObjectFor(element)}.${getLazyInitializerName(element)}"; 880 return "${globalObjectFor(element)}.${getLazyInitializerName(element)}";
883 } 881 }
884 882
885 String isolateStaticClosureAccess(Element element) { 883 String isolateStaticClosureAccess(Element element) {
886 return "${globalObjectFor(element)}.${getStaticClosureName(element)}()"; 884 return "${globalObjectFor(element)}.${getStaticClosureName(element)}";
887 } 885 }
888 886
889 String globalObjectForConstant(Constant constant) => 'C'; 887 String globalObjectForConstant(Constant constant) => 'C';
890 888
891 String operatorIsPrefix() => r'$is'; 889 String operatorIsPrefix() => r'$is';
892 890
893 String operatorAsPrefix() => r'$as'; 891 String operatorAsPrefix() => r'$as';
894 892
895 String operatorSignature() => r'$signature'; 893 String operatorSignature() => r'$signature';
896 894
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 if (!first) { 1380 if (!first) {
1383 sb.write('_'); 1381 sb.write('_');
1384 } 1382 }
1385 sb.write('_'); 1383 sb.write('_');
1386 visit(link.head); 1384 visit(link.head);
1387 first = true; 1385 first = true;
1388 } 1386 }
1389 } 1387 }
1390 } 1388 }
1391 } 1389 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698