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

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

Issue 1093363002: Refactor DartTypeVisitor and ElementVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 | 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 * Names are generated through three stages: 10 * Names are generated through three stages:
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 return hash; 1704 return hash;
1705 } 1705 }
1706 1706
1707 static int _finish(int hash) { 1707 static int _finish(int hash) {
1708 hash = _MASK & (hash + (((_MASK >> 3) & hash) << 3)); 1708 hash = _MASK & (hash + (((_MASK >> 3) & hash) << 3));
1709 hash = hash & (hash >> 11); 1709 hash = hash & (hash >> 11);
1710 return _MASK & (hash + (((_MASK >> 15) & hash) << 15)); 1710 return _MASK & (hash + (((_MASK >> 15) & hash) << 15));
1711 } 1711 }
1712 } 1712 }
1713 1713
1714 class FunctionTypeNamer extends DartTypeVisitor { 1714 class FunctionTypeNamer extends BaseDartTypeVisitor {
1715 final Compiler compiler; 1715 final Compiler compiler;
1716 StringBuffer sb; 1716 StringBuffer sb;
1717 1717
1718 FunctionTypeNamer(this.compiler); 1718 FunctionTypeNamer(this.compiler);
1719 1719
1720 JavaScriptBackend get backend => compiler.backend; 1720 JavaScriptBackend get backend => compiler.backend;
1721 1721
1722 String computeName(DartType type) { 1722 String computeName(DartType type) {
1723 sb = new StringBuffer(); 1723 sb = new StringBuffer();
1724 visit(type); 1724 visit(type);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 if (!first) { 1759 if (!first) {
1760 sb.write('_'); 1760 sb.write('_');
1761 } 1761 }
1762 sb.write('_'); 1762 sb.write('_');
1763 visit(parameter); 1763 visit(parameter);
1764 first = true; 1764 first = true;
1765 } 1765 }
1766 } 1766 }
1767 } 1767 }
1768 } 1768 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698