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

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

Issue 18156006: Fix minified signature generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Restrict use of fixed names to this-elements. Created 7 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
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 * A function element that represents a closure call. The signature is copied 8 * A function element that represents a closure call. The signature is copied
9 * from the given element. 9 * from the given element.
10 */ 10 */
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 void generateFunctionTypeSignature(Element method, FunctionType type) { 1360 void generateFunctionTypeSignature(Element method, FunctionType type) {
1361 assert(method.isImplementation); 1361 assert(method.isImplementation);
1362 String thisAccess = 'this'; 1362 String thisAccess = 'this';
1363 Node node = method.parseNode(compiler); 1363 Node node = method.parseNode(compiler);
1364 ClosureClassMap closureData = 1364 ClosureClassMap closureData =
1365 compiler.closureToClassMapper.closureMappingCache[node]; 1365 compiler.closureToClassMapper.closureMappingCache[node];
1366 if (closureData != null) { 1366 if (closureData != null) {
1367 Element thisElement = 1367 Element thisElement =
1368 closureData.freeVariableMapping[closureData.thisElement]; 1368 closureData.freeVariableMapping[closureData.thisElement];
1369 if (thisElement != null) { 1369 if (thisElement != null) {
1370 String thisName = backend.namer.getName(thisElement); 1370 String thisName = thisElement.hasFixedBackendName()
karlklose 2013/07/04 09:54:09 Is that always the case? Add an assert then?
Johnni Winther 2013/07/04 12:10:38 It seems so.
1371 ? thisElement.fixedBackendName()
1372 : backend.namer.getName(thisElement);
1371 thisAccess = 'this.$thisName'; 1373 thisAccess = 'this.$thisName';
1372 } 1374 }
1373 } 1375 }
1374 RuntimeTypes rti = backend.rti; 1376 RuntimeTypes rti = backend.rti;
1375 String encoding = rti.getSignatureEncoding(type, () => '$thisAccess'); 1377 String encoding = rti.getSignatureEncoding(type, () => '$thisAccess');
1376 String operatorSignature = namer.operatorSignature(); 1378 String operatorSignature = namer.operatorSignature();
1377 builder.addProperty(operatorSignature, 1379 builder.addProperty(operatorSignature,
1378 new jsAst.LiteralExpression(encoding)); 1380 new jsAst.LiteralExpression(encoding));
1379 } 1381 }
1380 1382
(...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after
3700 3702
3701 const String HOOKS_API_USAGE = """ 3703 const String HOOKS_API_USAGE = """
3702 // The code supports the following hooks: 3704 // The code supports the following hooks:
3703 // dartPrint(message) - if this function is defined it is called 3705 // dartPrint(message) - if this function is defined it is called
3704 // instead of the Dart [print] method. 3706 // instead of the Dart [print] method.
3705 // dartMainRunner(main) - if this function is defined, the Dart [main] 3707 // dartMainRunner(main) - if this function is defined, the Dart [main]
3706 // method will not be invoked directly. 3708 // method will not be invoked directly.
3707 // Instead, a closure that will invoke [main] is 3709 // Instead, a closure that will invoke [main] is
3708 // passed to [dartMainRunner]. 3710 // passed to [dartMainRunner].
3709 """; 3711 """;
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698